View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
How it works PGD ICSP pins on PIC24F? |
Posted: Tue Jul 02, 2019 1:12 pm |
|
|
I'm new on PIC24FJ and read that there's 3 pairs on PGC&PGD pins and seems like the default are PGC1 & PGD1
Now I wondering if I want to use one of the other pairs on a blank new device Should I first program them using PGC1 & PGD1 pair or I can directly use any of them?
If so, What's the purpose of those bits(ICS<1:0>) _________________ Electric Blue |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Tue Jul 02, 2019 3:13 pm |
|
|
On a blank device any of the ICSP pairs may be used to program the device. When you program it, you can select a particular ICSPn fuse corresponding to the ICSP "port" you're using. Once that is done, only that port may be used to program the part until the fuses are reset/erased. |
|
|
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Tue Jul 02, 2019 11:34 pm |
|
|
Ok, thanks for your answer. _________________ Electric Blue |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Thu Jul 11, 2019 8:40 am |
|
|
In fact you can always _program_ on any pair of the pins.
The fuses have to be set to enable debugging on the pins.
So
#DEVICE ICSP=2
for example tells the compiler to set the fuses to use the PGC2/PGD2 pins
for debugging.
From the reference manual:
Quote: |
All PGCx and PGDx pins are functionally tied together and behave identically,
and any one pair can be used for successful device programming. The only
limitation is that both pins from the same pair must be used.
|
However for debugging:
Quote: |
In contrast with programming, only one of the ICSP ports may be used for
ICD. Depending on the particular PIC24F device, there may be two or more
ICSP ports that can be selected for this function. The active ICSP debugger
port is selected by the ICS Configuration bit(s). For information on specific
devices, refer to the appropriate device data sheet.
|
|
|
|
|