What is the relationship between minor frames, major frames, and minor frame overflow?
A minor frame is a set of 1553 messages. You mark the first message in the set with begin-minor-frame and the last message in the set with the end-minor-frame. The firmware sends these messages in order on the interval of the minor-frame rate. You can setup one or more minor frames. There is an example of setting up minor frames in the attached sample code.
The major frame is a group of minor frames. You can have a single minor frame or several minor frames in your major frame. When you create a minor frame, each message in the frame points to the next message. The last message in a minor frame points to the first message in the next minor frame. The last message in the last minor frame points to the first message in the first minor frame. When you link the minor frames like this, you create a major frame.
The minor-frames start on an interval of the Frame Rate you program in the call to BusTools_BC_Init(). If you have a single minor-frame it starts transmitting on every frame rate interval. If you have multiple minor-frame, the firmware start each minor-frame on the frame rate interval in sequence until it sends all the minor-frames. It will then start again on the first minor-frame. For example, if you a have a 1 second frame rate and two minor frames, each frame will run every 2 second.
You need to consider one issue. When you create a minor frame, the time that it takes to send the messages in the frame can not exceed the frame rate. If this happens, you get a minor frame overflow. You can get this error if you do not have the begin-minor-frame or end-minor-frame correctly set. You can also get this message on some boards if they are not properly terminated.
The attached source code shows how to set up interrupts for both the Bus Controller and Remote Terminal. In the example code, a bus controller was set up to send messages to RT addresses 2, 3, 4, and 5. The RT code sets up RTs to respond to the commands. Two interrupt functions are also set up, one to process BC interrupts the other to process RT interrupts.