Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

problem on LPC2138 + SPI

2006-02-20 by sebfr74

Hi,
I try to read a 24 bits A/D converter from burr brown (ADS1252) with 
SPI interface. The converter send value in continue. There is data 
ready signal before the value on the data pin. I synchronize the read 
with an external interrupt (P0.15/EINT2 and MISO pin are connected 
together). The external interrupt runs well. But i don't understand 
how the SPI controler work :
I initialize the controler, the VIC interrupt for the SPI0 (see the 
code below).
- My first problem is I don't find in the user manual what start the 
SPI clock for a read. In other controler (ATMEL 89C51 for example, a 
0x00 write to the data register start the clock). 
- The second one is I have 8 clock bit on the SCLK line just at the 
startup an d before my first external interrupt (the one noramlly who 
start the SPI read...). I don't understand why I have got these 8 
clock bits ? After these clock the SPI seems to be blocked...

Thanks for your help,
Sebastien

//My initialisation code...
VICVectCntl0 = 0x0000002A; 
VICVectAddr0 = (unsigned)SPI_ISR;
VICIntEnable = 0x00000400;	

PINSEL0 |= 0x00005500;		
S0SPCCR	= 20;		
S0SPCR  = 0x000000A0;

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.