SPI Microwire mode

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

SPI Microwire mode

1,912 次查看
henrikebbekaer
Contributor I

Hi

I'm working with the LPCXpresso  LPC1115 and having problems with the SPI interface. The question is quite simple.

How is the Microwire interface used? From the manual UM10398 it should be possible to make a bit sequence looking like this:

155190_155190.pngpastedImage_0.png

I would like to transmit 24 bit. CR0 is the register where I have to select that I'm using Microwire. But I also have to select the data size, which can be up to 16 bits. Make sense. But in this Microwire interface a 8-bit control byte is defined. How do I write the control byte?

I can make the code so the CS is controlled manually and just use regular SPI mode, no problem. But it would be nice if the Microwire functionality worked.

标记 (1)
0 项奖励
回复
1 回复

1,658 次查看
rolfmeeser
NXP Employee
NXP Employee

Not sure how you count the 24 bits you want to transmit, but if this is the sum of the 8-bit control word and a 16-bit data filed, then the answer is yes, it will work.

The data size field (DSS) in CR0 determines the width of the data field only. The control word is always 8 bits wide.

If you set DSS to 16 bits, then writing any value to the transmit FIFO will trigger a complete microwire frame transfer: The LSB of the data written to the TX FIFO is sent as the control word, followed by a dummy clock cycle, followed by 16 clock cycles used to read the data field.

While SSEL is pulsed low by hardware for the duration of the sequence described above, you are free to drive your own GPIO version of a slave select if you like.

0 项奖励
回复