Bob Setbacken wrote: >Hi, i have read similar posts but not seen an answer to this. I am trying to learn how to use interrupts on this device. I initialize everything in the main prog, then simply loop. The interrupt routine is driven by TMR0 overflow, and TMR0 is driven by the internal clock w/prescaler. There is a nested countup in the interrupt service, that should toggle all the pins of port B every time the count register overflows. > >I am using Warp13 w/MPLAB. When I simulate this and put breakpoints in the ISR, everything looks great. I am using the state saving methods suggested on this site. I clear the TMR0 flag in the interrupt, and return with a RETFIE. > >When I run the program in hardware, it flashes all teh LED's once, and then never again. If I DONT clear the TMR0 flag, and run the program, it looks like it is working, but I think it is just always returning to the ISR due to the flag being set and the interrupts enabled. I don't think TMR0 is driving the program anymore. > > Are you clearing the timer interrupt flag (T01F) or the timer interrupt enable (T01E) ? You need to clear the interrupt flag not the enable. David... -- ___________________________________________ David Duffy Audio Visual Devices P/L U8, 9-11 Trade St, Cleveland 4163 Australia Ph: +61 7 38210362 Fax: +61 7 38210281 New Web: www.audiovisualdevices.com.au ___________________________________________ -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics