Yep, that's Basic Migraine for yuh.
I typed this code into my Studio _14:
Code:
oninterrupt rbint, xint
enable rbint
; insert code body here
disable ; kills all interrupts
xint ; label for interrupt handler
;insert handler code here
resume ; return to spot where interrupt happened in main code
And this compiled fine. Are you using Studio 1.0.0.14? If not, get it. It's in the Download Section. If so, check your syntax and spelling again. If all that fails to rectify things, delete Studio and reinstall it.
The Nano is based on the PIC16F
886. The manual was originally for the PIC16F
876. There is a world of difference, which I am not going into here. Go here for the data sheet and check out page 223 in the PDF for the particulars:
http://ww1.microchip.com/downloads/en/DeviceDoc/41291F.pdfThe new processor allows you to do this on-change interrupt on
any PortB pin, B0 - B7, which is the Nano's P0 - P7. I can only think using RBINT as done with Studio now looks at all 8 pins at once, but I haven't used it in Studio, so can't say for sure. This is great if you're dedicating PortB to keypad or switch work only. When you do the RESUME at the end of the interrupt handler, the entire register holding these bits is reset. So, you'll have to check each bit of interest in that register, or save the entire register for later investigation, before using the RESUME.
Once you get this to compile OK, come back and tell me exactly what you want to do with these interrupts. I'll contact the programmer and see if he can supply a code example for your particular project.
Later!