Skip to content

o1553_codec: Specification

1. Overview

o1553_codec is the bus interface of Open1553 (architecture blocks CD-1 to CD-6). It encodes the words of a transmission into the Manchester II bi-phase signal of MIL-STD-1553B and drives the transmitter of the selected bus; in the other direction it decodes the receiver signals of both buses into validated words with their timing. It holds the transmitter enables of the dual-redundant bus, the terminal fail-safe timers and the transmission monitor.

Block Entity Function
CD-1 o1553_codec Transceiver interface: output registers, receiver enables, input synchronisers, three-level line state
CD-2 o1553_codec_encoder Encoder: words to the Manchester II signal at 1 Mb/s, syncs, parity, contiguous words
CD-3 o1553_codec_decoder (one per bus) Decoder: glitch filter, zero-crossing timing, syncs, bits, word validation, contiguity
CD-4 o1553_codec_fail_safe (one per bus) Fail-safe timer: transmitter time-out independent of the encoder
CD-5 o1553_codec_monitor Transmission monitor: own words compared with the words sent
CD-6 o1553_codec_bus_selector Bus selector: routing of the encoder, transmitter enables, transmitter shutdown state

All blocks run in Clk. The receiver outputs are asynchronous to Clk. Clause references: MIL = MIL-STD-1553B (Notice 2), ECSS = ECSS-E-ST-50-13C.

Terms used below:

  • Line state: positive (Bus_RxP = '1', Bus_RxN = '0'), negative (Bus_RxP = '0', Bus_RxN = '1') or zero (both '0', and both '1', which a correct transceiver does not produce).
  • Zero crossing: a change from the positive to the negative line state or back, directly or through the zero state.
  • Reference crossing: the mid-bit zero crossing of the parity bit of a word. MIL measures response time, gaps and time-outs from it (MIL 4.3.3.7 to 4.3.3.9).
  • Mid-sync crossing: the zero crossing in the middle of the sync of a word, 1.5 bit times after its start.
  • Half bit: 0.5 us, H = ClkFreq_g / 2 MHz clock cycles.

2. Requirements

2.1 Interfaces

ID Requirement Clauses
CD-IF-01 Per bus (index 0 = bus A, the nominal bus; index 1 = bus B, the redundant bus) the codec shall drive the transmit signals Bus_TxP, Bus_TxN and Bus_TxInh and the receiver enable Bus_RxEn directly from registers, and receive the comparator outputs Bus_RxP and Bus_RxN. MIL 4.3.3.1, 4.6.3; ECSS 5.6a
CD-IF-02 The codec shall take the words of a transmission as a valid / ready stream (Tx_Valid, Tx_Ready) of sync type (Tx_Sync: '1' command/status sync, '0' data sync), 16 data bits (Tx_Data, bit 15 the most significant bit) and the last-word flag (Tx_Last); the bus (Tx_Bus: '0' bus A, '1' bus B) is taken with the first word of the transmission. MIL 4.3.3.5
CD-IF-03 The codec shall report the end of every transmission as a one-cycle event (Tx_Done) with its outcome (Tx_Result: complete, ended after an underrun, aborted), show a transmission in progress as a level (Tx_Busy), and show as a level whether the outputs of the bus of the transmission in progress have been idle in at least one of its cycles, the current cycle included (Tx_Suppressed; with Tx_Done for the whole transmission; '1' outside a transmission). none
CD-IF-04 The codec shall report every word decoded on a bus as a one-cycle event (Rx_Valid(b)) with its sync type, its 16 data bits, its validation result (valid or the error kind of CD-DE-07), the contiguous flag, the gap of CD-DE-09 and the own-transmission flag of CD-DE-10. Both buses report independently and may report in the same cycle. MIL 4.4.1.1
CD-IF-05 The codec shall take the bus enables of the host (Cfg_BusEn), the enable of the transmission monitor (Cfg_MonEn), the transmitter shutdown commands (Sd_Set, Sd_Clr, per bus), the abort command (Tx_Abort) and the fail-safe release (Fs_Clr, per bus), and report the effective transmitter enables, the shutdown and fail-safe states per bus as levels and the loopback errors as one-cycle events. none
CD-IF-06 The codec shall report line activity without a word on each bus as a one-cycle event (Rx_NoWord(b)) with its duration in clock cycles (Rx_NoWordLen, 16 bits per bus, bus b in bits 16b+15 to 16b) (CD-DE-14). none

2.2 Encoder (CD-2)

ID Requirement Clauses
CD-EN-01 Every bit shall be sent as Manchester II bi-phase level: a one as the positive line state for the first half bit and the negative line state for the second, a zero as the negative line state followed by the positive one, with the transition in the middle of the bit. MIL 4.3.3.1, 4.3.3.2
CD-EN-02 The half bit shall last exactly H clock cycles, so that the bit rate is 1 Mb/s with the accuracy and stability of Clk. MIL 4.3.3.3; ECSS 5.6a
CD-EN-03 A word shall be sent as a sync of three bit times, the 16 data bits with the most significant bit first and a parity bit that makes the number of ones in the 16 data bits and the parity bit odd: 20 bit times. MIL 4.3.2, 4.3.3.4, 4.3.3.5, 4.3.3.5.1.6, 4.3.3.5.2.2, 4.3.3.5.2.3, 4.3.3.5.3.12
CD-EN-04 The command/status sync shall be the positive line state for 1.5 bit times followed by the negative line state for 1.5 bit times; the data sync shall be the negative line state followed by the positive one, each for 1.5 bit times. MIL 4.3.3.5.1.1, 4.3.3.5.2.1, 4.3.3.5.3.1
CD-EN-05 The words of a transmission shall be contiguous: the sync of every word after the first shall begin at the end of the parity bit of the word before. MIL 4.3.3.6
CD-EN-06 When the encoder is idle, it shall accept the first word of a transmission at once and begin its sync a fixed number of clock cycles later (txLatency of o1553_codec_pkg: 2 clock cycles). It shall accept every further word in the clock cycle in which the parity bit of the current word begins. MIL 4.3.3.8
CD-EN-07 When the current word is not the last one and no further word is valid in the clock cycle in which its parity bit begins, the transmission shall end after the current word with the outcome "ended after an underrun". none
CD-EN-08 Tx_Abort shall end a transmission in the next clock cycle: the transmit signals return to idle (CD-EN-10), an accepted word is discarded, and the outcome is "aborted". Tx_Abort while idle shall have no effect. MIL 4.6.3.2
CD-EN-09 All transitions of Bus_TxP and Bus_TxN shall happen on the same clock edge at multiples of H clock cycles from the start of the transmission, and Bus_TxP and Bus_TxN shall never both be '1'. MIL 4.5.2.1.1.2, 4.5.2.2.1.2
CD-EN-10 While no transmission is in progress on a bus, its Bus_TxP and Bus_TxN shall be '0' and its Bus_TxInh '1'. On the transmitting bus Bus_TxInh shall be '0' from the first half bit of the transmission to the end of the last half bit, and the other bus shall stay idle. MIL 4.2, 4.6.3.1

2.3 Decoder (CD-3)

ID Requirement Clauses
CD-DE-01 Bus_RxP and Bus_RxN of each bus shall be synchronised to Clk by olo_intf_sync with SyncTmr_g = true and SyncStages_g stages and combined into the line state. none
CD-DE-02 A change of the line state that lasts less than 50 ns shall be ignored; a change that lasts 50 ns plus two clock periods or longer shall be accepted. MIL 4.5.2.1.2.4, 4.5.2.2.2.4
CD-DE-03 The decoder shall decode words whose bit rate deviates from 1 Mb/s by up to +/- 1 % and whose zero crossings deviate from the ideal crossing by up to +/- 150 ns with respect to the previous zero crossing, for every waveform between a square wave and a sine wave that the transceiver turns into line states. MIL 4.3.3.3, 4.5.2.1.2.1, 4.5.2.2.2.1
CD-DE-04 The decoder shall recognise the command/status sync and the data sync of CD-EN-04, also when the last half of the sync merges with the first half of the next bit, or the first half of the sync with the last half of the bit before, into an apparent width of two bit times. The first half of a sync after an idle line shall be recognised from 0.75 us (interpretation in section 6). MIL 4.3.3.5.1.1, 4.3.3.5.2.1
CD-DE-05 The decoder shall decode the 16 data bits after a sync with the most significant bit first from the direction of their mid-bit zero crossings, and the parity bit. MIL 4.3.2, 4.3.3.2, 4.3.3.5.2.2
CD-DE-06 A word shall be valid when it begins with a valid sync, every bit is valid Manchester II code, the information field has exactly 16 bits plus parity (no bit follows the parity bit before the line returns to the zero state or the next sync begins) and the parity is odd. MIL 4.4.1.1
CD-DE-07 A word that fails the criteria of CD-DE-06 shall be reported once, with the first error found: sync error (the second half of a sync of wrong length or polarity), Manchester error (a missing mid-bit crossing or a crossing at an invalid time), bit count error (the line returned to the zero state before the parity bit, or a bit follows the parity bit) or parity error. MIL 4.4.1.1, 4.4.1.2
CD-DE-08 A valid word shall be reported exactly rxLatency clock cycles (+/- 1) after its reference crossing as received at the ports; rxLatency of o1553_codec_pkg is a function of the generics and corresponds to at most 2 us. MIL 4.3.3.8, 4.3.3.9
CD-DE-09 With every word the decoder shall report the time from the reference crossing of the previous valid word on the same bus to the mid-sync crossing of the word, in clock cycles with 16 bits (all ones when longer or when there is no previous valid word), and the contiguous flag, set when this time is 2.0 us +/- 0.4 us. MIL 4.4.1.2, 4.3.3.6, 4.3.3.7
CD-DE-10 A word shall be reported with the own-transmission flag set when its own mid-sync crossing lies within the time in which the codec drives that bus, from the start of the first sync to 1.0 us (loopDelayMax, the largest transceiver loop delay) after the outputs return to idle; any other word shall be reported with the flag cleared, also a word on a bus whose transmission runs with idle outputs (CD-BS-02). A word whose mid-sync crossing comes 4.0 us after the reference crossing of the last word of the transmission (the shortest gap of MIL 4.3.3.7 and response time of MIL 4.3.3.8) is therefore not an own word. MIL 4.3.3.7, 4.3.3.8
CD-DE-11 After an invalid word the decoder shall search for the next sync; a valid word that begins with a valid sync shall be decoded and reported. Further invalid words shall not be reported until the line has been idle or a valid word has been reported, so that the rest of a corrupted word, which can look like a sync, causes no second report. Line activity in which no sync half is recognised shall not be reported as a word (CD-DE-14 reports it as line activity without a word). MIL 4.4.1.1
CD-DE-12 Each decoder shall run independently of the other one and of the encoder, also while the codec transmits on the other bus. While the bus is disabled by Cfg_BusEn, its decoder shall report nothing and restart from idle. MIL 4.6.3, 4.6.3.2
CD-DE-13 Each decoder shall indicate the line activity of its bus (Rx_Active): '1' from SyncStages_g + F + 1 clock cycles (at most one cycle less) after the start of activity at the ports, '0' from SyncStages_g + ceil(0.8H) + 2 cycles (at most one cycle less) after the line returns to the zero state for at least 0.4 us. Pulses that the glitch filter ignores (CD-DE-02) are no activity; while the bus is disabled the indication is '0'. A protocol engine uses it to see whether a word follows the last word of a message before it answers. none
CD-DE-14 For each period of line activity (Rx_Active = '1') in which the decoder recognises no sync half, the decoder shall give the event Rx_NoWord(b) in the cycle in which Rx_Active falls, with Rx_NoWordLen the number of cycles in which Rx_Active was '1' (all ones when more). A period with a recognised sync half gives no such event, also when its word is invalid. The event is no word event: Rx_Valid, the word outputs and Rx_Active are those of CD-IF-04 and CD-DE-13 with or without it. It is used by the bus monitor (o1553_bm BM-RC-03). none

2.4 Fail-safe timer (CD-4)

ID Requirement Clauses
CD-FS-01 Per bus, a timer independent of the encoder shall measure the time for which the transmitter of the bus is enabled (Bus_TxInh = '0'), restarted only after an inhibit of at least 2 us: the transmissions of a terminal are at least 4 us apart, so transmissions with a shorter pause between them count as one. When the time exceeds 700 us, the fail-safe timer shall force Bus_TxInh to '1' and Bus_TxP and Bus_TxN to '0' at the output registers. MIL 4.4.1.3
CD-FS-02 A transmission of 33 contiguous words (660 us) shall not be cut by the fail-safe timer. MIL 4.4.1.3
CD-FS-03 The fail-safe state of a bus shall remain set until a valid command on that bus is signalled by Fs_Clr for that bus or until the reset; its start shall be reported as a level (Stat_FailSafe) that the core turns into an event. MIL 4.4.1.3

2.5 Transmission monitor (CD-5)

ID Requirement Clauses
CD-MO-01 While Cfg_MonEn is '1', every word sent on a bus whose outputs are not suppressed shall be compared with the words decoded on that bus with the own-transmission flag; a word decoded with another sync type or other data, an invalid own word, or no own word within 4 us after the end of the word sent shall be reported as a loopback error of that bus. none
CD-MO-02 While Cfg_MonEn is '0', no loopback error shall be reported. none

2.6 Bus selector (CD-6)

ID Requirement Clauses
CD-BS-01 The encoder shall be routed to the bus taken with the first word of the transmission; the other bus shall stay idle. MIL 4.2, 4.6.3.1
CD-BS-02 The transmitter of a bus shall be enabled when the host enables the bus (Cfg_BusEn), the bus is not shut down and its fail-safe state is not set. A transmission on a bus whose transmitter is disabled shall run with idle outputs on that bus and end with Tx_Suppressed = '1'; a transmitter disabled during a transmission shall go idle at once and stay idle until the transmission ends, also when it is enabled again in the meantime, so that no partial word follows. MIL 4.3.3.5.1.7.5, 4.3.3.5.1.7.6, 4.3.3.5.1.7.15, 4.3.3.5.1.7.16, 4.4.1.3
CD-BS-03 Sd_Set(b) shall shut the transmitter of bus b down and Sd_Clr(b) shall enable it again; the reset clears both shutdowns. MIL 4.3.3.5.1.7.5, 4.3.3.5.1.7.6
CD-BS-04 Bus_RxEn(b) shall follow Cfg_BusEn(b), so that a mission can run the core on one bus only. ECSS 5.3e, f

2.7 Configuration and fault tolerance

ID Requirement Clauses
CD-CF-01 ClkFreq_g shall be an integer multiple of 2 MHz from 16 MHz to 400 MHz; elaboration shall stop otherwise with a message that names the rule and the remedy (a PLL output such as 100 or 150 MHz for a clock of 125 or 156.25 MHz). MIL 4.3.3.3
CD-CF-02 After the reset, every bus shall be idle (CD-EN-10), no shutdown and no fail-safe state shall be set, and the decoders shall search for a sync. none

3. Partner behaviour

3.1 Transceiver

The transceiver (one per bus) is outside the core. The codec assumes the following contract; the board adapter of a target adapts a transceiver that differs (for example in polarity).

Property Contract at the core ports Handling in the codec
Transmit inputs Bus_TxP = '1' drives the positive line state, Bus_TxN = '1' the negative one; both '0' drives no signal CD-EN-01, CD-EN-09, CD-EN-10
Transmit inhibit Bus_TxInh = '1' turns the transmitter off regardless of Bus_TxP and Bus_TxN CD-EN-10, CD-FS-01
Receive outputs Bus_RxP = '1' while the line voltage is above the positive threshold, Bus_RxN = '1' while it is below the negative threshold; both '0' in between and on an idle line. Near a zero crossing both outputs can be '0' for a short time, or chatter CD-DE-01, CD-DE-02
Own transmission Many transceivers pass the own transmission to the receive outputs; some do not CD-DE-10 marks such words; CD-5 is enabled only for a transceiver that passes them
Delays The receiver delays the line by a few hundred nanoseconds, the transmitter by a few hundred nanoseconds; both delays add to the response time measured at the bus (architecture D6, interpretation I11) Not compensated in the codec
Amplitude, waveform, noise Thresholds, input impedance, common mode rejection, output amplitude, waveform, symmetry and noise are properties of the transceiver (MIL 4.5.2) Out of scope; the noise rejection of MIL 4.5.2.1.2.4 is shared by the transceiver and CD-DE-02

3.2 Other terminals on the bus

The far end of the bus is any terminal that meets MIL-STD-1553B: its bit rate is within +/- 0.1 % and its output zero crossings within +/- 25 ns of the ideal (MIL 4.3.3.3, 4.5.2.1.1.2); after the cable and the receiver the crossings at the core ports deviate by up to +/- 150 ns (MIL 4.5.2.1.2.1). CD-DE-03 accepts +/- 1 % in the bit rate to leave margin. A bus controller may send a new command at any time after the gap of MIL 4.3.3.7, on either bus, also while the terminal transmits on the other bus (MIL 4.6.3.2).

4. Error conditions

Condition Detection Response
Sync of wrong length or polarity CD-3 at the second half of the sync Word reported with sync error; search for the next sync
Missing or misplaced mid-bit crossing CD-3 at the bit Word reported with Manchester error; search for the next sync
Line zero before the parity bit, or a bit after it CD-3 when the line returns to zero, or at the extra bit Word reported with bit count error
Even parity CD-3 at the parity bit Word reported with parity error
Pulse shorter than 50 ns CD-3 glitch filter Ignored
Next word of a transmission not available in time CD-2 at the parity bit of the current word Transmission ends after the current word, outcome "ended after an underrun"
Transmitter enabled for more than 700 us CD-4 Transmitter forced off until a valid command on that bus
Own word missing or different CD-5 Loopback error event of the bus

5. Configuration parameters

Generic Default Range Description
ClkFreq_g none 16e6 to 400e6, integer multiple of 2e6 Frequency of Clk in Hz (real)
SyncStages_g 2 2 to 4 Synchroniser stages of Bus_RxP and Bus_RxN

6. Interpretation of the standard

Clause Interpretation
MIL 4.4.1.1c "16 bits plus parity" is checked in both directions: a word is invalid when the line returns to zero before the parity bit and when a further Manchester bit follows the parity bit
MIL 4.4.1.2 A data word is contiguous when its mid-sync crossing lies 2.0 us after the reference crossing of the word before, with a tolerance of +/- 0.4 us (two zero crossings of +/- 150 ns each plus the clock resolution); the protocol engine decides what a word that is not contiguous means. A word is only reported when its sync half is recognised (intervals of 1.25 us to 2.25 us), so the shortest reported gap is 1.25 us when the first sync half merges with the second half of the parity bit before it, and 1.75 us when it does not; an improperly timed sync outside the classes is a missing word for the protocol engine
MIL 4.3.3.5.1.1, 4.5.2.2.2.1 (first sync half) The first half of a sync after an idle line has no zero crossing before it, so the deviation of CD-DE-03, taken relative to the previous crossing, does not bound its length; in addition the receiver threshold delays the start of the activity by up to half the zero window (150 ns). At 1.01 Mb/s, with the mid-sync crossing 150 ns early and the start 150 ns late, the first half lasts 1.185 us at the ports; at 16 MHz the decoder measures it to within one clock period (62.5 ns), as 1.12 us, below the 1.25 us of the sync class. The decoder therefore recognises the first half of a sync after an idle line from 0.75 us; the second half and every later interval keep their classes. Manchester bits without a sync after an idle line have their first crossing at the middle of the first bit, 0.5 us after the start (at most 0.72 us with the bit rate, the deviation and the clock resolution at 16 MHz), so they are not taken for a sync half (CD-DE-11)
MIL 4.4.1.1a Line activity without a recognised sync half is no word and is not reported as one; the protocol engine detects the missing word by its time-out. The bus monitor records it from the separate event of CD-DE-14
MIL 4.4.1.3 The fail-safe time-out is 700 us: longer than the longest correct transmission of a terminal (33 words, 660 us) and shorter than 800 us
MIL 4.5.2.1.2.1, 4.5.2.2.2.1 The +/- 150 ns are a deviation of each zero crossing from its ideal time with respect to the previous zero crossing, so every interval between two successive crossings lies within its nominal value (0.5, 1.0, 1.5 or 2.0 us) +/- 150 ns, as the clauses write it (MIL-STD-1553B of 21 September 1978, pages 27 and 29; the transmitter clauses 4.5.2.1.1.2 and 4.5.2.2.1.2 on pages 25 and 29 define their 25 ns the same way). Successive intervals may deviate in opposite directions, for example +150 ns and -150 ns alternately. The tolerance applies to the line states at the core ports, after the transceiver
MIL 4.5.2.1.2.1, 4.5.2.2.2.1 (limit) Not covered: a reading in which every crossing may lie +/- 150 ns from an absolute grid of ideal times, so that one interval deviates by up to +/- 300 ns. The decoder classifies intervals with windows of +/- 0.25 us and does not decode such signals reliably