EmbeddedRelated.com
Forums

Simulation in Proteus

Started by anish kumar September 5, 2010
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++);
}

An Engineer's Guide to the LPC2100 Series

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

Hi

Have you tried IOCLR0 = 0xffffffff; ???

Regards

Mark
> while(1)
> {
> IOSET0 = 0xFFFFFFFF;
> delay();
> IOCLR0 = 0x00000000;
> delay();
> }