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

Could not write eeprom missing fuses?

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



Joined: 24 Jan 2018
Posts: 5

View user's profile Send private message

Could not write eeprom missing fuses?
PostPosted: Sat Dec 07, 2019 4:03 am     Reply with quote

Hello,
I tried writing eeprom of pic24f16km202 using pcwhd software. Altough I can add write_eeprom functions to my code without any errors, it does't write. Then i thought adding #fuses Nocpd and nowrtd but the compiler gives errors which says Unknown keyword in #fuses "nocpd" exc. How can overcome this problem?
temtronic



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

View user's profile Send private message

PostPosted: Sat Dec 07, 2019 6:11 am     Reply with quote

OK, I don't use that PIC but..

Keywords are specific to whatever PIC you're using. Have a look in the PICtype.h file ( the pic header file) and see what's available.
Also read the PIC datasheet as sometimes CCS might miss a fuse, or get the bits wrong(rare..but 'bug' happen)

Also, depending on what device acually burns the PIC, fuses may not be as you set them. Programming in 'debug' mode definitely changes them !!
Jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19231

View user's profile Send private message

PostPosted: Sat Dec 07, 2019 7:55 am     Reply with quote

That chip doesn't have a CPD fuse.
However what it does have is the EEPROM has permanent protection built
in. The code has to perform an unlock sequence (like for a program memory
write), before it can be written.
Question. What compiler version?.
The current compiler does perform this unlock.
I then went back several versions and all are performing the unlock.
So what version are you using?.
iiibbo



Joined: 24 Jan 2018
Posts: 5

View user's profile Send private message

PostPosted: Sun Dec 08, 2019 8:24 am     Reply with quote

These fuses don't take place in the pic header file. Is there any way to add new fuses to this header?

temtronic wrote:
OK, I don't use that PIC but..

Keywords are specific to whatever PIC you're using. Have a look in the PICtype.h file ( the pic header file) and see what's available.
Also read the PIC datasheet as sometimes CCS might miss a fuse, or get the bits wrong(rare..but 'bug' happen)

Also, depending on what device acually burns the PIC, fuses may not be as you set them. Programming in 'debug' mode definitely changes them !!
Jay
iiibbo



Joined: 24 Jan 2018
Posts: 5

View user's profile Send private message

PostPosted: Sun Dec 08, 2019 8:36 am     Reply with quote

I can't use NOCPD and NOWRTD fuses. Compiler is 5.007 pcwhd. Can you explain more about unlock sequence. I found a solution. I wrote eeprom using #rom.


Ttelmah wrote:
That chip doesn't have a CPD fuse.
However what it does have is the EEPROM has permanent protection built
in. The code has to perform an unlock sequence (like for a program memory
write), before it can be written.
Question. What compiler version?.
The current compiler does perform this unlock.
I then went back several versions and all are performing the unlock.
So what version are you using?.
Ttelmah



Joined: 11 Mar 2010
Posts: 19231

View user's profile Send private message

PostPosted: Sun Dec 08, 2019 8:36 am     Reply with quote

There is _not_ a CPD fuse on that chip.
Read what I posted. What compiler version?.
Ttelmah



Joined: 11 Mar 2010
Posts: 19231

View user's profile Send private message

PostPosted: Sun Dec 08, 2019 8:52 am     Reply with quote

I see you posted this while I was typing.
Ouch.
5.007 was a Beta compiler at best. It is several versions before V5 became
usable.
I'm not surprised it does not work. Honestly at this time you were much
better off using 4.141, which was the last V4 compiler and worked quite
well. The first version of V5 that I have kept as a reasonably working
compiler was 5.013. Before this I didn't consider the versions to work well
enough to keep. So I can't test if your version does do the unlock.
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