EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

SPI interface usage

Started by Umesh V. HUILGOL February 4, 2005
Hello ,

I am new to lpc2000 user group.Was happy to know
about such a platform. I had some problem regarding
the SPI interface.

While implementing a simple SPI transfer to a
memory thro KEIL debugger, I found a problem in the
simulation:

After I write the clock control to the clock control
register, control parameters to the control
register, and data to data register(target device
LPC2106),I find the parameters are correctly getting
loaded in the SPCCR and SPCR register during
debugging but data is getting loaded in the data
register(in the peripherals GUI).

Here is the piece of code:-

char temp=0x10;

PINSEL0|=0x00005500;

SPCCR=0x08;
SPCR=0x20;
SPDR=temp; // this value not getting loaded
correctly.

Could anybody help me out with this.

Umesh



R: [lpc2000] SPI interface usage

An Engineer's Guide to the LPC2100 Series

When you are using the spi in master mode you also need to map SSEL to pin
P0.7 and drive it high.

-----Messaggio originale-----
Da: Umesh V. HUILGOL [mailto:]
Inviato: venerdi 4 febbraio 2005 11.00
A:
Oggetto: [lpc2000] SPI interface usage
Hello ,

I am new to lpc2000 user group.Was happy to know
about such a platform. I had some problem regarding
the SPI interface.

While implementing a simple SPI transfer to a
memory thro KEIL debugger, I found a problem in the
simulation:

After I write the clock control to the clock control
register, control parameters to the control
register, and data to data register(target device
LPC2106),I find the parameters are correctly getting
loaded in the SPCCR and SPCR register during
debugging but data is getting loaded in the data
register(in the peripherals GUI).

Here is the piece of code:-

char temp=0x10;

PINSEL0|=0x00005500;

SPCCR=0x08;
SPCR=0x20;
SPDR=temp; // this value not getting loaded
correctly.

Could anybody help me out with this.

Umesh

Yahoo! Groups Links





Thanks Gianluca.
The PIN0.7 has been connected to logic high permanently.i have also
mapped the
PINSEL0 for SPI mode.I am not able to see the SCK pin toggling during
simulation.Nor do i see the data in the data register. --- In , "Gianluca Marcante" <GMARCANTE@T...>
wrote:
> When you are using the spi in master mode you also need to map SSEL
to pin
> P0.7 and drive it high.
>
> -----Messaggio originale-----
> Da: Umesh V. HUILGOL [mailto:umesh.huilgol@s...]
> Inviato: venerdi 4 febbraio 2005 11.00
> A:
> Oggetto: [lpc2000] SPI interface usage >
> Hello ,
>
> I am new to lpc2000 user group.Was happy to know
> about such a platform. I had some problem regarding
> the SPI interface.
>
> While implementing a simple SPI transfer to a
> memory thro KEIL debugger, I found a problem in the
> simulation:
>
> After I write the clock control to the clock control
> register, control parameters to the control
> register, and data to data register(target device
> LPC2106),I find the parameters are correctly getting
> loaded in the SPCCR and SPCR register during
> debugging but data is getting loaded in the data
> register(in the peripherals GUI).
>
> Here is the piece of code:-
>
> char temp=0x10;
>
> PINSEL0|=0x00005500;
>
> SPCCR=0x08;
> SPCR=0x20;
> SPDR=temp; // this value not getting loaded
> correctly.
>
> Could anybody help me out with this.
>
> Umesh >
>
> Yahoo! Groups Links




The 2024 Embedded Online Conference