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 CCS Technical Support

icsp pin programing error in pic24fj128gb204

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



Joined: 02 Apr 2004
Posts: 13
Location: TURKEY

View user's profile Send private message Send e-mail

icsp pin programing error in pic24fj128gb204
PostPosted: Wed Jun 27, 2018 7:01 am     Reply with quote

ccs c ver 5.075
mplab-x ver 4.05
Code:

#include <24FJ128GB204.h>
#device ICSP=1
#use delay(internal=4MHz)

#FUSES FRC
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES NOJTAG                   //JTAG disabled

void main(void) {
   
    while(TRUE){
       
    }
}

I try to program pic24fj128gb204 with pickit3.
When i select icsp3 pins programing is ok.
When i select icsp1 pins getting error.
Error message page is as follows on mplab-x.

*****************************************************

Connecting to MPLAB PICkit 3...

Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.06
Firmware type..............dsPIC33F/24F/24H

Target voltage detected
Target device PIC24FJ128GB204 found.
Device ID Revision = 4

Device Erased...

Programming...

The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x3ff
configuration memory
Failed to program device

*****************************************************

Thanks for your help.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jun 27, 2018 11:31 am     Reply with quote

Aycan wrote:
#include <24FJ128GB204.h>
#device ICSP=1


Try using this syntax instead:
Quote:
#include <24FJ128GB204.h>
#device ICD=1


The CCS manual says:
Quote:

#device ICD=n
For chips with multiple ICSP ports, specify the port number
being used. The default is 1.
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jun 27, 2018 6:16 pm     Reply with quote

While I don't use that PIC, I found it interesting that while PK3 found the device and erased it it couldn't program it. I'd have thought the hardware was OK (pin #s) as 2 out of 3 operation were sucessful.
Something else then got me thinking, as ICSP and ICD are 2 different concepts. ICSP (In Circuit Serial Programming) is just a way to 'stuff code into a PIC' whereas ICD (In Circuit Debugging) is a complicated 'master' program to allow the programmer a 'line by line' view of a PIC program running.
Then I wonder about the 'chicken and egg' problem where you want the PIC to use an optional set of pins for ICD/ICSP yet you need to program the PIC to tell which pins but the hardware is on the optional pins. All this hopefully is explained in the PIC datasheet. Maybe I'm getting too old for PICs...

Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19551

View user's profile Send private message

PostPosted: Thu Jun 28, 2018 12:30 am     Reply with quote

Any of the ICSP pairs can actually enter the programming mode. For programming _all_ the sets are permanently active. It is the manipulation of the MCLR line needed that prevents accidental entry to programming mode. Once the chip is in programming mode, for debugging, the debug executive program is loaded into the chip, and it is this that then only uses one pair of the pins to load the rest of the code, and for debugging.

So wrong pair of pins selected, the chip will still accept the initial executive programming and reply to this. However when the debug executive takes over, it'll then fail.

If he is just programming the device, there is no need to select the pin pair involved. If it is failing with a second pair, then look at the wiring (length of connections, capacitance etc..). The ICSP connections can be fussy on the faster PIC's in particular. On a couple of PIC24's I have to use cables that are half the length of the normally supplied ones for ICSP to work....
temtronic



Joined: 01 Jul 2010
Posts: 9246
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jun 28, 2018 4:29 am     Reply with quote

Thanks for the explainatin Mr T. !
Things were a lot simpler when PICs had windows on them.
Aycan



Joined: 02 Apr 2004
Posts: 13
Location: TURKEY

View user's profile Send private message Send e-mail

PostPosted: Fri Jun 29, 2018 8:21 am     Reply with quote

Hi everybody.
While i trying to fix problem in yesterday night, i realized pickit3 programmed when i connect oscilloscope probe to mclr pin for observe waveform.
Then i connect two of 0.1uF and 0.01uF additional capacitor to 3.3V power trace. Finally it worked. Thanks all of you for giving a time.
Have a nice days.
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