Log in

View Full Version : DT interrupt problem / K40 - "Priority State Not Found"



achilles03
- 21st April 2026, 02:07
I'm trying to switch from an 18F25K20 to an 18F26K40, and I'm getting a compiler error (PBPX 3.1.6.4) specific to the timer interrupt definition. I'm using the interrupt include file "DT_INTS-18_3_4c.bas" as defined in this thread:

https://www.picbasic.co.uk/forum/showthread.php/23940-Error-when-compiling-with-DT_INTS_3_4b-quot?highlight=DT_INTS-18_3_4c

I've tried defining the priority via the INTCON and IPR0 registers directly, modifying the original "DT_INTS-18.bas" directly based on mpgmike's writeup to customize the interrupts, and changing to a timer1 interrupt (vs timer0), but no dice. I imagine I'm overlooking something simple cause I can often be an idiot. Any help is greatly appreciated! The code for the interrupt definition code is below:


@bsf IPR0, TMR0IP 'set timer0 overflow to high priority
IPR0.5=1
INTCON.7=1
INTCON.6=1
INTCON.5=1

'----[Start High Priority Motor and PPM Read Interrupt]-------------------------
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR0_INT, _MOTOR_CONTROL, ASM, yes
endm
INT_CREATE ; Creates the interrupts
ENDASM
'----[End High Priority Motor and PPM Read Interrupt]---------------------------

richard
- 22nd April 2026, 07:30
@bsf IPR0, TMR0IP 'set timer0 overflow to high priority



since ipr0 is not in access bank memory , that will not do what you think and may cause all sorts of buggy behavior

also tmr0 interrupt is high priority at por so its an unnecessary step
as is
IPR0.5=1


the problem lies in the code not posted

achilles03
- 23rd April 2026, 17:56
the problem lies in the code not posted

Yep, I found a "@ INT_DISABLE INT_INT" in a function in one of my include files (that I don't even use currently). After commenting it out, it compiled fine.

Thanks!
Dave