Yahoo Groups archive

Lpc2000

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

Message

LPC-H2214 and SPI woes

2006-05-05 by Herbert Larbie

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

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.