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 CCS Technical Support

program corruption due to low voltage?

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



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

program corruption due to low voltage?
PostPosted: Mon Mar 11, 2019 9:10 am     Reply with quote

Hi! is there a way that the code on a pic 16F1847 gets corrupted due to low voltage?

The thing is that we developed a board that has this pic and operates from 2 AAA batterys, some of the devices, after complete discharge of the cells, doesnt work anymore with new batterys. But if we flash the firmware again, they start working again....

fuses:

#fuses INTRC_IO,NOPROTECT, PUT, NOMCLR, WDT_SW, BROWNOUT, NOLVP, PLL_SW, FCMEN
Ttelmah



Joined: 11 Mar 2010
Posts: 19569

View user's profile Send private message

PostPosted: Mon Mar 11, 2019 9:26 am     Reply with quote

Basically, no.
However one 'caveat'. If your code is using any write to the program memory
and this is attempted with a supply less than Vddmin (1.8v), then this can
result in corruption of the flash.
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Mar 11, 2019 9:39 am     Reply with quote

Thanks for your answer Ttelmah, but, no write to program memory on my code. Any other hint?
gaugeguy



Joined: 05 Apr 2011
Posts: 304

View user's profile Send private message

PostPosted: Mon Mar 11, 2019 10:00 am     Reply with quote

What is your brownout voltage set to?
What frequency are you running the processor at?
Have you verified that the brownout reset is working correctly?
Ttelmah



Joined: 11 Mar 2010
Posts: 19569

View user's profile Send private message

PostPosted: Mon Mar 11, 2019 12:35 pm     Reply with quote

Without knowing how your reset is generated, it is possible that the
chip wasn't actually corrupted, just not being properly reset.
Programming operates the MCLR line, so will force a chip reset.

Gaugeguy's comment about brownout could definitely apply. Though
you have BROWNOUT selected, what is the default voltage for this?.
Jerson



Joined: 31 Jul 2009
Posts: 126
Location: Bombay, India

View user's profile Send private message Visit poster's website

PostPosted: Mon Mar 11, 2019 9:27 pm     Reply with quote

I would add to Ttelmah's comment and check for any writes to internal eeprom as well. At voltages outside the manufacturer specified operating limits, what is meant to do an eeprom write could as well be writing your program space.
_________________
Regards
Jerson Fernandes
Ttelmah



Joined: 11 Mar 2010
Posts: 19569

View user's profile Send private message

PostPosted: Tue Mar 12, 2019 2:16 am     Reply with quote

A good point.
The EEPROM write could also give the same problem. Any write to ROM
is potentially a problem if attempted when the supply voltage is too
low. The code really needs to implement testing to verify the supply
is in an acceptable range for any such write. This is not hard to do, just
read the voltage from the FVR (set to 1.024v), using channel 31 of
the ADC, and the supply as the ADC reference. If this reads above about 580
then the supply is too low to support such writes.
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