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

Brown-out fuses on PIC18F8722

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



Joined: 18 Apr 2012
Posts: 10

View user's profile Send private message

Brown-out fuses on PIC18F8722
PostPosted: Wed Apr 18, 2012 4:33 am     Reply with quote

Good Morning,

I have encountered an issue when compiling code for the PIC18F8722 with the fuse BORV42 set.

The version 4.122 compiler gives an error "Unknown Keyword" for the fuse. The code was previously compiled correctly under version 4.101. The code also compiles correctly if the fuse BORV45 is used.

the header for the device lists the following fuses as supported (amongst others):
//////// Fuses: WDT128,WDT,NOWDT,TO,BORV27,BORV42,BORV45,PUT,NOPUT,CPD,NOCPD

Whilst investigating this issue, I have discovered that there is an issue with using the brown-out detection specified by BORV42 on PIC18F7822 processors running at full speed (40MHz). This may be related, but does not explain why the fuse is not valid - it should be.

Does anyone have an explanation for this error?


I am using CCS compiler version 4.122 and
Ttelmah



Joined: 11 Mar 2010
Posts: 19365

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 4:53 am     Reply with quote

Do you have the IDE?.
They appear to have left out a few fuses at various times on various chips. This one is missing on the 4550 as well. With the IDE, you can simply add them using the device editor. I suspect the .h file list was last rebuilt on an earlier compiler version that had the fuse....
If you don't have the IDE, moan to CCS, they should give you a fixed .dat file in only a few hours. Tell them anyway, since then it'll get fixed on future versions.
I have had significant brownout problems on a number of recent chips. Had to return over 5000 18F4550's, where BORV45, was having chips reset at 4.9v!. Have seen similar extreme values on two other chips as well. Microchip seem to be totally 'aware' of this, so your BORV42 problem may be something similar.....

Best Wishes
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Wed Apr 18, 2012 6:38 am     Reply with quote

It's not a valid fuse for that particular chip. I just checked the data sheet and you have four choices:

From, page 380 of the datasheet, here are the typical brownout voltages for each fuse setting.
Code:

BORV<1:0> = 11      2.05 V      PIC18LF6627/6722/8627/8722
BORV<1:0> = 11      2.11 V      PIC18LF6527/6622/8527/8622
BORV<1:0> = 10      2.79 V      PIC18LF6X27/6X22/8X27/8X22
BORV<1:0> = 01      4.33 V      All devices
BORV<1:0> = 00      4.59 V      All devices


A voltage of 4.2 isn't one of the choices ( though it does fall between the minimum and typical of setting BORV<1:0> = 01 )

What probably happened was someone put BORV42 instead of BORV43 by mistake and they just got around to fixing it around 4.122. Check your valid fuses for that chip. I bet you will have BORV45, BORV43, BORV27, and BORV20 available, which cover all of your options.
Gavin_Minion



Joined: 18 Apr 2012
Posts: 10

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 4:42 am     Reply with quote

Good Morning Jeremiah,
You are quite correct that it should not be a valid fuse. However, I did try BORV43 and it gave the same error.
(I also tried BORV40,BORV41 and BORV44 too!)

Thanks Ttelmah for the information, I have checked and found that the only fuses present in the IDE are BORV20, BORV27 and BORV45.

Now I just have to decide whether to implement BORV43 (and risk the device becoming unstable before a brown_out reset if the voltage drops to 4.11v) or use BORV45 (and risk the device resetting at 4.82v, which is quite possible with the regulators specified for the board)

Decisions, decisions...
Ttelmah



Joined: 11 Mar 2010
Posts: 19365

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 5:23 am     Reply with quote

Remember you can also change the reset voltage, by just adding a #ROM statement to set this one fuse word. This then is a one second removal job when CCS get it right....
Just 'FYI', this particular voltage is listed as '4.2v', in MPLAB, not 4.3v. The values are very nominal, and I presume the 4.2v 'name' was selected for compatibility...
So just add (for example):
Code:

#ROM int8 0x300002={0x0E}
//BORV4.2 PUT enabled, Brownout enabled in hardware


Best Wishes
jeremiah



Joined: 20 Jul 2010
Posts: 1328

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 6:42 am     Reply with quote

Gavin,

The CCS IDE has a tool that tells you all the valid fuses it knows for a particular part (I believe it is called "Valid Fuses"). Did you check that to see what it thinks the fuses should be named?
Ttelmah



Joined: 11 Mar 2010
Posts: 19365

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 7:56 am     Reply with quote

jeremiah wrote:
Gavin,

The CCS IDE has a tool that tells you all the valid fuses it knows for a particular part (I believe it is called "Valid Fuses"). Did you check that to see what it thinks the fuses should be named?


This is the same data available from the device editor. He says:

"I have checked and found that the only fuses present in the IDE are BORV20, BORV27 and BORV45. ".

CCS have at times lost this fuse on several chips. Must be something 'odd' in the program they use to set this up (some sort of database I'd hope).

Best Wishes


Last edited by Ttelmah on Fri Apr 20, 2012 9:01 am; edited 1 time in total
Gavin_Minion



Joined: 18 Apr 2012
Posts: 10

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 8:57 am     Reply with quote

Thanks again Ttelmah,

I decicded to add the fuse BORV42 to the IDE to retain compatibility with the stored header and with earlier versions of the code (better than launching a change procedure for the code just to get the fuse changed!)

On balance, I think it is safer to retain the BORV42 setting and hope that the brown_out reset occurs before the processor becomes unstable (which is an unlikely situation) rather than going to BORV45 and risking the brown_out occuring at 4.8v (which is much more likely).

In the long run, I will solve the problem by reducing the processor speed in the hardware design. At 30MHz, the processor will be stable at all (running) voltages with the BORV42 setting.

Many thanks everyone for your assistance.
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