v.s.n.kumar
Member level 1
- Joined
- Dec 2, 2013
- Messages
- 38
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 303
Hi,
I have been facing the problem with the lpc2148 development board from the day i bought it. There is BOOT button & RESET button. when i start to dump the program in to it, the flash magic showed ''Failed to read the device signature". so by pressing the boot button continously & i start dumping the code, then only flash magic shows me ''Finished". I have dumped serial communication program. the code is what ever the letters that we press from key board that must appear on the hyper terminal of the pc. this is working perfectly. below code is the serial communication code. The main problem is if i dump another code like led blinking, then also the below serial communication code is working if i open the hyper terminal & type the letters then they appear on the hyper terminal of the pc. i.e., the actual code is not working(what ever the code i dumped, the below serial communication code is working instead of the dumped codes). please solve my problem. i have exam on the arm. please solve. i post the serial communication code, led blinking code & images of the board. can anybody please solve my problem.
I have been facing the problem with the lpc2148 development board from the day i bought it. There is BOOT button & RESET button. when i start to dump the program in to it, the flash magic showed ''Failed to read the device signature". so by pressing the boot button continously & i start dumping the code, then only flash magic shows me ''Finished". I have dumped serial communication program. the code is what ever the letters that we press from key board that must appear on the hyper terminal of the pc. this is working perfectly. below code is the serial communication code. The main problem is if i dump another code like led blinking, then also the below serial communication code is working if i open the hyper terminal & type the letters then they appear on the hyper terminal of the pc. i.e., the actual code is not working(what ever the code i dumped, the below serial communication code is working instead of the dumped codes). please solve my problem. i have exam on the arm. please solve. i post the serial communication code, led blinking code & images of the board. can anybody please solve my problem.
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 /*serial communication programm*/ /*WHAT EVER THE CHARACTER TYPED FROM THE KEYBOARD OF PC THAT GOES IN TO LPC2129 AND FROM LPC2129,IT DISPLAY ON THE HYPERTERMINAL*/ #include<LPC21xx.h> void main(void) { unsigned char ch; PINSEL0=0X00000005;/*TO MAKE THE PORT PINS0.0&0.1 AS TxD&RxD*/ U0LCR=0X83;/*TO SELECT THE WORD LENGTH AS 8BIT & MAKE THE LATCH ACCESS BIT HIGH TO CHANGE THE BAUD RATE*/ U0DLM=0;/*SET DIVISOR LATCH MSB REGISTER AS 0*/ U0DLL=20;/*SET THE DIVISOR LATCH LSB REGISTER AS 20 TO GET 9600 BAUD RATE & CCLK@12MHZ*/ U0LCR=0X03;/*TO MAKE THE LATECH ACCESS BIT LOW*/ while(1) { while(!(U0LSR&0X01));/*WAIT UNTILE DATA IS RECIEVED*/ ch=U0RBR;/*PLACE THE RECIEVED DATA FROM RECIEVE BUFFER REGISTER IN A VARIABLE*/ U0THR=ch;/*PLACE THE RECIEVED DATA IN TO THE TRANSMIT BUFFER REGISTER*/ while(!(U0LSR&0X20));/*WAIT UNTIL DATA IS TRANSMITTED*/ } } /*LED PROGRAMM*/ /*ALTERNATE BLINKING OF AN LED*/ #include<LPC21xx.h> #define LED 1<<1 void delay(void); void main(void) { IODIR0=LED; /*MAKE PIN 0.1 AS OUTPUT*/ while(1) { IOSET0=LED; /* SET THE PIN 0.1*/ delay(); /*CALLING THE DELAY FUNCTION*/ IOCLR0=LED; /*CLEAR THE PIN 0.1*/ delay(); /*CALLING THE DELAY FUNCTION*/ } } void delay(void) { unsigned int i; unsigned char j=255; for( ;j>0;j--) for(i=500;i>0;i--); }
Last edited by a moderator: