EmbeddedRelated.com
Forums

lpc2378

Started by berde July 3, 2008
Hi, 

Maybe it sounds stupid, but I’m new to NXP. I have always been using
atmel. I’m working now with the OLIMEX LPC2379STK from IAR systems. I’m
using IAR embedded work bench and I try the sample codes and the work. But
what I don’t understand is that when I’m writing my code identical to
the sample code it just won’t work. 

For example:

void InitClock(void)
{
  // 1. Init OSC
  SCS_bit.OSCRANGE = 0;
  SCS_bit.OSCEN = 1;
  // 2.  Wait for OSC ready
  while(!SCS_bit.OSCSTAT);  <-- it just keep hang here!
  // 3. Disconnect PLL
  PLLCON_bit.PLLC = 0;
  PLLFEED = 0xAA;
  PLLFEED = 0x55;

Does anybody have some advice, or where could I get more sample code. Or
is there any other software that I could write and download the code.  I
find the IAR embedded work bench indistinct.

Many thanks,



"berde" <joramboekhoudt@hotmail.com> schreef in bericht 
news:C-ydnVWAYbSLsvDVnZ2dnUVZ_sDinZ2d@giganews.com...
> Hi, > > Maybe it sounds stupid, but I&#4294967295;?Tm new to NXP. I have always been using > atmel. I&#4294967295;?Tm working now with the OLIMEX LPC2379STK from IAR systems. > I&#4294967295;?Tm > using IAR embedded work bench and I try the sample codes and the work. But > what I don&#4294967295;?Tt understand is that when I&#4294967295;?Tm writing my code identical to > the sample code it just won&#4294967295;?Tt work. > > For example: > > void InitClock(void) > { > // 1. Init OSC > SCS_bit.OSCRANGE = 0; > SCS_bit.OSCEN = 1; > // 2. Wait for OSC ready > while(!SCS_bit.OSCSTAT); <-- it just keep hang here! > // 3. Disconnect PLL > PLLCON_bit.PLLC = 0; > PLLFEED = 0xAA; > PLLFEED = 0x55; > > Does anybody have some advice, or where could I get more sample code. Or > is there any other software that I could write and download the code. I > find the IAR embedded work bench indistinct. > > Many thanks,
I had the same problem with checking status bits while programming the PLL. The solution was to replace the status check with a delay of 500 usec (as stated in the manual) and just continue without checking the PLL status. I never managed to solve it otherwise. Frank