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,
lpc2378
Started by ●July 3, 2008
Reply by ●July 4, 20082008-07-04
"berde" <joramboekhoudt@hotmail.com> schreef in bericht news:C-ydnVWAYbSLsvDVnZ2dnUVZ_sDinZ2d@giganews.com...> Hi, > > Maybe it sounds stupid, but I�?Tm new to NXP. I have always been using > atmel. I�?Tm working now with the OLIMEX LPC2379STK from IAR systems. > I�?Tm > using IAR embedded work bench and I try the sample codes and the work. But > what I don�?Tt understand is that when I�?Tm writing my code identical to > the sample code it just won�?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