• AVR Freaks

PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work

Author
acharnley
Super Member
  • Total Posts : 268
  • Reward points : 0
  • Joined: 2016/05/01 06:51:28
  • Location: 0
  • Status: offline
2019/04/10 10:45:30 (permalink)
0

PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work

Hardware: Snap, Pickit 4
MPLABX: 5.05, 5.15
XC8: 1.45b, 2.05. All optimisations off/0.

Constantly without fail any breakpoint set within an interrupt results in the attached image. Only interrupts inside the main loop work. I've tried every setting possible and the only thing left is to buy an ICD3.
 
Ideas?

Attached Image(s)

#1

6 Replies Related Threads

    jack@kksound
    code tags!
    • Total Posts : 3183
    • Reward points : 0
    • Joined: 2014/05/14 10:03:19
    • Location: 0
    • Status: offline
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:01:45 (permalink)
    0
    What are you expecting to happen?
    #2
    acharnley
    Super Member
    • Total Posts : 268
    • Reward points : 0
    • Joined: 2016/05/01 06:51:28
    • Location: 0
    • Status: offline
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:08:51 (permalink)
    0
    I'd like the interrupt to fire, i.e a red bar not a "broken interrupt"
    #3
    pcbbc
    Super Member
    • Total Posts : 900
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: online
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:20:38 (permalink)
    0
    Is that function called from the main ISR somewhere?
    Show us that code. In fact show us all your code!
    To me the broken breakpoint looks like this function has been optimised away, hence why the debugger can’t set a breakpoint.

    Edit: So are you sure you have a reference to SMT1_PR_ACQ_ISR somewhere in your code, and it is actually used?
    post edited by pcbbc - 2019/04/10 11:23:27
    #4
    acharnley
    Super Member
    • Total Posts : 268
    • Reward points : 0
    • Joined: 2016/05/01 06:51:28
    • Location: 0
    • Status: offline
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:23:21 (permalink)
    0
    It's called from here
     

    void __interrupt() INTERRUPT_InterruptManager (void)
    {
    // interrupt handler
    if(PIE0bits.IOCIE == 1 && PIR0bits.IOCIF == 1)
    {
    PIN_MANAGER_IOC();
    }
    else if(INTCONbits.PEIE == 1)
    {
    if(PIE8bits.SMT1IE == 1 && PIR8bits.SMT1IF == 1)
    {
    SMT1_Overflow_ISR();
    }
    else if(PIE8bits.SMT1PRAIE == 1 && PIR8bits.SMT1PRAIF == 1)
    {
    SMT1_PR_ACQ_ISR();
    }
    else if(PIE2bits.C1IE == 1 && PIR2bits.C1IF == 1)
    {
    CMP1_ISR();
    }
    else if(PIE5bits.TMR5GIE == 1 && PIR5bits.TMR5GIF == 1)
    {
    TMR5_GATE_ISR();
    }
    else if(PIE4bits.TMR2IE == 1 && PIR4bits.TMR2IF == 1)
    {
    TMR2_ISR();
    }
    else if(PIE1bits.ADIE == 1 && PIR1bits.ADIF == 1)
    {
    ADCC_ISR();
    }
    else
    {
    //Unhandled Interrupt
    }
    }
    else
    {
    //Unhandled Interrupt
    }
    }
     


    No optimisations enabled, as stated.
    #5
    pcbbc
    Super Member
    • Total Posts : 900
    • Reward points : 0
    • Joined: 2014/03/27 07:04:41
    • Location: 0
    • Status: online
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:27:50 (permalink)
    0
    Anywhere else?
    If not, then my guess (and it is just that) is the compiler has inlined those function for you.
    Have you looked at the assembly listing?
    #6
    acharnley
    Super Member
    • Total Posts : 268
    • Reward points : 0
    • Joined: 2016/05/01 06:51:28
    • Location: 0
    • Status: offline
    Re: PIC16F18855 -> Breakpoints in Interrupts -> Making Them Work 2019/04/10 11:56:31 (permalink)
    0
    I've fixed it, I forgot that this chip needs High Voltage Programming Mode to breakpoint in interrupts. Probably a bug with the newer debugging tools. I was until yesterday working with PIC18 which doesn't exhibit the issue.
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5