Hi mukadder,
yes I did sort it out, the code below works.
Regards.
Herbert Larbie
#include"targets\LPC22xx.h"
void Initialize(void);
// Macro Definitions
#define SPIF (1<<7)
#define SPI0_SEL 0x00000080
#define SPI0_MSTR 0x00000020
#define DATA 0xC1
// MAIN
int main()
{
Initialize();
// Do forever
while(1)
{
// Write data out
S0SPDR=DATA;
// Wait for transfer to be completed
while(!(S0SPSR & SPIF)){}
}
}
// System Initialization
void Initialize()
{
S0SPCR = 0x00;
PINSEL0 &= 0xFFFF00FF;
PINSEL0 |= 0x00005500;
IO0DIR = SPI0_SEL;
IO0SET = SPI0_SEL;
S0SPCCR = 0x08; // also used 0x20
S0SPCR = SPI0_MSTR;
}
At 15:46 08/05/2006, you wrote:
>Hi!
>I have the same problem!
>Have you solved this issue?
>If you solved, could you help me please?
>
>regards,
>
>mukadder
>
>--- Herbert Larbie <h.larbie@...> wrote:
>
> > Hi,
> >
> > I am a newbie experimenting with an Olimex LPC-H2214
> > and SPI, I am
> > using the code
> > for SPI shown in the Phillips application note
> > amended. I attach a
> > oscilloscope to the SCK and see nothing, not a
> > flicker. I am at least
> > expecting some activity on the MOSI and SCK.
> >
> > The code is as follows:
> >
> > /* Include header file depending upon part used */
> > #include"targets\LPC22xx.h"
> > void Initialize(void);
> > /* Macro Definitions */
> > #define SPIF (1<<7)
> > #define DATA 0xC1
> > /************************* MAIN
> > *************************/
> > int main()
> > {
> > Initialize();
> > /* Do forever */
> > while(1)
> > {
> > /* Write data out */
> > S0SPDR=DATA;
> > /* Wait for transfer to be completed */
> > while(!(S0SPSR & SPIF)){}
> > }
> > }
> > /*************** System Initialization
> > ***************/
> > void Initialize()
> > {
> > /* Configure Pin Connect Block */
> > PINSEL0 |= 0x5500;
> > /* Set pclk to same as cclk */
> > VPBDIV=0x1;
> > /* Set to highest speed for SPI at 10 MHz- > 1.25
> > MHz */
> > S0SPCCR=0x8;
> > /* Device selected as master */
> > S0SPCR=0x20;
> > }
> >
>/*********************************************************/
> >
> >
> > Any help would be greatly appreciated.
> >
> > Herbert Larbie
> >
> >
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
><http://mail.yahoo.com>http://mail.yahoo.com
>
>
>SPONSORED LINKS
><http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=c-HXthtbZy4TZbI3ib0PMg>Microcontrollers
><http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=ijt0SspWtjogcHCuFD0lUQ>Microprocessor
><http://groups.yahoo.com/gads?t=ms&k=Intel+microprocessors&w1=Microcontrollers&w2=Microprocessor&w3=Intel+microprocessors&c=3&s=69&.sig=WOZdpklkgHbXR5quAgrl5w>Intel
>microprocessors
>
>
>----------
>YAHOO! GROUPS LINKS
>
> * Visit your group
> "<http://groups.yahoo.com/group/lpc2000>lpc2000" on the web.
> *
> * To unsubscribe from this group, send an email to:
> *
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com
>
> *
> * Your use of Yahoo! Groups is subject to the
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------Message
Re: [lpc2000] LPC-H2214 and SPI woes
2006-05-09 by Herbert Larbie
Attachments
- No local attachments were found for this message.