How do I configure interrupt priorities (IPEN = 1) for the pic18f67k22 microcontroller? I am using the PCWH compiler.
I do not see it on the IDE project wizard, or find it on the CCS C compiler manual.
Also, my code includes use of the modbus rtu driver. It is factory configured to interrupt on RDA from the uart. Can it be re-configured to use hi/lo interrupt priority and set as low priority?
Thanks!
Ttelmah
Joined: 11 Mar 2010 Posts: 19535
Posted: Wed Apr 29, 2020 11:27 am
It is in the manual.
Add the line:
#device HIGH_INTS=TRUE
near the start of your code (just after the include for the processor).
This turns on IPEN.
Then declare your INT_RDA with:
#INT_RDA HIGH
This will then be a high priority interrupt, with separate locations used
to store the regsiters.
One caveat. INT_EXT does not have a priority control bit, and if this
is used it will always be a high priority interrupt.
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