TMR0 interrupt on 16F886

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

TMR0 interrupt on 16F886

Post by Mark »

Hi there,

I have tried to implement a simple timer 0 interrupt on a 16F886, identical to one that works on a 16F876 and it does not work. In simulation it works but rather slowly.

Please confirm that you can get it to work on the chip.

thanks,

Mark
Go with the Flow.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: TMR0 interrupt on 16F886

Post by Benj »

Hello Mark

In the Timer interrupt properties can you make sure that the clock sorce is set to CLKO and not T0CKI pin. The T0CKI is an external input that can act as a clock for the timer if you wish but the CLK0 is driven directly from the internal program frequency clock (Crystal Frequency / 4) / Prescaler.

Mark
Posts: 209
Joined: Thu Oct 19, 2006 11:46 am
Location: Bakewell, UK
Has thanked: 20 times
Been thanked: 16 times
Contact:

Re: TMR0 interrupt on 16F886

Post by Mark »

Benj,

Yes, thanks for the suggestion, my Idiot mistake.
(of course the form still says that interrupt is at a given frequency even when an external input is chosen)

Thanks a lot for the quick response, the error had been bugging me for days.

Thanks,

Mark
Go with the Flow.

Post Reply