lpcware

SSP0 Receive problems

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Mauricio on Fri Jul 08 16:42:40 MST 2011
Hi,

I am trying to communicate with a flash memory, when I send data to the memory with SSP0 port the memory acknoledges it, but when I try to read the memory with a dummy byte the microcotroller cannot read it (I know that the memory is putting some data in the line after scoping it), but my LPC1768 doesn't update the DR register to what the memory sent.  The registers shown by the controller right before trying to read the byte are:

CR0 = 0x00001D07
CR1 = 0x00000002
DR = 0x000000FF
SR = 0x00000003
CPSR = 0x00000002
IMSC = 0x00000000
RIS = 0x00000008
MIS = 0x00000000
ICR = 0x00000000
DMACR = 0x00000000

I know that DR should be 0x00 before reading the port, but after reading the register with a dummy variable to clear the DR register with:

tmp = (uint32_t) SSP_ReceiveData(SSPx);

the DR doesn't clear, the (0xFF) is still there and the Status register doesn't reset as well. 

Am I missing any important step here (like clearing a flag) before reading the SSP0->DR?

Thanks

Outcomes