rishi.iitk
Newbie level 3
hello friends i wrote the program in KEIL it compiles succesfulyy bt it doesnt works..I connected my led at port 0.22
program is here
gyus i dont know whats the mistake here...so plz help me...it frustrates me too much...TIA
program is here
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 // initialize system clock #include "LPC214x.h" void init() { PLL0CFG=0x24; // MSEL = 4,PSEL = 2 PLL0FEED=0xAA; // Feed process PLL0FEED=0x55; PLL0CON=0x1; PLL0FEED=0xAA; // Feed process PLL0FEED=0x55; while(!(PLL0STAT & 0x400)) ; // Wait until PLL Locked PLL0CON=0x3; // Connect the PLL as the clock source PLL0FEED=0xAA; // Feed process PLL0FEED=0x55; MAMCR=0x2; // Enabling MAM and setting number of clocks used for Flash memory fetch (4 cclks in this case) MAMTIM=0x4; VPBDIV=0x02; // PCLK at 30 MHz } #include "LPC214x.h" //header file for LPC2148 init(); int main(void){ // starting main loop int j; //variable declaration IODIR0= 0x00400000; //setting port 0.22 as output while(1){ //endless while loop for (j=0;j<1000000;j++) { //delay loop } IOSET0= 0x00400000; //TURN ON LED AT PO.22 for (j=0;j<1000000;j++) { //delay loop } IOCLR0= 0x00400000; //Turn off led at P0.22 } }
gyus i dont know whats the mistake here...so plz help me...it frustrates me too much...TIA
Last edited by a moderator: