• AVR Freaks

Hot!ICDInterrupt What does this do?

Author
rangeck
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2011/03/01 14:13:58
  • Location: 0
  • Status: offline
2020/08/05 08:50:23 (permalink)
0

ICDInterrupt What does this do?

I have a device where if you halt the debugger during a mode of operation (~100ms long) or it hits a breakpoint during it, then the device tends to self destruct. The device handles this mode just fine for the short 100ms, but if it gets halted during it - then it is stuck for 1 sec+ while i try to hurriedly try to turn off the power (hitting go/run is much less reliable as mplab is clunky)
 
So I've found this interrupt vector ICDInterrupt that I was thinking might help. I would hope that when a breakpoint or halt occurs, then this interrupt fires and is executed, and then the halt/break is performed. If that is the case then I can execute some code that turns off the high powered mode self destruct mode before the halt/break
 
I tried this, and ICDinterrupt doesn't appear to run. I see there is a ICDIF interrupt flag, but no corresponding ICDIE interrupt enable that I can find.
 
Does anyone have any information or can point me to it? Searching microchip and google pretty much only comes up with the .gld linker scripts and processor manuals where this is referenced
#1

12 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28385
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/05 13:30:11 (permalink)
    0
    I can't imagine how something like "ICDInterrupt" would help.
    This sounds more like a hardware problem on your board, but without even revealing what PIC device this is, we can only speculate.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 18909
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/05 13:50:48 (permalink)
    4 (1)
    What peripheral is causing your device to self-destruct? If you look at the options for your the debugger there should be an option to halt or not halt Peripherials on break. I would assume the ICD interrupt is controlled by the ICD debugger code.

    Ric, not necessarily a hardware fault but the way the hardware was designed.
    I once worked on a project where the power factor control FET would explode if it was on when did the bugger halted. Something that couldn’t happen in normal operation.
    But I guess it’s something that should be considered with a design that you know is going to be run with a debugger.
    #3
    NorthGuy
    Super Member
    • Total Posts : 6294
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: ICDInterrupt What does this do? 2020/08/05 14:21:41 (permalink)
    5 (2)
    NKurzman
    I once worked on a project where the power factor control FET would explode if it was on when did the bugger halted. Something that couldn’t happen in normal operation.

     
    You can build a safe board where nothing explodes and debug everything using this board.
     
    If you must use an unsafe board, then it's best to use less-intrusive debug methods - such as toggling signals or UART console.
     
    If something crashes in your program, then anything can happen in a normal situation, although you probably wouldn't call such situation normal :)
     
    @OP: Not sure about the interrupt. But it's certainly not for halting. What device do you have?
    #4
    Antipodean
    Super Member
    • Total Posts : 1908
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/05 14:27:04 (permalink)
    0
    NorthGuy
    @OP: Not sure about the interrupt. But it's certainly not for halting. What device do you have?



    And also how did he find out about the interrupt? It doesn't appear in any docs I have come across.
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #5
    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11982
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/05 14:30:57 (permalink)
    4 (1)
    You can find an ICDIF in 16-bit parts like the PIC24EP/dsPIC33EPxxx.  Its functionality is not documented in the family data sheet.
    #6
    ric
    Super Member
    • Total Posts : 28385
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/05 14:46:29 (permalink)
    0
    NKurzman
    ...
    Ric, not necessarily a hardware fault but the way the hardware was designed.
    I once worked on a project where the power factor control FET would explode if it was on when did the bugger halted.

    That's precisely what I was getting at. Details of the hardware design that should not be left in a particular state for more than a short period.
    No twiddling with software details of the PIC are going to protect you from this if it is halted by the debugger.
    Again, we can only speculate with no information about what PIC or what it is connected to.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    NorthGuy
    Super Member
    • Total Posts : 6294
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: ICDInterrupt What does this do? 2020/08/05 14:55:32 (permalink)
    5 (2)
    jtemples
    You can find an ICDIF in 16-bit parts like the PIC24EP/dsPIC33EPxxx.  Its functionality is not documented in the family data sheet.



    These have rather complex on-chip debugger which maintains communications with the probe even while the target is running. The probe can even read/write memory at run time.
     
    They have a mail-slot for communications between the probe and the app running on the target. I think it's called APPIO. I think there's even documentation for it, but I can't find the link.
     
    My guess the interrupt could be produced by the probe at will, but I never tried this. Alternatively, it may be a part of APPIO.
    #8
    rangeck
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2011/03/01 14:13:58
    • Location: 0
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/06 05:25:08 (permalink)
    5 (1)
    We use a couple of PIC24EP series parts, the PIC24EP256GU810 and PIC24EP64GP204. The design turns on a LED string driver at a very high power for a brief time (strobe) and it handles this just fine in normal operation. However if the driver is left on for longer than the design intends, the circuit will burn up.
     
    I gather from the posts, that nobody knows much about this mysterious interrupt :(
    #9
    Jerry Messina
    Super Member
    • Total Posts : 550
    • Reward points : 0
    • Joined: 2003/11/07 12:35:12
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/06 05:47:34 (permalink)
    5 (1)
    If the strobe timing/high power output is controlled by a hardware resource you might be able to use the "freeze peripherals on break" feature to unfreeze it and let it continue to operate while you're stopped at a breakpoint.
     
    #10
    LdB_ECM
    Super Member
    • Total Posts : 435
    • Reward points : 0
    • Joined: 2019/04/16 22:01:25
    • Location: 0
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/06 07:17:13 (permalink)
    5 (1)
    Ask your electronic engineer to put a fold over current limit circuit on it, a transistor a couple of resistors and a capacitor if you want it to allow short time bursts to exceed the clamp.
     
    Costs next to nothing and much smarter than running with a design that is inherently catastrophic.
    #11
    Antipodean
    Super Member
    • Total Posts : 1908
    • Reward points : 0
    • Joined: 2008/12/09 10:19:08
    • Location: Didcot, United Kingdom
    • Status: offline
    Re: ICDInterrupt What does this do? 2020/08/07 04:48:47 (permalink)
    5 (2)
    jtemples
    You can find an ICDIF in 16-bit parts like the PIC24EP/dsPIC33EPxxx.  Its functionality is not documented in the family data sheet.



    Ah, OK. I have known that the ICD uses an interrupt right from the earliest 16F device that could use debug. It has never been documented, and runs at a higher priority than any other interrupt, which is why it is impossible to single step into an interrupt.
     
    I would guess that on a 24/33 device it would run as a non-maskable interrupt.
     

    Do not use my alias in your message body when replying, your message will disappear ...

    Alan
    #12
    NorthGuy
    Super Member
    • Total Posts : 6294
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: ICDInterrupt What does this do? 2020/08/07 06:02:23 (permalink)
    5 (1)
    Ant-podean
    Ah, OK. I have known that the ICD uses an interrupt right from the earliest 16F device that could use debug. It has never been documented, and runs at a higher priority than any other interrupt, which is why it is impossible to single step into an interrupt.
     
    I would guess that on a 24/33 device it would run as a non-maskable interrupt.



    Debugger certainly interrupts the execution when it halts, but the mechanism is completely different from the regular interrupts and the execution goes to the debugging executive. On some older chips you can place the debugging executive into regular memory. Newer chips have special memory area for the debugging executive. This memory is hidden from the user code. This makes debugger completely invisible to the application.
    #13
    Jump to:
    © 2020 APG vNext Commercial Version 4.5