• AVR Freaks

Hot!In Circuit Serial Programming (ICSP) or Enhanced ICSP?

Author
MTSPIKE
Starting Member
  • Total Posts : 39
  • Reward points : 0
  • Joined: 2017/05/10 05:46:22
  • Location: 0
  • Status: offline
2019/06/28 09:10:57 (permalink)
0

In Circuit Serial Programming (ICSP) or Enhanced ICSP?

I'm curious as to how an ICD or PICkit programs a PIC24FJ micro-controller.  The document "PIC24FJXXXGA0XX Flash Programming Specification" (DS39768D) mentions that there are two methods of programming the PIC24FJXXXGA0X family.  Specifically:
1) In-Circuit Serial Programming (ICSP)
2) Enhanced In-Circuit Serial Programming (Enhanced ICSP)
 
I use three different devices, an ICD3, an ICD4 & a PICkit4 to program various PIC24FJ's
 
How do I determine which of the above two methods is used when I program a PIC24FJXXXGA0X micro controller?
 
MTSPIKE
 
#1

13 Replies Related Threads

    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:11:49 (permalink)
    0
    why might you care ?
    #2
    NorthGuy
    Super Member
    • Total Posts : 5586
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:18:20 (permalink)
    0
    I'm pretty sure they all use "Enhanced ICSP". Otherwise it's too slow.
    #3
    DevMod1
    Administrator
    • Total Posts : 464
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:19:25 (permalink)
    0
    MPLAB X will decide which to use, if it can use the enhanced it will, if not, then it will revert to ICSP.  In most cases enhanced is used.  This is not a user selectable item.  So no worries from your side.

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #4
    MTSPIKE
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2017/05/10 05:46:22
    • Location: 0
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:20:47 (permalink)
    0
    For one, I'm putting together some slides for a class I teach, plus the fact that I am curious.
     
    The document I mention above "PIC24FJXXGA0XX Flash Programming Specification" shows one flow chart for ICSP Programming Flow (i.e., Figure 3-1) and a second flow chart for Enhanced ICSP Programming Flow (i.e., Figure 4-1).
     
    I would like to know which is the appropriate figure to use.
     
    MTSPIKE
    #5
    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:23:19 (permalink)
    0
    If you absolutely must know definitively which mode is used in a particular configuration attach a logic analyzer to the icsp pins and decode what is seen.
    #6
    du00000001
    Just Some Member
    • Total Posts : 3014
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: online
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:27:50 (permalink)
    0
    If you want to know for certain which method is used: decode the protocol !
    As the 2 methods are differing significantly, decoding part of the protocol would suffice to judge upon the method applied.
    To be honest: this seems to be purely academic. Or is it just "curiosity" ???

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #7
    MTSPIKE
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2017/05/10 05:46:22
    • Location: 0
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:39:09 (permalink)
    0
    du00000001,
    Yes, largely it is curiosity, but as they say ......Inquiring Minds Want to Know.
     
    Jim Nickerson,
     
    Actually, I started with a Logic Analyzer.  In looking at the waveforms, I was not able to determine which method was used.  
     
    DevMod1, 
     
    Your explanation is sufficient for my curiosity.  I will use the Enhanced ICSP Programming Flow diagram & simply mention that there is a Standard ICSP approach which may be used if needed, albeit slower.
     
    Thank you all,
     
    MTSPIKE
    #8
    NorthGuy
    Super Member
    • Total Posts : 5586
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 09:43:16 (permalink)
    0
    Mike L French
    For one, I'm putting together some slides for a class I teach, plus the fact that I am curious.
     
    The document I mention above "PIC24FJXXGA0XX Flash Programming Specification" shows one flow chart for ICSP Programming Flow (i.e., Figure 3-1) and a second flow chart for Enhanced ICSP Programming Flow (i.e., Figure 4-1).
     
    I would like to know which is the appropriate figure to use.



    IMHO, PIC24 ICSP programming is way to complex to be thought in a general purpose class. The flow chart won't help the students to understand the process and is likely to confuse them more to help. Rather explain them the general principle - the programmer installs a resident program on the chip, then communicates with this program through SPI while the program does all the programming job inside the chip. The program is called "programming executive", but you can call it a loader, which is a more generic term.
    #9
    MTSPIKE
    Starting Member
    • Total Posts : 39
    • Reward points : 0
    • Joined: 2017/05/10 05:46:22
    • Location: 0
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 10:40:10 (permalink)
    0
    NorthGuy,
     
    That is a good suggestion, thank you.
     
    The following is related to the ICSP or Enhance ICSP question, sort of.
     
    Both of the Programming Flow diagrams I mention above, the ICSP Programming Flow and the Enhanced ICSP Programming Flow, show the step of Program Memory occurring before the step of Program Configuration Bits.  However, bit 8 of Flash Configuration Word 2 determines which pins of the PIC24FJ128GA010 are used for Device Programming.  Specifically:
    bit 8 = 1:  Emulator/Debugger uses EMUC2/EMUD2
    bit 8 = 0: Emulator/Debugger uses EMUC1/EMUD1
     
    Correct me if I'm wrong, but I gather that one had better use EMUC2/EMUD2 for initial programming because bit 8 of Flash Configuration Word 2 has a default set (=1) condition.
     
    #10
    Jim Nickerson
    User 452
    • Total Posts : 6187
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 11:31:35 (permalink)
    0
    What might be the title/course of the class you teach ?
    Where might this class be taught ?
    #11
    NorthGuy
    Super Member
    • Total Posts : 5586
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: online
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 11:50:00 (permalink)
    +1 (1)
    Mike L French
    Specifically:
    bit 8 = 1:  Emulator/Debugger uses EMUC2/EMUD2
    bit 8 = 0: Emulator/Debugger uses EMUC1/EMUD1

     
    This only affects debugging, not programming. During debugging, the selected pair of pins becomes unavailable to the PIC because it is used to communicate with debugging hardware inside the chip.
     
    Generally, it doesn't matter what is the order of programming, you can program config first (except for protection bits, of course). However, there may be config settings which may interfere with programming somehow, therefore it is safer to program the config last. This way, config bits are always clean while you program everything else.
     
    #12
    du00000001
    Just Some Member
    • Total Posts : 3014
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: online
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/06/28 13:41:45 (permalink)
    0
    Imagine code protection: setting the config bits first would disable at least verification, at the maximum even further programming. It's good as it is  :)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #13
    DevMod1
    Administrator
    • Total Posts : 464
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: In Circuit Serial Programming (ICSP) or Enhanced ICSP? 2019/07/02 09:23:21 (permalink)
    0
    The device will "listen" on all the PGC/PGD pins for the proper activity and use those for programming.  If you are using alternate DEBUG pins then you must set them in the config word prior to DEBUG, but programming can occur on any of the PGC sets.

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #14
    Jump to:
    © 2019 APG vNext Commercial Version 4.5