Re: delay prob
Hi ajeesh,
Did you find the solution? Use the code below:
void main()
{
PORTC = 0;
TRISC = 0;
PORTB = 0;
TRISB = 0;
DD:
PORTB = 0X01; //but immediately changes to old value here, so you won't feel it.
PORTC = ~PORTC;
Delay_ms(1000);
PORTB = 0X02; //PORTB changes value here, (read previous comment)
goto DD ;
}
Modify the code to:
void main()
{
PORTC = 0;
TRISC = 0;
PORTB = 0;
TRISB = 0;
DD:
PORTB = 0X01;
PORTC = ~PORTC;
Delay_ms(1000);
PORTB = 0X02;
Delay_ms(1000); //Delay, so that you can view the change in
//PORTB
goto DD ;
}