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

scrambled internal eeprom
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MagnumScar
Guest







scrambled internal eeprom
PostPosted: Mon Dec 17, 2007 1:28 pm     Reply with quote

Hi all,

I have the following somewhat strange problem on a circut, using an 18F4580 and a CCS PCH c-kompiler.

The circut consists of a DC/DC konverter(24-5V) and the mcu + LED's, caps, resistors etc.

It works fine most of the time exept for one condition. If we turn power off and then turn power back on very quickly, before the supply is drained down to 0 completly(residual charge on the supply caps i would gues), there is about a 10% chance that the internal eeprom gets scrambled.

Ive looked around forums and it apears im not the only one with this problem. The things that bugs me is that i dont usualy write to the eeprom, just read. I write to the eeprom only when recieving certain CAN-bus messages, wich i dont during these tests.

I have a prototype of this circut in wich this problem doesnt happen. On the prototype tho, i use a 7805 regulator rather then the dc/dc.

Also i have both power up timer and brown out detection enabled.



Any ideas? This strangenes has me alitle worried. Scrambling an eeprom like this i thought should not happen...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 17, 2007 1:34 pm     Reply with quote

Disconnect all external circuits from the PIC. Also disconnect power
from all the external circuits. Then test if the problem still happens.
This will tell you if the problem is in the PIC (and MCLR circuit, etc),
or if it is caused by the DC-DC converter circuit.
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Mon Dec 17, 2007 1:55 pm     Reply with quote

Id try that but the circut is already built, using SMD components no less...

On the prototype im running basically only the processor but with a 7805 regulator instead of the dc/Dc. That seems to work fine
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 17, 2007 2:01 pm     Reply with quote

OK. I misunderstood your original post. I thought your PIC was
controlling a DC-DC converter. Actually, the DC-DC converter is
the power supply for the board.

What are the external circuits that the PIC is controlling ?

Also, do you have 100 nF (0.1 uF) capacitors on the PIC's Vdd pins ?
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Mon Dec 17, 2007 2:06 pm     Reply with quote

Actualy the mcu is only connected to an adum1250 i2c isolator. on the other side of the isolator there is a MAX5842 DAC, an ADS7828 ASC and an IO extender MAX7323. The DAC outputs are amplidifed thru an LM224D op-amp.

The i2c isolator is obviusly powered from both sides. THe problem seems to be the same regardles if i power the "chip" side of the isolator. the "mcus side" is powered from the same 5 V as the mcu(obviusly).

AS mentioned the problem only happens if we turn power of and then oon again very quickly, wich makes me to belive there is somthing about the reseting that scrambles my eeprom.

Any more idea?

Thanx for the help btw Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 17, 2007 2:11 pm     Reply with quote

Look at the Vdd pin on the PIC when you cycle the power. If possible,
catch the waveform with a storage scope. Then do the same thing with
a linear regulator (instead of a DC-DC converter) running the board.
Look for a glitch on the Vdd voltage.
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Mon Dec 17, 2007 2:33 pm     Reply with quote

Thnx, ill check that, altho it seems obvious to me that there is something going on with the Vpp here. The processor does reset itself more or less, altho it seems not properly (thus the scrambling of the eeprom)
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Mon Dec 17, 2007 3:43 pm     Reply with quote

How exactly do i turn on the brownout detction?

Im worried i didnt turn it on properly.

i have set the fuses to:

#fuses BROWNOUT, BROV46

not done anything else... this should do the trick yes?
gjs_rsdi



Joined: 06 Feb 2006
Posts: 468
Location: Bali

View user's profile Send private message Send e-mail

two fuses
PostPosted: Mon Dec 17, 2007 4:41 pm     Reply with quote

#FUSES BROWNOUT //Reset when brownout detected
#FUSES BORV46 //Brownout reset at 4.6V
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Mon Dec 17, 2007 4:47 pm     Reply with quote

So i got my fuses set correctly then.

Cheers
gjs_rsdi



Joined: 06 Feb 2006
Posts: 468
Location: Bali

View user's profile Send private message Send e-mail

fuses
PostPosted: Mon Dec 17, 2007 7:22 pm     Reply with quote

yes
I have built a proto board with DC/DC. have ripples specially at startup, the 7805 don't.
I solve the problem by connecting a 4.8v nicad battery in parallel
I had some problems with the oscilator(didn't check the internal EEPROM)
Try a 10uF capacitor and 10k resistor on the reset pin. It solved my problem in an other project.
powerup timer (#FUSES PUT //Power Up Timer 18F252) helped me also.
joseph
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Tue Dec 18, 2007 1:34 am     Reply with quote

Thx for the tip. Ill check that

I did enable the PUT and it seems to have helped a bit but not 100% ok.
Ill have a look at the dc/dc and see if that is the reason for this trouble.

Thx again
Ttelmah
Guest







PostPosted: Tue Dec 18, 2007 4:18 am     Reply with quote

The other question, is what is connected to MCLR?. Also have you got LVP enabled. If the answer to the latter is 'yes', then great care is needed to with the layout round RB6, and RB7. The MCLR pin, especially if used as a digital connection, should have an external diode attached, when it is not used for programming, to clamp any possible transient spikes, since this is not present internally, and signals above the supply rail on this, can trigger programming behaviour...

Best Wishes
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Dec 18, 2007 9:14 am     Reply with quote

You might want to consider a CPU supervisor attached to the MCLR pin.
MagnumScar
Guest







internal eeprom scrambled
PostPosted: Wed Dec 19, 2007 8:05 am     Reply with quote

A voltage supervisor external circuit would be good, but i need something that can handle the ICSP interface applying 13,5 Volt to my MCLR pin.

Any idea of a external reset circuit that can do that? Ive tried reading microchips app note TB087 but it doesn't make any sense to me, especially the way in figure 3 the Rup is connected to Vdd/Vpp ... how does that work?

Any insight would be much appreciated
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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