[SOLVED] pic18f4520 timer0 interrupt problem

Status
Not open for further replies.
In the ISR, change this:
Code:
LATDbits.LATD0=!LATDbits.LATD0;
to this:
Code:
LATDbits.LATD0=!PORTDbits.RD0;
LATD is only for outputting values to the ports (writing to ports). PORTD is only for inputting from ports (reading from ports).

With a 20MHz clock, the interrupt occurs every ~3.55 seconds.

Hope this helps.
Tahmid.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…