How can I program multiple BC buffers and BC interrupts with BusTools/1553-API?
This is a basic example program that sets up a simple BC Simulation. It sends commands to RT1 SA1 RECEIVE and RT1 SA2 TRANSMIT.
This program uses multiple buffers (2) for the BC message and uses INTERRUPT EVENTS to detect when these messages have sent or received data so you can safely read or write the buffers.
You get one interrupt per frame. The last message in the frame generates the interrupt. Therefore we update and swap buffers at the end of every minor frame.
Use a bus analyzer (e.g. BusTools/1553) as the remote terminal simulating RT1 SA1 Receive and RT1 SA2 Transmit. Monitor the data sent to RT1 SA1 Receive; you should see the upper byte of all data words increment on each message.
BC multiple buffers do not automatically ping-pong. The user application must change the active buffer directly. We do this in our event handler function.
Download this example by clicking the attachment link on the right.