lpc1788 SPI

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

lpc1788 SPI

1,539 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sekil on Sat Sep 22 13:41:08 MST 2012
Hi.
Please help me:
I'm try read info from eeprom mxic, connected to SSP0 at pins p0.15-18.
CS from eeprom i connect to ground.
I get SSP driver from CMSIS, and try send CMD's to eeprom, but not good - i get two 0x00ff :(

                SSP_SendData(LPC_SSP0,0x90);
SSP_SendData(LPC_SSP0,0x0);
SSP_SendData(LPC_SSP0,0x0);
SSP_SendData(LPC_SSP0,0x0);
_DBH16_(SSP_ReceiveData(LPC_SSP0));
                _DBH16_(SSP_ReceiveData(LPC_SSP0));

标签 (1)
0 项奖励
回复
3 回复数

1,431 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Thu Sep 27 06:19:30 MST 2012
To clarify things:

- you need to drive CS to the EEPROM because the EEPROM relies on CS for start of a new command.

- you can NOT use the CS drive logic of the SPI! The CS drive logic of the SPI will de-assert CS if the SPI data stream is not back-to-back. Crappy hardware, IMO!. If there is an interrupt in the middle of the SPI transfer, CS will go high in the middle of the transfer, and communication is distorted.

So I ended in using the GPIO function for SPI. Only chance you have...
0 项奖励
回复

1,431 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Daniel Widyanto on Thu Sep 27 01:03:52 MST 2012
Actually, if you only have single device on SSP pin, the CS pin can be driven LOW all the time.

But, for the op's answer, one must enable the pins as SSP before it can be used as SSP input / output. I think one of the modules in the LPC177x / LPC178x peripheral driver library should have this.

Regards,
-daniel
0 项奖励
回复

1,431 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Mon Sep 24 10:34:41 MST 2012
You need to drive CS from your program.
0 项奖励
回复