Page 1 of 1

Interrupt_low using Timers 0, 1 and 2.

Posted: 30 Sep 2010 18:55
by Angelli
Hi
You have programmed the Timer 0, 1 and 2 as Interrupt_low?
Can you help me or show me an example?
Will I have to work with these leading Timer interrupt.
Thank you for your attention!

Best Regards,

Anderson

Re: Interrupt_low using Timers 0, 1 and 2.

Posted: 01 Oct 2010 14:12
by ranko.rankovic
Hello Angelli,

What MCU type you have?

If you are looking for examples that are written for Timer0/1/2 Interrupt, they are located within examples provided with our software bundle (\Examples\Internal MCU modules\).

Also you can read under section Interrupts in our Help file little more about it.

Best regards

Re: Interrupt_low using Timers 0, 1 and 2.

Posted: 01 Oct 2010 16:14
by Angelli
Dear Rankovic,
Thank you for your attention!
I am using the PIC18LF6722.
Noting examples can fix and better absorb the knowledge.
You can post a snippet of this configuration with Interrupt_low Timers?

Thanks!

Best regards.

Anderson Angelli.

Re: Interrupt_low using Timers 0, 1 and 2.

Posted: 02 Oct 2010 04:35
by womai
Using the low priority interrupt on a PIC18F device works exactly the same as using the normal interrupt, with a few additions:

- enable interrupt priority bit (set it to 1)
- globally enable low priority interrupts (INTCON.GIEL = 1)
- set the interrupt priority bit of the interrupt in question (e.g. for timer0 the bit is called TMR0IP) to low (= 0)
- instead if void interrupt(), define a function called void interrupt_low()

So just take the existing timer interrupt example, add above changes (refer to the PIC data sheet, section "Interrupts", for the register names where these bits are located), and you should be up and running.

Wolfgang