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
Interrupt_low using Timers 0, 1 and 2.
- ranko.rankovic
- Posts: 433
- Joined: 11 Jun 2010 09:22
Re: Interrupt_low using Timers 0, 1 and 2.
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
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
Ranko Rankovic
mikroElektronika [Support Department]
mikroElektronika [Support Department]
Re: Interrupt_low using Timers 0, 1 and 2.
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.
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.
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
- 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