Yahoo Groups archive

Lpc2000

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

Message

External Interrupt

2004-06-07 by Rodrigo Cesar da Silva Martins

Thanks for the help...My problem was that i didn't wait for SPIF 
while i'm receiving...so stupid!!! But now I'm stuck in the RDY 
signal. I'm supposed to use it as an ExtInt...I did the following 
setup sequence:

EXTMODE = SETBIT1;//Interrupção na borda de descida
PINSEL0 |= 0x000000C0;//P0.3 ajustado para EINT1
VICVectAddr0 =(unsigned long)ADISR; //redireciona vetor para função
VICVectCntl0 = 0x20 | 15; //Seta vetor de interrupção para INT1
VICIntEnable = SETBIT15; //Habilita interrupção INT1

And put the function prototipe:

void ADISR (void) __attribute__ ((interrupt));

I have the rdy signal periodically but the ISR is not called...Did I 
forget 
something?

--- In lpc2000@yahoogroups.com, Shannon Holland <holland@l...> wrote:
> 
> On Jun 7, 2004, at 5:57 AM, Rodrigo wrote:
> 
> > I'm trying to communicate with a AD converter through a SPI 
interface. 
> > In the AD datasheet, it's said that I need to have DIN line 
(from AD) 
> > in low level when it's transmitting. This means that I have
to 
write 
> > 0x00 on MOSI line while i'm receiving the data. The problem
is, 
> > there's just one data register, can I do that? If I
can't, can I 
> > change just the MOSI pin to GPIO mode and put on low level while 
I'm 
> > receiving data?
> 
> With SPI the transmit and receive register are the same - bits are 
> shifted out on transmit as they are shifted in on receive.
> 
> So, to keep MOSI low while receiving (and to generate the clock 
needed 
> to drive the whole process), simply write a 0 to the SPDR 
register. 
> Wait for the transfer to complete (checking the SPSR register) and 
then 
> read SPDR to get the received byte.
> 
> Shannon

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.