View previous topic :: View next topic |
Author |
Message |
iiibbo
Joined: 24 Jan 2018 Posts: 5
|
Could not write eeprom missing fuses? |
Posted: Sat Dec 07, 2019 4:03 am |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Sat Dec 07, 2019 6:11 am |
|
|
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: 19510
|
|
Posted: Sat Dec 07, 2019 7:55 am |
|
|
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
|
|
Posted: Sun Dec 08, 2019 8:24 am |
|
|
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
|
|
Posted: Sun Dec 08, 2019 8:36 am |
|
|
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: 19510
|
|
Posted: Sun Dec 08, 2019 8:36 am |
|
|
There is _not_ a CPD fuse on that chip.
Read what I posted. What compiler version?. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19510
|
|
Posted: Sun Dec 08, 2019 8:52 am |
|
|
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. |
|
|
|