Using An Application Programming Interface API To Simplify Mil STD 1553 Designs - Whitepaperpdf.render
Using An Application Programming Interface API To Simplify Mil STD 1553 Designs - Whitepaperpdf.render
September 2014
Anthony Murray
Subsystem3
RT2
RT3
Bus A
Bus B
BC
RT1
MT
Subsystem1
System
application
e.g. sensor array
Host
Interface
Host MCU
MIL-STD-1553
Protocol
and
Bus Interface
BC
RT
Memory
MT
Application
Hardware (LRU)
End
User 1
MIL-STD-1553
Bus
End
User 2
.
.
.
End
User n
Termination
Bare Metal
(No OS)
API
Low Level Drivers
Hardware
Message 2
Message 1
BC
Command
RT Status
Response
Transmit
Command
Status
Word
RT Transmitted
Data
Data
Word 2
Data
Word 1
tr
Data
Word 32
Next
Command
tg
tr = Response Time
tg = Intermessage Gap
BC
Command
Response
tr
Response
BC
Command
Message 2
.....
Message n
Next
Major Frame
Minor
Frame Period
Minor
Frame 1
Response
tr = Response Time
tg = Inter-message Gap
tg
Message 1
BC
Command
Response
Minor
Frame 2
Minor
Frame 3
Minor
Frame 4
Minor
Frame n
Minor
Frame 1
.....
frame once every major frame (1s period). In the same major/minor frame hierarchy, a 10Hz message
would appear every tenth minor frame (100ms period).
The set up of BC message schedules similar to above is often programmed using high-level API functions
which access the MIL-STD-1553 protocol and bus interface at the register level (see Figure 2).
Op Codes
The HI-6130 supports a set of instruction op codes, which are used for message execution and control.
The API function BCOpcodeCreate() enables the user to create individual op codes by specifying the op
code type as an input parameter. The most common op code type is OpcodeXEQ (message execution);
other examples are OpcodeIRQ (generate host interrupt) and OpcodeLTT (load time-tag counter).
Op code definition is extremely important as this is the basis for minor and major frame creation. Many
op codes may be executed conditionally by specifying an associated condition parameter. Figure 7
shows how op codes interact with Message Blocks.
Minor and Major Frame Set-Up and Execution
As seen in Figure 5, a minor frame is essentially a collection of messages within a fixed time slot. Since
the HI-6130 requires all message and frame control be encapsulated in an op code, the device defines a
minor frame as a collection of op codes operating on messages. The majority of these op codes will be
OpcodeXEQ (message execution). Minor frames are generated using the API function
BCFrameCreate(). The user must specify an array of op code IDs (from previously defined op codes) as
an input parameter. Other parameters are the frame type (minor or major) and the total frame time.
The same function BCFrameCreate() is used to create major frames. A major frame is essentially defined
as a collection of op codes, OpcodeCMF, calling previously defined minor frames. The minor frame ID
is specified as an input parameter.
Figure 7 shows a typical BC messages sequence structure.
BCDataBlkCreate()
Channel ID (0 to 31)
Data Block ID (DBLK1)
Data Block Size
Initial Data Pointer
Block Word Count
BCMsgCreateBCtoRT()
Channel ID (0 to 31)
Message ID (MSG1)
Associated Data Block ID (DBLK1)
Receiving RT Address (0 to 31)
Receiving RT Subaddress (1 to 31)
Message Word Count
Time to next message
BC Control Word Options
BCOpcodeCreate()
Channel ID (0 to 31)
Opcode ID (OP1)
Opcode Type (OpcodeXEQ)
Condition
Parameter 1 (MSG1)
// Create CMF op code that calls minor frame MNR1 from major frame.
BCOpcodeCreate()
Channel ID (0 to 31)
Opcode ID (OP2)
Opcode Type (OpcodeCMF)
Condition
Parameter 1 (MNR1)
// Create minor frame MNR1 10ms in length which executes op codes specified by Opcode IDs.
Opcode IDs will be a list of OpcodeXEQ op codes for each message in the minor frame.
BCFrameCreate()
Channel ID (0 to 31)
Frame ID (MNR1)
Frame Type (Minor)
Opcode IDs (XEQ1, XEQ2, ....)
Opcode Count
Frame Time (10ms)
// Create major frame MJR1 1s in length which executes op codes specified by Opcode IDs.
Opcode IDs will be a list of OpcodeCMF op codes for each minor frame in the major frame.
BCFrameCreate()
Channel ID (0 to 31)
Frame ID (MJR1)
Frame Type (Major)
Opcode IDs (CMF1, CMF2, ....)
Opcode Count
Frame Time (1s)
Message 1 (MSG1)
BC Control Word
Data Word n
Rx Command Word
(RT-RT only)
Data Word(s)
CMF
XEQ
Data Word 1
CMF
XEQ
.
.
.
.
.
.
.
.
.
.
Time-Tag Word
Message 2 (MSG2)
BC Control Word
Data Word n
Rx Command Word
(RT-RT only)
Data Word(s)
Data Word 1
.
.
.
.
.
Other Messages
in MNR1
Message 3 (MSG3)
BC Control Word
Data Word n
Rx Command Word
(RT-RT only)
Data Word(s)
XEQ
Data Word 1
XEQ
.
.
.
.
.
.
.
Message 4 (MSG4)
BC Control Word
Data Word n
Rx Command Word
(RT-RT only)
Data Word(s)
Data Word 1
.
.
.
.
Other Messages
in MNR2
Conclusion
This paper demonstrates how an Application Programming Interface (API) may be used to control a
complex system such as a MIL-STD-1553 data bus. The lowest level of control typically occurs at the
protocol IC register level, which requires an in depth knowledge of vender-specific hardware. An API
provides a level of abstraction through a series of high-level function calls, communicating with the
protocol IC at the register level via vender-supplied low-level drivers. This enables the software engineer
to control the flow of data from the application layer to the physical bus, without being intimately
familiar with the hardware.
References
1. HI-6130 Datasheet: MIL-STD-1553 / MIL-STD-1760, 3.3V BC/MT/RT Multi-Terminal Device
2. HI-6130 API Library Software Manual
Contact Information
Holt Integrated Circuits,
23351 Madero,
Mission Viejo. CA 92691.
Email: amurray@holtic.com
Tel: +1 949 859 8800.