View previous topic :: View next topic |
Author |
Message |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
Problem programming 16F17576 with icd-u64 [solved] |
Posted: Sun Aug 10, 2025 3:00 pm |
|
|
Greetings fellow coders,
I am trying to program the curiosity nano pic16f17576 from a icd-u64 programmer (bypassing the onboard debugger). I removed the D0, D1, and D3 GPIO straps that tie the target 16F17576 PGC, PGD, and MCLR_ lines to the debugger so that I can program the '17576 target MCU externally. I also removed the power supply strap so that I can feed an external supply only to the target MCU.
Using CCS device programmer I can read the ID and correct target voltage, which tells me my MCLR_, PGC, and PGD are talking to the target MCU but when I try blowing in a quickie test program it fails the verification read-back. It reads back all 0's instead of the code that was programmed into it (if it was even programmed in there correctly). I can erase the chip and verify it's blank but any code I blow into it seems to not be well received or received at all.
I am not powering the curiosity nano board via USB input into debugger as I don't require that portion of the board. I essentially just want to use the target '17576 to develop on.
Listed below is the source code and header file. Any help is greatly appreciated.
c code:
Code: |
#include <SDPT_FIXTURE_NEW_TEST.h>
#include <stdio.h>
#include <ios.h>
void main()
{
setup_wdt(WDT_1S); //~1.0 s reset
setup_adc_ports(sAN16 | sAN17, sAN32, VSS_VREF);
setup_adc(ADC_CLOCK_INTERNAL | ADC_TAD_MUL_0 | ADC_LEGACY_MODE | ADC_THRESHOLD_INT_DISABLED);
while(TRUE)
{
//Example blinking LED program
output_low(LED);
delay_ms(DELAY);
output_high(LED);
delay_ms(DELAY);
//TODO: User Code
}
|
SDPT_FIXTURE_NEW_TEST.h header code:
Code: | #include <16F17576.h>
//#device ADC=12
#FUSES WDT //Watch Dog Timer
#use delay(internal=16000000,restart_wdt)
#pin_select U2TX = PIN_D6
#pin_select U2RX = PIN_D7
#use rs232(baud=115200,parity=N,xmit=PIN_D6,rcv=PIN_D7,bits=8,stream=PORT1,restart_wdt)
#define LED PIN_E1
#define DELAY 200
|
Last edited by robleso7473 on Fri Aug 15, 2025 8:33 am; edited 1 time in total |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9568 Location: Greensville,Ontario
|
|
Posted: Sun Aug 10, 2025 4:44 pm |
|
|
OK, probably not the problem but.....
On some PICS I recall you couldn't use internal clock with a PICSTART+ programmer.
Hay it's 40+*C here for past 2 dayze.....
Also ,generally not a good idea to enable the WDT until code actually works. I know not 'the' problem, just something I saw.
What's 'weird' to me is reading all ZEROS ! A blank PIC is all ONES.
It'll be interesting to hear WHAT the problem and solution are for this !! |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Sun Aug 10, 2025 5:58 pm |
|
|
Hey Temtronic, good to read you again. 40C? Yeah that's hot alright but over here we were hovering around 43C for days on end. It dropped to 41 today ;)
At this point I'm willing to try anything. If I disable the internal clock would I require an external oscillator of some sort? I think the curiosity nano has a 32.72something kHz crystal.
Good advice on the WDT, I will disable it until way at the end.
I have more information on the readback and other things I tried:
1. I tried a 2nd ICD-U64 and it performs the same, sometimes I read back 3FFFs
2. I found the CCS Load-n-Go programmer I was saving for that day when this business finally takes off and I would be called to program something on the field. On this programmer I actually am reading back more or less non 0 or non F data. It appears to be performing better but not reading back everything correctly.
3. I put the old scope probes on these lines (PGC, PGD, and MCLR_). PGD and PGC signal quality looks good (crisp fast transition and no noise), BUT MCLR_ is scaring me, the first time it goes high it hits 10V which according to the '17576 spec is a no-no, the absolute maximum specified is 9V. Does this mean that the CCSINFO programmers are generating too high of a programming MCLR_ Vpp voltage? Would this permanently damage the target MCU.
Thanks.
O |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9568 Location: Greensville,Ontario
|
|
Posted: Sun Aug 10, 2025 6:04 pm |
|
|
taking wild guesses but....
Can you try another type / series of PIC (same program of course, or similar ) ? That'd rule out wiring, pgmr funnies, etc.
Any chance you need say a 10O resistor on _MCLR pin ??
Sounds like Nano has a 'clock crystal' onboard, 32.768 KHz...
Hopefully the guys who make money 'playing with PICs' will reply soon with better answers..... |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Sun Aug 10, 2025 7:20 pm |
|
|
That's a good suggestion, I believe I can dig up an old board with a 16F18055. I will program that one to see if the ICD-U64 is good.
I was thinking the same thing, adding a small series resistance might not be a bad idea.
I will reconnect the 32.768 kHz xtal to see if that makes any difference.
All good suggestions, I appreciate your support on this. |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Sun Aug 10, 2025 8:32 pm |
|
|
I just tested programming an old board with a PIC16F18055 that I had programmed dozens of times using the ICD-U64 (with an older ICD-U64 FW version) but today it is failing just like with the PIC16F17576. The only difference is that today before I started using the ICD-U64 (after months of not using it) I upgraded the U64 FW to 3.64....
I tested it out with the 2nd U64 (which also has FW 3.64) and the load-n-go which I also upgraded to FW 3.64 and they're all crapping out.
Has anyone heard issues with the FW 3.64 affecting the U64 or load-n-go programmers?
I wonder if this has anything to do with Vpp being 10V...?
I'm going to start a new thread because no one's going to respond to this one. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19928
|
|
Posted: Mon Aug 11, 2025 12:12 am |
|
|
Talk to CCS.
There seem to have been some problems introduced on some of the newer
chips, with some recent enhancements to the programming algorithms.
I've had a couple of chips now, where they have told me to change the
programming method in device editor.
Your chips will be using the 16F181xx 90/8F method. They may well
suggest you change this setting.
They are the people to talk to on this. They may well fix the problem and
do a new firmware release, but it does need to be reported for them to
know there is a problem.
You seem to have launched two threads on the same issue. Vpp, is meant to
be 8.5v. Sounds as if this firmware is doing something wrong, so again,
'talk to CCS'. |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Mon Aug 11, 2025 7:31 am |
|
|
Hi Ttelmah,
Thank you for this useful information and guidance. I will get in touch with CCS to report this problem.
O |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Tue Aug 12, 2025 8:04 pm |
|
|
Hi All,
After getting in touch with CCS, one of their SW engineers helped me resolve this issue. Turns out, as Ttelmah correctly suggested, there was an issue with the ICD-U64 programming algorithm.
I was given the latest 3.66 FW and now I can program the 16F17576 MCU correctly.
Thanks for the support fellows! |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19928
|
|
Posted: Wed Aug 13, 2025 2:01 am |
|
|
Great.
Change the thread title add [solved].
You now know what we so like CCS.  |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9568 Location: Greensville,Ontario
|
|
Posted: Wed Aug 13, 2025 5:32 am |
|
|
whew ! glad it's SOLVED !!!
one can lose a LOT of hair, drink waay too much coffee over issues like this that WE didn't cause.... |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Wed Aug 13, 2025 8:15 am |
|
|
You guys are awesome - can't thank you enough.
Yes, I agree that CCS is very responsive. Another reason I continue to use this compiler year-in year-out.
Keep up the great work  |
|
 |
robleso7473
Joined: 25 Mar 2009 Posts: 56
|
|
Posted: Wed Aug 13, 2025 8:19 am |
|
|
Tthelmah: How do I change the thread title? Sorry never did this before. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 19928
|
|
Posted: Thu Aug 14, 2025 9:15 am |
|
|
You edit the original post. Change the title line. Only you as the poster
can do this. I can delete things, but cannot edit the title, but you as the
poster can.  |
|
 |
|