Hi all
Lets's say that I need an IT every 100us....
I've decided to use Timer 2 and from what I understand , If you use a Timer with a clock frequency of 1Mhz, you only need to count up to 100 provided you've loaded the 8 bit counter ( no pre and post scalers ) to 256-100
Due to the extra clock cycle, you need to count 99...
Consequently I have configured ( with MCC ) with the following
Fosc (1Mhz, pre and Post scallers 1:1, PR2 = 99, T2TMR= 156 , Global an Peripheral Interrupts validated, Interrupt validated...
In order to see the effect of the Interrupt, each time an IT arrives, I generate a small 5us pulse, pulsing High an Low a Pin of the Pic16F...
This works nicely...but instead of having an IT each 100us, it is an IT each ~200us and I clearly don't see why...and where I make a mistake
I've tried the callback capability...with a Callback freq of 1...i.e a callback evevry 100us
Moved my ISR the the right place..
Works nicely too...but, same stuff, an IT every 200 us instead of 100us
Could someone tell me where I'm goofing ?
Ths in advance