PicBasic, program with timer1 and timer0

Status
Not open for further replies.

AlexNadal

Junior Member level 3
Joined
Nov 28, 2006
Messages
25
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,459
When I work with the timer1 and timer 2 in picBasic, how can I distinguish which has interrupt the program?! wich flags?! And how I can do differents things depends on the interruption?!

thanks
 

In the ISR, the fist things to do are check the interrupt flags.
For example:

Code:
btfsc  PIR1, TMR1IF
goto  TMR1_interrupt

btfsc  PIR1, TMR2IF
goto  TMR2_interrupt

btf..... and so on


TMR1_interrupt:    ;code for TMR1


TMR2_interrupt:    ;code for TMR2
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…