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

Unable to program configuration word using ICSP

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



Joined: 08 Sep 2003
Posts: 492
Location: India

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

Unable to program configuration word using ICSP
PostPosted: Sun Jun 04, 2006 3:16 am     Reply with quote

Hi,

MCU: 16F628
Compiler: PCM

I am able to succesfully program the Program memory, but I am unable to program the Configuration word.

The sequence of programming is as follows

1. Load Config command
2. Increment address 7 times
3. Load Config word
4. Begin Erase/programming cycle.

Please advise.....

thanks
arunb
Ttelmah
Guest







PostPosted: Sun Jun 04, 2006 4:12 am     Reply with quote

What voltage are you using.
The configuration memory, is special. It can _only_ be erased, using a 'full chip' erase, and high voltage prgramming. You cannot erase the config memory as a normal 'page', and you cannot erase it using LVP. Bits can be set as normal.
The reason for this, is to prevent people being able to bypass the code protection, by erasing just the config memory.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Sun Jun 04, 2006 5:04 am     Reply with quote

Hi,

Thanks for the reply.

I am using 13 volts on MCLR to erase the Program Memory (Bulk Erase Setup 1, Bulk Erase Setup 2 sequence and Bulk Erase program memory), using the 6 bit commands.

Although the program memory gets written, I am unable to write to the configuration memory..

Just for curiousity ...

The Load Data command for program memory is used before sending a Program Memory word, this is followed by Begin Erase?program cycle command.

The configuration word is sent as follows

1. Load configuration command
2. Increment command 7 times
3. Send the configuration word LSB first...
4. Begin Erase/program cycle command

Shouldn't there be a command between 2 and 3 just before the configuration word is sent ???

kindly advise.....

thanks
arun
Ttelmah
Guest







PostPosted: Sun Jun 04, 2006 3:06 pm     Reply with quote

I am slightly puzzled by your references to 'erase' cycles, after the program cycles.
There are two different cycles available. A 'program/erase', and a 'program only'. For the configuration memory, you must use a bulk erase, followed by the data load, and then the 'program only' cycle. I suspect this is where your problem lies.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Sun Jun 04, 2006 10:04 pm     Reply with quote

Hi,

I use the following steps

1. Load config command
2. advance PC 7 times
3. Load configuration word
4. Perform the Program only command for program memory

These steps still do not program the config memory

thanks
arunb
Ttelmah
Guest







Re: RE:
PostPosted: Mon Jun 05, 2006 2:26 am     Reply with quote

arunb wrote:
Hi,

I use the following steps

1. Load config command
2. advance PC 7 times
3. Load configuration word
4. Perform the Program only command for program memory

These steps still do not program the config memory

thanks
arunb

The flow appears right, but you have substituted different 'names' for parts of the cycles, and one may be causing the problem. The sequence should be:

Load configuration data
Advance PC 7 times
_Execute a load program data command_.
Perform program only command.

Note that you _do not use_ the 'load configuration data command for the data sent to the config word. The 'load configuration data' command, sets the address to the first byte of the config memory, and is only used to select the memory, with the first command. After this the other bytes are written using normal 'load data' commands. If you use a 'load configuration data' command, the byte will be put into the first location in config memory.
I suspect this is what is causing your problem.

Best Wishes
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

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

RE:
PostPosted: Mon Jun 05, 2006 6:44 am     Reply with quote

Hi,

Iam sorry but I am confused.. It might be better Idea if you could give the command in bits instead of names..

Load configuration: 000000
Load Data for program memory: XX0010
Increment Address: xx0110
Begin Program only: 011000


thanks
arunb
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