![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
T0ni0
Joined: 21 Jan 2005 Posts: 11
|
Code Protect Block |
Posted: Fri Jul 08, 2005 6:06 am |
|
|
Hi,
I need protect code of my aplication, but i use half flash memory for data.
How i can Protect Block Boot, Data EEprom & Blocks 0,1,2,3 the rest block i need not protect (4,5,6,7)
In config Word i need write
_CONFIG5L B'11110000'
_CONFIG5H B'00000000'
How i can make this with CCS? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jul 08, 2005 10:40 am |
|
|
It may be possible, but you need to tell us what PIC you're using. |
|
![](templates/subSilver/images/spacer.gif) |
T0ni0
Joined: 21 Jan 2005 Posts: 11
|
|
Posted: Mon Jul 11, 2005 12:28 am |
|
|
I use PIC 18F6720 and i can portect Boot Block And others Block, but i dont know how i can protect any Blocks with CCS. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jul 11, 2005 1:23 am |
|
|
I don't have the latest version of PCH. I have 3.188.
In my version, if look near the start of the 18F6720.H file, it lists
fuse settings that can protect the Boot Block and the Data EEprom.
These are:
CPB = protect Boot Block
CPD = protect Data EEprom
However, for Code Protection, it only lists the PROTECT setting,
which protects all the ROM. It doesn't have settings for CP0 to CP7, as
shown in the data sheet, which allow protection of smaller parts of ROM.
What version of PCH do you have ? If you have a newer version
than mine, does the 18F6720.H file show any settings such as CP0,
or PROTECT_0, or PROTECT_12%, etc. ? Or does it only have PROTECT ?
If someone else has the latest version of PCH, maybe they can look at
the 18F6720.H file and see if CCS has added those settings.
If your version doesn't have fuse settings for blocks CP0-CP7, and
if you have the PCWH compiler, then you could use the Device Editor
to add those fuse settings. |
|
![](templates/subSilver/images/spacer.gif) |
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Mon Jul 11, 2005 10:13 am |
|
|
Code: | //////// Standard Header file for the PIC18F6720 device ////////////////
#device PIC18F6720
#nolist
//////// Program memory: 0x16 Data RAM: 3840 Stack: 31
//////// I/O: 39 Analog Pins: 12
//////// Data EEPROM: 1024
//////// C Scratch area: 00 ID Location: 2000
//////// Fuses: LP,XT,HS,RC,EC,EC_IO,H4,RC_IO,PROTECT,NOPROTECT,OSCSEN
//////// Fuses: NOOSCSEN,NOBROWNOUT,BROWNOUT,WDT1,WDT2,WDT4,WDT8,WDT16,WDT32
//////// Fuses: WDT64,WDT128,WDT,NOWDT,BORV25,BORV27,BORV42,BORV45,PUT,NOPUT
//////// Fuses: CPD,NOCPD,NOSTVREN,STVREN,NODEBUG,DEBUG,NOLVP,LVP,WRT,NOWRT
//////// Fuses: CPB,NOCPB,EBTRB,NOEBTRB,EBTR,NOEBTR,CCP2E7,CCP2C1,WRTD
//////// Fuses: NOWRTD,WRTC,NOWRTC,WRTB,NOWRTB
////////
////////////////////////////////////////////////////////////////// I/O
// Discrete I/O Functions: SET_TRIS_x(), OUTPUT_x(), INPUT_x(),
// PORT_B_PULLUPS(), INPUT(),
// OUTPUT_LOW(), OUTPUT_HIGH(),
// OUTPUT_FLOAT(), OUTPUT_BIT()
// Constants used to identify pins in the above are: |
|
|
![](templates/subSilver/images/spacer.gif) |
T0ni0
Joined: 21 Jan 2005 Posts: 11
|
|
Posted: Wed Jul 13, 2005 3:27 am |
|
|
PCM programmer wrote: |
What version of PCH do you have ? If you have a newer version
than mine, does the 18F6720.H file show any settings such as CP0,
or PROTECT_0, or PROTECT_12%, etc. ? Or does it only have PROTECT ?
If someone else has the latest version of PCH, maybe they can look at
the 18F6720.H file and see if CCS has added those settings.
If your version doesn't have fuse settings for blocks CP0-CP7, and
if you have the PCWH compiler, then you could use the Device Editor
to add those fuse settings. |
Device Editor?
PCH 3.227
//////// Standard Header file for the PIC18F6720 device ////////////////
#device PIC18F6720
#nolist
//////// Program memory: 0x16 Data RAM: 3840 Stack: 31
//////// I/O: 39 Analog Pins: 12
//////// Data EEPROM: 1024
//////// C Scratch area: 00 ID Location: 2000
//////// Fuses: LP,XT,HS,RC,EC,EC_IO,H4,RC_IO,PROTECT,NOPROTECT,OSCSEN
//////// Fuses: NOOSCSEN,NOBROWNOUT,BROWNOUT,WDT1,WDT2,WDT4,WDT8,WDT16,WDT32
//////// Fuses: WDT64,WDT128,WDT,NOWDT,BORV25,BORV27,BORV42,BORV45,PUT,NOPUT
//////// Fuses: CPD,NOCPD,NOSTVREN,STVREN,NODEBUG,DEBUG,NOLVP,LVP,WRT,NOWRT
//////// Fuses: CPB,NOCPB,EBTRB,NOEBTRB,EBTR,NOEBTR,CCP2E7,CCP2C1,WRTD
//////// Fuses: NOWRTD,WRTC,NOWRTC,WRTB,NOWRTB
////////
////////////////////////////////////////////////////////////////// I/O
// Discrete I/O Functions: SET_TRIS_x(), OUTPUT_x(), INPUT_x(),
// PORT_B_PULLUPS(), INPUT(),
// OUTPUT_LOW(), OUTPUT_HIGH(),
// OUTPUT_FLOAT(), OUTPUT_BIT()
// Constants used to identify pins in the above are: |
|
![](templates/subSilver/images/spacer.gif) |
T0ni0
Joined: 21 Jan 2005 Posts: 11
|
|
Posted: Wed Jul 13, 2005 8:31 am |
|
|
I use MPLAB, can i write any config word value with CCS ?
I like make config word in code, not in a IDE ![Mad](images/smiles/icon_mad.gif) |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jul 13, 2005 11:33 am |
|
|
Quote: | I use MPLAB, can i write any config word value with CCS ?
I like make config word in code, not in a IDE |
I suggest that you email CCS and ask them to add support for
the Config bits in the Config 5L register, which are CP0-CP7.
Tell them that currently, they only support PROTECT and NOPROTECT,
and you would like support for the CP0-CP7 bits in the 18F6720.
Give them a link to this thread.
The email address for CCS tech support is on this page:
http://www.ccsinfo.com/techsupport.shtml |
|
![](templates/subSilver/images/spacer.gif) |
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
5 years later - still no support? |
Posted: Thu Apr 24, 2008 2:12 pm |
|
|
I'm amazed that 5 years after this thread was last active, there still does not appear to be support for individual protect fuses in PIC18 parts. I'm using the PIC18F4431, and need CP0 without CP1/2/3.
I've sent a request to CCS.
Now I'll look at adding fuses myself... a time-waster I would have preferred to avoid. :(
Jim |
|
![](templates/subSilver/images/spacer.gif) |
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
Ok... 3 years. But still!!! |
Posted: Thu Apr 24, 2008 2:13 pm |
|
|
Ok... 3 years. But still!!! |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Apr 24, 2008 2:19 pm |
|
|
This is in the current CCS manual, in the #fuses section:
Quote: |
Some processors allow different levels for certain fuses. To access
these levels, assign a value to the fuse. For example, on the 18F452, the
fuse PROTECT=6 would place the value 6 into CONFIG5L, protecting code
blocks 0 and 3. |
|
|
![](templates/subSilver/images/spacer.gif) |
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
Thanks! |
Posted: Thu Apr 24, 2008 2:44 pm |
|
|
Thanks!
Now I will suggest to CCS that they add a FUSES section to the Functional Overviews in the manual. Much has changed and been added over the years, and today's implementation is (for me, anyway) not quite intuitive.
BTW... thinking I needed to add fuse definitions, I tried using the Device Editor. Didn't go well... my changes did not save reliably, sometimes coming back with the settings there but no name. Saving to a different filename (i.e. device name) made no different -- my impression is the editor is flaky.
Jim |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|