LPC802 SPI Justification

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

LPC802 SPI Justification

Jump to solution
299 Views
fingew
Contributor II

What is the justification for data in the TXDAT and RXDAT registers for the SPI peripheral for the LPC802?  Does it matter if the output is selected as LSB or MSB first?

The User's Manual is silent on the subject.

0 Kudos
Reply
1 Solution
226 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi

Q:Let me give an example. Say you have the transfer configured for 12-bit length, and you receive data, say all ones.

Would the data register be 0xFFF0 (left justification) or 0x0FFF (right justification)?

>>>>>The LPC802 SPI always use right justification, for example, if you want to receive 12 bits data with all bits 1, you will receive  0x0FFF in the receiver reg.

Hope it can help you

BR

XiangJun Rong

View solution in original post

0 Kudos
Reply
4 Replies
282 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

You can select the MSB first or LSB first, but the master spi and slave spi devices must match.

Pls refer to section 14.6.1 SPI Configuration register in the UM11045.pdf

The LSBF bit in the CFG reg defines the MSB/LSB first.

Hope it can help you

BR

XiangJun Rong

 

xiangjun_rong_0-1721180504274.png

 

0 Kudos
Reply
237 Views
fingew
Contributor II

Thank you, but that doesn't answer my question.

Let me give an example.  Say you have the transfer configured for 12-bit length, and you receive data, say all ones.

Would the data register be 0xFFF0 (left justification) or 0x0FFF (right justification)?

 

0 Kudos
Reply
227 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi

Q:Let me give an example. Say you have the transfer configured for 12-bit length, and you receive data, say all ones.

Would the data register be 0xFFF0 (left justification) or 0x0FFF (right justification)?

>>>>>The LPC802 SPI always use right justification, for example, if you want to receive 12 bits data with all bits 1, you will receive  0x0FFF in the receiver reg.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply
210 Views
fingew
Contributor II
Thanks!
0 Kudos
Reply