|
|
View previous topic :: View next topic |
Author |
Message |
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
PIC18 high and low priority interrupts |
Posted: Thu Jan 24, 2008 8:42 am |
|
|
Hi,
I need to use the PIC18 capability of high and low priority interrupts, where a high can interrupt a low. I've done this numerous times in projects I've written in assembler, but never in c. Is it even possible? If so, where is it documented?
Thanks for your help!
Jim |
|
|
Ttelmah Guest
|
|
Posted: Thu Jan 24, 2008 9:33 am |
|
|
#int_xxxx high
Look under the #INT_xxxx entry in the manual. Two keywords. 'FAST', and 'HIGH'. Both define high priority interrupts, the former, requires _you_ to save any registers used, and has no code to identify what device has interrupted (designed fo use for one device to give the fastest possible handling, if you know what you are doing), while 'high', generates the requires handler and parsing to support multiple high priority interrupts.
You also need to add the define:
#device HIGH_INTS=TRUE
Near the start of the code, to trigger the compiler to generate the extra code to handle these.
Best Wishes |
|
|
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
|
Posted: Thu Jan 24, 2008 10:11 am |
|
|
Most excellent! That's exactly the direction I needed. Thank you!!
Jim |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|