AN370
Rev. 1.0
49
7.4.3. 4 Bit to 5 Bit Encoding
The following table is used for 4 bit to 5 bit encoding. When the last bit of the previously encoded 5 bit value was a
1 the output for the next 5 bit value is an inversion of the output listed below. Keep in mind that the least significant
bit of the output is put onto the PA first.
When using this encoding the user is responsible for calling the vOds_Setup() function with the input structure
tOds_Setup.bGroupWidth=4 value to transmit all 5 bits in the converted output byte.
The vEnc_4b5bEncode() function uses a global BYTE variable to remember the last bit of the previously encoded
5-bit symbol. It updates the value each time it is called.
For the first symbol in a sequence the function vEnc_Set4b5bLastBit() must be called to set this variable for use by
initial encoding.
Table 8. 4 Bit to 5 Bit Encoding
Input
Output
0x0
0x15
0x1
0x17
0x2
0x0B
0x3
0x16
0x4
0x0D
0x5
0x1A
0x6
0x1D
0x7
0x12
0x8
0x05
0x9
0x19
0xA
0x0A
0xB
0x1B
0xC
0x09
0xD
0x13
0xE
0x11
0xF
0x0F