Apr 5, 2012 #1 V vishu489 Advanced Member level 4 Joined Aug 28, 2011 Messages 116 Helped 3 Reputation 6 Reaction score 3 Trophy points 1,298 Activity points 2,120 plz check my code .i don't know why its not working ,please help meView attachment New Text Document.txt
plz check my code .i don't know why its not working ,please help meView attachment New Text Document.txt
Apr 6, 2012 #2 Tahmid Advanced Member level 6 Joined Jun 17, 2008 Messages 4,756 Helped 1,798 Reputation 3,588 Reaction score 1,656 Trophy points 1,413 Location Berkeley, California Activity points 30,584 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.
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.