When i am writing any simple code just to set & clear any particular pin in keil for lpc2138 it works fine but as soon as i assigned any variable as global variable then proteus doesn't work only.....
I tried both options:
1. Directly specified hex file path in Proteus VSM.
2. From keil VSM debugging --Remote degugging
I dont know what exactly the problem is ...
Please help me for this
I am attaching details of my error
1. Directly assigned hex file.
Please see code
Code:
#include <LPC21xx.H> /* LPC21xx definitions */
void wait (void);
int main (void)
{
unsigned int k;
IODIR1 = 0xFF0000; /* P1.16..23 defined as outputs */
while (1)
{ /* Loop forever */
IOPIN1 = ~(IOPIN1 & 0XFFFF0000); ;
for (k=0;k<=65530;k++); /* Turn off LED */
}
}
Please see the diagram NO- 1.direct_hex_file in attached files
2. In this code, i am just making variable "K" as global variable
Code:
#include <LPC21xx.H> /* LPC21xx definitions */
void wait (void);
unsigned int k;
int main (void)
{
IODIR1 = 0xFF0000; /* P1.16..23 defined as outputs */
while (1)
{ /* Loop forever */
IOPIN1 = ~(IOPIN1 & 0XFFFF0000); ;
for (k=0;k<=65530;k++); /* Turn off LED */
}
}
see the attachement 2.remote-degug_global_variable
please ..........let me know where i am going wrong or what is the problem in setting