Page 1 of 1

Interrupt with TMR0

Posted: Tue Sep 30, 2008 3:03 pm
by calimero88
Bonjour, good morning

My program :

Scan analog Input : conversion and display to LCD with a period 1 seconde ( 1scan/ seconde) :
Mesure tension( Volt ) and courant(Amp) : calcul Power ( Watt) and Energy ( Watt/H ) and display Tension courant Power and energy to LCd 4*20

Difficulty to config and use function Interrupt with Tmr0 ( PIC 18F5550 with Xtal 8.000Mhz )

My program is not runing correct

thank.

Re: Interrupt with TMR0

Posted: Tue Sep 30, 2008 4:27 pm
by Benj
Hello

Your best bet is to firstly seperate the timer0 interrupt function to make sure it is triggering at the correct speed. You could for example increment a byte variable each interrupt and output the value to a I/O port. Using LEDs it would then be fairly easy to check the interrupt speed is correct for your settings. Remember in the interrupt properties to connect the timer's clock to CLKI and not T0CKI.