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

Unable to Load Code, Help Please

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



Joined: 15 Jun 2011
Posts: 16

View user's profile Send private message

Unable to Load Code, Help Please
PostPosted: Fri Nov 04, 2011 10:34 am     Reply with quote

I had a working program, I made some changes to code, it compiled with no errors, but now I get a verification error when I try to download. It may be caused by a write protect fuse being set. I did not intentionally change any fuses. Compiler is 4.124 I am using ICD-U64. I have tried this with 2 programmers and 3 different PCB's. Any Suggestion?
Code:

#include <16F886.h>
#device *=16
#device ICD=TRUE
#device adc=10
#FUSES NOWRT
#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC_IO                 //Internal RC Osc, no CLKOUT
#FUSES PUT                      //Power Up Timer
#FUSES NOPROTECT                  //Code protected from reads
#FUSES NOLVP                    //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES BORV21                   //Brownout reset at 2.1V
//#FUSES WRT_50%                  //Lower half of Program Memory is Write Protected
#FUSES NOIESO
#FUSES NOFCMEN
#use delay(int=500000,RESTART_WDT)     // was 1 mhz
#use rs232(DEBUGGER, stream=DEBUG)

//#use STANDARD_IO( A )
//#use FIXED_IO( A_outputs=PIN_A5,PIN_A7 )
#use FIXED_IO( B_outputs=PIN_B4,PIN_B2 )
#use FIXED_IO( C_outputs=PIN_C7,PIN_C5,PIN_C3,PIN_C1,PIN_C0 )


From list
Configuration Fuses:
Word 1: 00F4 INTRC_IO NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT NOIESO NOFCMEN NOLVP DEBUG
Word 2: 3EFF BORV21

Some fuses have been forced to be compatible with the ICD debugger.
temtronic



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

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 11:29 am     Reply with quote

Go back to your last known good working program and try to download it. You do keep sequential backups, right ????
What changes in hardware or upgrades did you change ? You mention 3 different PCBs, are these homemade or commercial products ? Any chance the ICSP cable is defective ?
Power supply not correct ?
armondo58



Joined: 15 Jun 2011
Posts: 16

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 11:43 am     Reply with quote

Hi Tem,

I have many versions of code, none of them will download (all worked before). The boards are home made, and were working very well. They are in 2 different locations, both were working. When I compiled the latest release, I could not download and neither could my associate. I made changes only to code, not any fuses. We have tried downloading older working versions in both locations and still get verification error. This is very strange indeed. Its as if, the icd is not reading the configuration bits correctly.
Thanks for response.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 11:52 am     Reply with quote

Look at the CCS ICD-U trouble-shooting page:
http://www.ccsinfo.com/faq.php?page=troubleshoot_icd
It shows screenshots of the the diagnostic features of the latest CCSload
program.

A list of more features:
http://www.ccsinfo.com/content.php?page=ccsloadsw
armondo58



Joined: 15 Jun 2011
Posts: 16

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 2:08 pm     Reply with quote

Is it possible, if by accident, the protect bit was set, would that prevent the chip from being erased and not be programmable any more. Or should a chip erase wipe out that bit also...I wrote a quick program, just to flash a led on the board, and I still can't program the chip. This is on 2 different boards, with 2 different programmers and different ccsload versions.
temtronic



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

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 2:16 pm     Reply with quote

Is this comment..When I compiled the latest release... referring to the compiler or the ICD software and why did you 'update' ?
I've found it better to download 'updates' into a new folder(usually named the version, like PCM4124,ICD1234) and NOT install unless there is a specific reason to.If you 'self contain' it into a unique,identifiable folder you can do a 'test run' to be sure it works, if not, go back one version easily.

It sounds like you've trashed a good working 'environment' ( source,compiler,icd,etc.). Try to go back to when things worked. Uninstall whatever to get there.Don't know if you can 'set the clock back' by having Windows go back say 2 weeks to get things back in order.

It is very,very important to have updates in separate folders and at least 2 backups of everything. I've got 'version folders' going back to PCMv2.540 and each has copies of all sources in them.Folder 'BKPPCM2540' is a complete backup of all files ever used using PCM version 2.540. Yes, it can get the harddrive 'cluttered' but it's all there and I can 'set the clock back' whenever and wherever I need to.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 04, 2011 2:21 pm     Reply with quote

What is the Vdd voltage for the PICs on these boards ?

Do you have the correct board design with 100 nF (0.1 uF) caps all Vdd
pins for the PICs ?

Do you have a pullup resistor on the MCLR pin ?


Quote:
I wrote a quick program, just to flash a led on the board.

Post this program.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Fri Nov 04, 2011 3:22 pm     Reply with quote

Well The ICD-U64 and CCSLOAD together will allow you to run diagnostics.
The first thing is to establish whether you are powering the target independently or via the ICD-U64. Then prove the ICD-U64 will program any other chip with the telco cable you are using. If not look at the usb setup in device manager ( assuming windows OS)
Then next you need to confirm that the ID for the chip is being read correct. If it isn't it is either you have code for a different chip or the wiring is wrong. Now for the wires the diagnostics will show you the voltage on the target and Vpp Vdd Vss PGC PGD. It's rare wiring that worked fails but nevertheless a cold solder joint can stop conducting. The diagnostic will allow you to toggle the PGC PGD and MCLR to see the swing with a volt meter. Check the oscillator with the diagnostic also. Yes, there is a limit to the length approx 10 in for the RJll telco cable ( just in case you made up a new longer cable). Make sure the telco snap in thingy's are on the same side of the cable. The ICD-U64 is robust and your targets worked before. Maybe it is a power to the target issue or a telco cable issue or a USB PC issue.
armondo58



Joined: 15 Jun 2011
Posts: 16

View user's profile Send private message

PostPosted: Sat Nov 05, 2011 5:41 am     Reply with quote

I tried to download with 4.124 and 4.119 of compliers. The boards are all functioning correctly. I have downloaded firmware to them 100's of times. On the last download it failed.. I suspect the eeprom protect bit got set and now i cant clear it. I am running the pic at 3 volts. Will increasing to 5 allow bulk erase?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Nov 05, 2011 10:37 am     Reply with quote

There are several posts in the forum archives about getting Verification Errors while programming with CCS tools (ICD). There are also several
posts about being unable to re-program a PIC, if the protection bits were
set, and the PIC is running at 3.3v. Those threads offer some solutions.
I don't know if these are two separate problems or if they are inter-related.

But, you said you suspect a problem with the Config bits (fuses). Can
you use CCSload to read the PIC ? According to the 16F88x Programming
Guide, you should be able to read the Config bits (fuses) even if the PIC
is Code Protected. If you can read the Config word, do so, and post it.
Then we can look at the PIC data sheet and see what the settings are in
your PIC.
armondo58



Joined: 15 Jun 2011
Posts: 16

View user's profile Send private message

Fixed?
PostPosted: Sun Nov 06, 2011 3:39 pm     Reply with quote

I dont know what happened to fuses, But when I ran from 5 volts, I was able to erase and program chip, with original program that stopped it from working in first place...Just a quirk of chip I guess.. Solution, If having problems and running under 5 volts, APPLY 5 VOLTS and erase.

Thanks for all the interest and responses..
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