when i compile the code am getiing this error
"p1.exe stopped working"
am using MPLAB and Hi-Tech compiler ..
what is its reason.. i attached image.
i was running the following code
"p1.exe stopped working"
am using MPLAB and Hi-Tech compiler ..
what is its reason.. i attached image.
i was running the following code
Code:
#include<htc.h>
__CONFIG(1,OSCSDIS & HSPLL);
__CONFIG(2,BORDIS & PWRTDIS &WDTDIS);
__CONFIG(3,CCP2RC1);
__CONFIG(4,LVPDIS & STVREN);
__CONFIG(5,UNPROTECT);
__CONFIG(6,WRTEN);
__CONFIG(7,TRU);
#define _XTAL_FREQ 20000000
void led_display(char a)
{
switch(char a)
{
case 0: PORTB=0x01; break;
case 1: PORTB=0x02; break;
case 2: PORTB=0x04; break;
case 3: PORTB=0x08; break;
}
void main()
{
PORTB=0x00;
char a;
while(1)
{
led_display(a);
__delay_ms(1000);
//for(a=0;a<5;a++);
a=(++a)%10;
}
}