Hello everyone i have written a simple led code for LPC2124 in keil. It is not
simulating in Proteus. Please help as i have practical exams on it.
Below is source code :-
#include
void delay(void);
int main()
{
IODIR0 = 0xFFFFFFFF;
IOCLR0 = 0x00000000;
while(1)
{
IOSET0 = 0xFFFFFFFF;
delay();
IOCLR0 = 0x00000000;
delay();
}
}
void delay(void)
{
unsigned int i;
for(i=0;i<20000;i++);
}
Simulation in Proteus
Started by ●September 5, 2010
Reply by ●September 5, 20102010-09-05
On Sun, 2010-09-05 at 10:11 +0530, anish kumar wrote:
> Hello everyone i have written a simple led code for LPC2124 in keil.
> It is not simulating in Proteus. Please help as i have practical exams
> on it.
I should know better then to respond to your email about your
school/study problem :-)
So what is your problem then ?
If you want people to help you should/must explain what the
problem is and what you have done to try to resolve it.
Did you read page 115 of UM10114 ?
Especially the parts about IOSET and IOCLR ?
Do you have optimizations enabled like -O1 or higher ?
Hint => "volatile unsigned int"
When in a simulator and stepping through the code it may
not be a big deal but on a real target the 20000 count delay
might be a bit short when running with the PLL at maximum.
roelof
> Hello everyone i have written a simple led code for LPC2124 in keil.
> It is not simulating in Proteus. Please help as i have practical exams
> on it.
I should know better then to respond to your email about your
school/study problem :-)
So what is your problem then ?
If you want people to help you should/must explain what the
problem is and what you have done to try to resolve it.
Did you read page 115 of UM10114 ?
Especially the parts about IOSET and IOCLR ?
Do you have optimizations enabled like -O1 or higher ?
Hint => "volatile unsigned int"
When in a simulator and stepping through the code it may
not be a big deal but on a real target the 20000 count delay
might be a bit short when running with the PLL at maximum.
roelof
Reply by ●September 5, 20102010-09-05