LPC802 SPI Justification

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC802 SPI Justification

跳至解决方案
384 次查看
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 项奖励
回复
1 解答
311 次查看
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 项奖励
回复
4 回复数
367 次查看
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 项奖励
回复
322 次查看
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 项奖励
回复
312 次查看
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 项奖励
回复
295 次查看
fingew
Contributor II
Thanks!
0 项奖励
回复