Power Up not running, Reset needs to be held low

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, ok first I cant imagine why lots of other people dont have this problem, maybe its just my bad circuit design. :?

I could only find one other post of someone who couldnt get his micro to run after power up.
Heres his post, but he never really found a solution:
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=78119&highlight=power

And on a side note how does one do an exact forum search (if possible?), like in google you would type "power up"?

Ok if you see my schematic its nothing special, a small 5V SMPS, then a low drop out 3.3V regulator. My circuit has quite a few filters as per the suggestion of the app notes. Then the 3.3V is feed through a filter right next to the AVR (ATmega8515L, running at 3.6864MHz) to its Vcc. If I check the AVR Vcc at turn on it seems pretty instant visually speaking on my multimeter. I cant tell you in ns!!

What happens is the micro doesnt run when you power up. After alot of probing around, and wrong turns into dead avenues (enabled brown out detection 2.7V, enabled CKOPT, played with every SUTCK_SEL option, using the longest start up option).

The only issue I could see, was the small filter that powers the micro would delay the power supply rise longer than the reset. So I thought I will power the Reset from the AVR Vcc rather than the +3.3V line. I cut the track and resoldered it, no improvement.
Even when I connect Reset to VCC, it doesnt generate the "power on reset", which the datasheet says it will.

On the reset circuit, if C12 is your good old 100nF it doesnt work. The only way I could get the micro to run after a power up reset was too stick a ridiculously sized cap there. Anything less than 100uF was not consistant, so I'm using 150uF.

I think just throwing this large cap at it is just masking the problem. I dont like to do band aid fixes. Can anyone see anything I am possibly doing wrong? Are there other setting I should try?
Thanks for any advice!

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to enable the brownout reset (BODEN-fuse).
And for a crystal the longest reset time must be selected.
A crystal may need up to 50ms to oscillate stable.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni wrote:
You need to enable the brownout reset (BODEN-fuse).
And for a crystal the longest reset time must be selected.
A crystal may need up to 50ms to oscillate stable.

Peter


Hi Peter, thank you for your reply. Ok I should of stated along with setting BOD to 2.7V, I also enabled it. I have also set the crystal osciallator to 16CK + 64ms, but it still didnt help.

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Seems to me like the Voltage is rising extremely slow.
It should be even visible on a multimeter.
(RC constant on reset pin is 1.5 sec.)
I would try to feed the mproc from 3V battery.
If good, then the fault is in power supply.
Then I would bypass the voltage convertor and try only with V-regulator.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Visovian wrote:
Seems to me like the Voltage is rising extremely slow.
It should be even visible on a multimeter.
(RC constant on reset pin is 1.5 sec.)
I would try to feed the mproc from 3V battery.
If good, then the fault is in power supply.
Then I would bypass the voltage convertor and try only with V-regulator.

Thanks for the reply.
Yes that is exactly it. I have lots of filters that cause the power supply to rise quite slowly. But not anything super out of the ordinanry???
The reason for all the filters is surge protection, there are alot of power spikes here, up way into KV.

If I power it with a fast switching supply, it runs. But my problems is, it is on a fabricated board, finished and everything. I didnt expect the AVRs not to be able to run with a slightly slow rising power supply. I thought surely there is something one can do? If the big ass cap is something, and the only something, then so be it!

The only thing I dont like about the big cap solution, is, if the power goes off, then back on again quickly, the big cap doesnt time to discharge, and then the micro just hangs. But at least that situation is less likely then turning the power on!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What does the 3.3 volt regulator output do during power up, especially before the regulator input reaches 4.3 to 4.45 volts (Vcc + drop out)? The ST regulator data sheet doesn't characterize the below drop out behavior. Since a fast rising 5 volt supply works, this below drop out voltage from the 5 volt regulator period is where I would expect the AVR reset trouble to be.

Maybe if you dropped C6 back to 10 uf (as per the regulator data sheet), it might help the 3.3 volt come up just a little faster? But if this has any real effect depends on exactly what is happening below the drop out level.

You only have a typical .7 to minimum .55 volt overhead before 3.3 volt drop out with a 5 volt source, so I doubt you could come up with anything simple to hold back the regulator input voltage until after the 5 volt supply is up to a decent level. You might have designed and built yourself into a corner, making the big ass cap all you have left?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

150µF on the reset line? Are you serious?

Stealing Proteus doesn't make you an engineer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You also have some ridiculous amount of capacitance after the LDO.

I just think power turns on too slowly. You should use external voltage monitoring chip maybe.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike B wrote:
What does the 3.3 volt regulator output do during power up, especially before the regulator input reaches 4.3 to 4.45 volts (Vcc + drop out)? The ST regulator data sheet doesn't characterize the below drop out behavior. Since a fast rising 5 volt supply works, this below drop out voltage from the 5 volt regulator period is where I would expect the AVR reset trouble to be.

Maybe if you dropped C6 back to 10 uf (as per the regulator data sheet), it might help the 3.3 volt come up just a little faster? But if this has any real effect depends on exactly what is happening below the drop out level.

You only have a typical .7 to minimum .55 volt overhead before 3.3 volt drop out with a 5 volt source, so I doubt you could come up with anything simple to hold back the regulator input voltage until after the 5 volt supply is up to a decent level. You might have designed and built yourself into a corner, making the big ass cap all you have left?

Yes Mike B I think you on the right track!!!
C6 has been drop kicked to the curb. And now it turns on 1 out of 3 times! Progress!!! Yay!

There are two little modules powered off the 3.3V regulator, the AVR and a wireless module, each with 47uF caps near their supply. So I had C6 (100uF) + 47uF + 47uF = almost 200uF. Im going to replace those two 47uF caps with 100nF, and change C2 to 10uF now. Lets see...

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ArnoldB wrote:
150µF on the reset line? Are you serious?

lol seriaas!
Desperate times call for desperate measures :oops:

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael wrote:
You also have some ridiculous amount of capacitance after the LDO.

I just think power turns on too slowly. You should use external voltage monitoring chip maybe.

Yes I see what you mean, good points. Unfortunately this board is half way out the door already, but I will redesign it and look into external voltage chips, and trim the unneccessary capacitance. Thanks guy!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shouldn't the 5 volt regulator handle your KV spikes itself? Maybe your C8, C9, L4 filter isn't really needed at all since its source is the already processed and filtered 5 volt regulator.

You might put C9 at the 3.3 volt regulator output (in parallel with C6) because the switcher ripple might be higher frequency than this LDO usually deals with (a 100 nf has much lower inductance than a 10 uf polarized cap).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the inductors and capacitors for filtering the spikes would do better before the 5V regulator. (except of course, the ones required by the switcher itself.)

If you have large transients on your input, add a TVS to absorb them. But you do this BEFORE your supply, not after.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike B wrote:
Shouldn't the 5 volt regulator handle your KV spikes itself? Maybe your C8, C9, L4 filter isn't really needed at all since its source is the already processed and filtered 5 volt regulator.

Yes you right, I didnt think of that! I just thought the more capacitance the merryier. I couldnt think of a down side to that, but the microcontroller not starting is quite a biggy.

Quote:
You might put C9 at the 3.3 volt regulator output (in parallel with C6) because the switcher ripple might be higher frequency than this LDO usually deals with (a 100 nf has much lower inductance than a 10 uf polarized cap).

Yes I think thats a much better practise in future. I shall do that. I was just trying to follow that application note AVR042 (see attached).

So I did the changes I said I was going to above (replaced the C8 & C1 47uF caps with 100nF, C6 100uF became 10uF (see the attachment below), and its still not cooperating :?

I tried decreasing the reset (big ass) cap from 150uF to tried a 100nF now on the reset line. No joy. Tried 1uF, still no life. Ok how about 10uF.. do we have a winner??
No!! :x
Ok put big ass cap back in, it works, grrr!!

How about I change the reset Resistor R3 from 10K to 47K?
I grounded the crystal case for the first time with this project, I cant see how, but that wouldnt do anything unwanted would it?

Attachment(s): 

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

glitch wrote:
the inductors and capacitors for filtering the spikes would do better before the 5V regulator. (except of course, the ones required by the switcher itself.)
Quote:

If you have large transients on your input, add a TVS to absorb them. But you do this BEFORE your supply, not after.


How you guys get so smart, its not fair dammit.
*goes off to move the TVS*

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

[edit]I was thinking of AVR040, not AVR042. Normally filtering is for AVR chips with AVcc power pins for the ADC section. If you never use the ADC analog function, then the filter isn't needed. If you use the ADC the filter helps reject noise from the power connection that could upset maximum resolution ADC results. Since you do not have an AVcc pin or any ADC on your chip the filter really isn't needed.

[edit]I suspect the AVR042 filter example is because of the widely spaced Vcc/ground pins. I don't quite know what they meant by 4.7 uf/6. If you want to follow the appnote change C8 4.7 uf and it may not cause any problem.

The primary goal of just the 100 nf Vcc capacitors is an as short possible noise bypass ground return path, before connecting to the main power distribution traces. The ATmega8515 isn't the best at this (traditional power pin layout at opposite ends of the package). The ATmega8535 layout is much better at this, and has an AVcc pin as well.

There are fancy AVR chip power connection (for Vcc, not just AVcc) filtering designs that usually have multiple parallel caps (due to the self resonance inductance that is part of every cap) and a painfully selected inductor value/type. These are typically done for extreme EMI compliance or specific design requirements, and require testing too verify if they really work or not (the black art of EMI).

Last Edited: Fri. Oct 30, 2009 - 08:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fever2tel wrote:
*goes off to move the TVS*

But make sure the TVS is the correct size for the input. You don't want it kicking in within normal operating voltages.

Writing code is like having sex.... make one little mistake, and you're supporting it for life.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Uh, how much current are you taking from the switcher?

My calculations indicate at 50Hz mains frequency, 9.5 VAC VRMS minimum switcher input of 7V, and 100uF capacitor, the switcher cannot take in more than 60mA. Roughly calculated.

Are you absolutely sure you have the 100uF before switching regulator right?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

glitch wrote:
fever2tel wrote:
*goes off to move the TVS*

But make sure the TVS is the correct size for the input. You don't want it kicking in within normal operating voltages.


True, i just moved it about in my schematic for next time.
I am going to have to make a new board in future with all these changes, its starting to look more like vera board.

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jepael wrote:
Uh, how much current are you taking from the switcher?

My calculations indicate at 50Hz mains frequency, 9.5 VAC VRMS minimum switcher input of 7V, and 100uF capacitor, the switcher cannot take in more than 60mA. Roughly calculated.

Are you absolutely sure you have the 100uF before switching regulator right?


Rough calculation is what we engineers do best!

I am 100% sure the 100uF Cap is there. I doubled checked the polarity too.
I actually bought another transformer (a 12V just to be sure) that sits at 13.3V, while the circuit draws 100mA. I should of noted that on the schematic, sorry.

I am starting to have a bit of mild luke warm success by placing a lowish value resistor on the +3.3V output to ground, to try help speed things up a bit.

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike B wrote:
[edit]I was thinking of AVR040, not AVR042. Normally filtering is for AVR chips with AVcc power pins for the ADC section. If you never use the ADC analog function, then the filter isn't needed. If you use the ADC the filter helps reject noise from the power connection that could upset maximum resolution ADC results. Since you do not have an AVcc pin or any ADC on your chip the filter really isn't needed.

[edit]I suspect the AVR042 filter example is because of the widely spaced Vcc/ground pins. I don't quite know what they meant by 4.7 uf/6. If you want to follow the appnote change C8 4.7 uf and it may not cause any problem.

The primary goal of just the 100 nf Vcc capacitors is an as short possible noise bypass ground return path, before connecting to the main power distribution traces. The ATmega8515 isn't the best at this (traditional power pin layout at opposite ends of the package). The ATmega8535 layout is much better at this, and has an AVcc pin as well.

There are fancy AVR chip power connection (for Vcc, not just AVcc) filtering designs that usually have multiple parallel caps (due to the self resonance inductance that is part of every cap) and a painfully selected inductor value/type. These are typically done for extreme EMI compliance or specific design requirements, and require testing too verify if they really work or not (the black art of EMI).

Thanks for the lesson, I think Im going to save your post to a AVR043.doc, and stick it with the rest of my ATMEL datasheets.
The 8535 does look much cooler. An extra counter, ADC, and of course the much better lay out like you said. And I just bought a tube of 8515Ls :x !!!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe there was a fault on the crystal or the two caps on it.
And thus the crystal need very long to oscillate.
Try another crystal.

I have never seen any problems, if the VCC rise very slow.
You must enable the brownout reset.
Only without brownout reset, VCC must rise fast.

Another point, how you have detect, that the AVR seems not working?

Maybe, your software expect some input states,
which are not stable immediately after power on.

Write a small test program, which flash a LED and read no input pins.

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni wrote:
Maybe there was a fault on the crystal or the two caps on it.
And thus the crystal need very long to oscillate.
Try another crystal.

I have never seen any problems, if the VCC rise very slow.
You must enable the brownout reset.
Only without brownout reset, VCC must rise fast.

Another point, how you have detect, that the AVR seems not working?

Maybe, your software expect some input states,
which are not stable immediately after power on.

Write a small test program, which flash a LED and read no input pins.

Peter

OMW!!!! You are right!!! You are a life saver! Are you like part of Oprahs angel network or something??? I had given up and was about go to bed feeling very retarded, since I cant even get a micro to start up and blink a LED. But I thought let me just check here before I do...

I had a flashing LED on one port and thats how I knew it had started up. But I cut out ALL my code except the LED blinky part as per your recommendation, and hey presto. Now it starts EVERY time!! It is so nice to be chasing the right lead now!

I am so confused now. How can my sucky code be fixed by the big ass cap? My micro with the faulty programme starts running every time after a reprogram with out fail. The only time it didnt start properly was after a power on reset.

I am so happy yet so confused! Woooweeee yay!

Thanks so much Peter!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wast reading the UDR in certain circumstances!

I copied what I thought was a clever line of code that I saw in some1 elses UART programme on this forum :?

//============================================================
ISR(USART_RX_vect)
{	
	/*if ( (UCSRA & 1<<FE) | (UCSRA & 1<<DOR))
    	return;*/
	
	char buffer_rx_UDR = UDR;
        ...
}

That part in comments was resulting in the RXC constantly being called because the UDR was not being read. This would happen when there was a framing error on a power on start up only, when the wireless module sends junk when its half on I guess. Now I read the UDR too before exiting cause of a error. There was a nice waste of 2 days =)

Thanks guys I would never or solved it without you guys.
Love you guys...

Just a noob in this crazy world trying to get some electrons to obey me.