lpcware

LPC2387 interfacing with SC16IS762

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Apr 6, 2017 by Diego Adrian Cuevas
Content originally posted in LPCWare by sumit.kajave on Mon Sep 14 07:31:22 MST 2015
I am interfacing LPC2387 with SC16IS762(which is SPI to UART converter).
1) My problem is when I read 2 or more register it gives same value as 1st one. I think LPC or converter IC buffer is not clear.
2) when I read first time I get alwas 0xff in my buffer
SSP configure as 8 bit data, CPOL=0,CPHA=0,clock=0x20,SCR=0x07 (I use SSP1)
below is my code
SSP read

while(!(SSP1SR & SSPSR_TNF));
   SSP1DR=(unsigned char)adr;

while ( SSP1SR & SSPSR_BSY );
SSP1DR=0xFF;
while ( !(SSP1SR & SSPSR_RNE) );
ssp_return_data=(unsigned char)SSP1DR;

SSP write

while(!(SSP1SR & SSPSR_TNF));
     SSP1DR=*buf;
    while ( SSP1SR & SSPSR_BSY );
   while ( (SSP1SR & (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );

Please help me I am struct here for more than 2 days




Outcomes