How can I program multiple RT buffers with Mode Codes and interrupts using BusTools/1553-API?

This is a basic example program that sets up a simple RT Simulation. It simulates RT1 with two subaddresses: SA1 RECEIVE and SA2 TRANSMIT.

This program adds multiple buffers (2) for each SA and uses INTERRUPT EVENTS to detect when these SA have sent/received data so we can safely read/write the buffers.

Use a bus analyzer (BusTools/1553) as the bus controller to send messages to RT1 SA1 Receive and RT1 SA2 Transmit. Monitor the data sent by RT1 SA2 Transmit - you should see the upper byte of all data words increment on each message RT1 SA2 sends.

Each time this program receives a message for RT1 SA1 Receive, it prints an asterisk.

This program is a variant of EXAMPLE_RT2.C that adds handling of MODE CODE messages (with interrupts).

Download this example by clicking the attachments link on the right.