PDA

View Full Version : Interrupt in picbasic (Hardware and Software)



lerameur
- 2nd December 2010, 20:12
Hi,

I have a program in picbasic pro using external interrupt on RB0 (user input). I would like to have a second interrupt (temperature sensor) Lets say TMR0. What I can read so far, both interrupt are called using the 'ON INTERRUPT Goto MyInterrupt' command. I know fron Darrel's interrupt page it is possible to have multiple interrupt in ASM, but I am using picbasic. Is it possible to have two different interrupt in picbasic?

K

tenaja
- 2nd December 2010, 23:32
Yes. As soon as you enter the interrupt service routine, you check the interrupt flags that you are expecting (the ones you turned on) and service the one that triggered.

Are you using PicBasic, or PicBasic Pro? If the latter, while I haven't personally used DT's Ints, I would advise you go for it. It's all scripted so you don't do any asm coding yourself. It was designed just for PBP, and isn't difficult to implement, from what I've seen. You'll get the best response time with the least headache.