P1012: HDLC: How to configure the byte order of HDLC on the TX line?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

P1012: HDLC: How to configure the byte order of HDLC on the TX line?

705 Views
carlpeng
Contributor II

Hello,

When debug HDLC, I find that its data on the TX is big-endia order, for example, if I want to send 4 bytes: data[4] = {0x01, 0x02, 0x03, 0x04}, I find that the data send onto TX line is: {0x04, 0x03, 0x02, 0x01}, it seems that HDLC send data in the unit of 32-bit word, and moreover, it is big-endia.

Now, if I want to send it in a little-endia, how should I do?

Could you please help to give some suggestions?

Thank you,

Carl

Labels (1)
0 Kudos
1 Reply

407 Views
r8070z
NXP Employee
NXP Employee

Have a great day,

If consider data in the Tx buffer as sequence of 32-bit word where the first byte at offset 0 is the most significant byte (MSB) of the word at offset 0 and so on (big-endian)
then as data is sent onto the serial line from the data buffer, the MSB of the buffer word contains data to be sent earlier than the LSB of the same buffer word.
It is described in the QUICC Engine Block Reference Manual with Protocol Interworking, Rev. 8. Please see byte order (BO) description in section 7.4.6 Bus Mode Registers (RBMR and TBMR). Unfortunately it is fixed to the big-endian. And section 3.1.1 Data Paths right for the P1012 says “The SDMA channel must be configured for big-endian byte ordering for accessing buffer data.” So we have to set the UCC TBMR[BO]=0b10. The only way to change byte order on the serial line is prepare required byte sequence in the TX buffer.

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos