CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How it works PGD ICSP pins on PIC24F?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

How it works PGD ICSP pins on PIC24F?
PostPosted: Tue Jul 02, 2019 1:12 pm     Reply with quote

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: 1900

View user's profile Send private message

PostPosted: Tue Jul 02, 2019 3:13 pm     Reply with quote

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: 406

View user's profile Send private message

PostPosted: Tue Jul 02, 2019 11:34 pm     Reply with quote

Ok, thanks for your answer.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Jul 11, 2019 8:40 am     Reply with quote

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.


Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group