AVR works after pressing Reset Button

Go To Last Post
77 posts / 0 new

Pages

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

You have 24V 20A power why?

 

Perhaps there are some other "big" loads that make the ground jump. (I expect that 24V and 5V share ground).

 

Does the chips control some transistors for relys that go to 24V? perhaps perhaps there are some odd currents when the chip boot.

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

vrgdubey wrote:
Bu the maximum length of the wire is 10m.
An antenna.

ESD or EFT could upset the TPS62175 via its over-current comparator.

Lightning can also cause issues that are somewhat overcome by metal-oxide varistors (MOV) (or silicon-oxide varistors, SOV)

Ferrite beads are mentioned in AN_1619 AVR040: EMC Design Considerations | Application Notes | Microchip Technology Inc.

via ATmega328PB - 8-bit AVR Microcontrollers

 


TPS62175 28V, 0.5A Step-Down Converter with SNOOZE Mode | TI.com

 

"Dare to be naïve." - Buckminster Fuller

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

 

it pretends that device started working on 1 MHz instead of 11.0592 MHz

What difference do you see? 

You still have not answered the question:

 it pretends that device started working on 1 MHz instead of 11.0592 MHz

How is it pretended (what is observed) and what matters  (that you could observe)  that would make this noticeable?  Turning on an LED, would happen either way, at any frequency.   

So what matters enough for you to say it is running at 1MHz vs 11MHz...a simple question.  

If you say the PWM freq should be 55KHz, but we only get 5KHz, then that is an example.

 

saying "it matters because this is a commercial project"  is NOT discovering any problem.

 

I dont understand when people says the 1MHZ frequency or 11MHz frequency doesnt matter and then trying to defend this idea

I do believe you don't understand and are causing an issue starting with your initial nonsense post (#21).  I have asked what matters that would cause a tech to say it is running at xx freq vs yy freq. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Feb 26, 2019 - 03:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Interesting problem.

Although reading through the Thread it sounds a lot like a power supply problem start up and surge current problem, the fact that testing a single board can still result in failure makes that very unlikely.

(Assuming a single board failure is the same failure as the multi-board setup failure.)

 

To solve problems it is best to simplify the system and isolate the problem.  If one board will demonstrate the problem, then focus on one board, and leave the large 200 board setup alone for now.

 

I believe you said each PCB has its own TPS62157 regulator.  Switching regulators can be great... when they work properly.  Are you using the recommended PCB layout?  Are you using X5R caps, (as recommended)?  Is the thermal pad on the regulator soldered to the AGnd bus?  Does the main power supply have any overshoot on its startup, (the TPS is rated for 24 V input)? What is the ESR of the power supply caps you are actually using?

 

Does a single PCB, with a different power supply, (A bench top 12 V supply, for example), without any external devices connected to the PCB, also demonstrate a failure now and then?

(Hopefully the answer is yes, as that helps take your main power supply out of the likely problem list.)

 

If you eliminate the TPS on board power supply and use a good bench supply to power the PCB on and off, does it ever fail?  This test is again to help isolate the problem to the TPS chip, or to the remainder of the circuitry.  To properly test this you would ideally test a PCB without the TPS installed on the PCB, or with its Vout to the reset of the circuit disconnected, (i.e. CUT the PCB trace on your test board).

 

Already asked previously, what is connected to the micro?  Is there anything connected to the I/O pins during your testing right now?  Do ANY of the micro's pins have a voltage on them before the micro has fully powered up?  (i.e. Is there an input signal to the micro before it is fully powered up?)  If so, clearly an additional possibility is that the micro is being back-powered by the input signal and is experiencing a lock up on power up.

 

 The fact that the "failing" PCB's work after you press the reset switch once again points first to a power supply problem, as the power supply has had a chance to turn on, power up, and stabilize by the time you recognize the failure and press the reset button.  If there are no external signals connected, you disconnect the TPS, and you use a good bench supply or another 5 V power supply and the board works, then that is a good thing, and it again points to the TPS circuitry, (and to its main supply input, also).

 

With one, single, PCB on the bench, you need to determine the power up failure rate, (e.g. once every 10 times it fails, etc.).   This will help to demonstrate, (but not prove), that you have solved the problem when you do so.  You would like to capture a faulty power up V+ supply rail image on an O'scope when it fails, and do so several times, so that you can show that your ultimate correction / solution has indeed fixed the problem.  Doing that takes a lot of patience, and troubleshooting skill.

 

In summary, testing a single PCB, on the bench, with nothing else connected to the I/O pins, and with a different power supply, with and without the TPS, would be my next set of tests, (after I reviewed the TPS caps, their type, their ESR, and the EXACT layout used for its circuitry).

 

JC

 

 

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

Paulvdh wrote:

1MHz instead of 8MHz suggests CKDIV8 is programmed

 

vrgdubey wrote:

CKDIV8 fuse bit is not programmed.

 

CKDIV8 state won't matter:

 

 

vrgdubey wrote:

Clock fault fuse bit is also not programmed.

Now >>that<< should matter ;-)

 

vrgdubey wrote:

4. My fuse bits Extended=0x05, High=0xDE, Low=0xFF

That would seem to confirm your assertion.

 

However, the symptoms you've described seem difficult to explain any other way but via CFD.

 

So, either:

  • the CFD fuse is in fact '1', though you believe it to be '0' (how have you confirmed your belief?)
  • the datasheet is in error w.r.t. the CFD fuse (wouldn't be surprising)
  • the CFD feature can be (and is) enabled through some other undocumented way (also unsurprising)

 

There is a simple way to determine if the CFD is in play.  Modify your firmware to monitor XFDIF in the XOSC register (or enable the interrupt via XFDIE in the same register, and provide an ISR to handle it), then indicate to the outside world somehow that this has occurred.

 

If a device exhibits the '1 MHz' behaviour, but XFDIF is never set, then and only then can you really rule out CFD.

 

It would be quite peculiar for an 11.0592 MHz crystal to sing at 1 MHz.  It would be even more peculiar for a number of such crystals to do exactly the same thing.

 

By the way, >>exactly<< how have you determined that the failing devices 'pretend' to work at 1 MHz.  How have you measured this?  How accurate is that measurement?

 

There is at least one errata concerning CFD:

 

 

While this errata doesn't explain the behaviour you've seen, it would not be unprecedented to find a related errata which later turned out to be relevant.

 

Again, since the behaviour is consistent with CFD, you must >>prove<< and >>verify<< that CFD is not at work.

 

Regardless, it seems likely that clock stability, and possibly power supply, are the underlying causes of your issues.  What have you done to investigate this?  Many suggestions have been made in the this thread, but not much information is forthcoming from you.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

Last Edited: Tue. Feb 26, 2019 - 05:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vrgdubey wrote:

Everything is connected in parallel connection. The power supply of 24V is shared by all devices. The gauge of the wire is 24AWG. 

 

How do you connect all 200 devices to the power

supply in parallel?  I mean the physical hardware

for this.  A terminal busbar maybe?

--Mike

 

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

DocJC wrote:
... (A bench top 12 V supply, for example), ...
A power supply is conditionally stable though some are unconditionally stable.

There may be stability, noise, and efficiency data in the bench top power supply's datasheet or in its technical data package.

In lieu of, consider a battery as a battery is stable and very low noise (discharge, charger noise is PWM or a current source)

A battery followed by a stable transformation results in a stable power supply plus the transformation's noise.

In the case of post 9, a stack of two 12V batteries or a 24V battery (lead-acid, lithium iron phosphate, a nickel electro-chemistry, etc)

 

I don't recall any AVR with a PSRR spec; oscillators have a functional common-mode voltage range, therefore, AVR VCC noise can affect AVR oscillators.

The mention of ground bounce :

https://www.avrfreaks.net/forum/avr-works-after-pressing-reset-button?page=1#comment-2646121

PCB's ground plane is a reference, AVR GND is its reference.

Earth Ground

by Dr. Howard Johnson

(the 4th paragraph in his reply)

In my opinion the most important point to make with regard to grounding is that the input to every digital logic gate is a DIFFERENTIAL amplifier. That's right--a differential amplifier. This differential amplifier compares the digital input signal to some local reference (often generated inside the chip), and decides which is bigger (more positive).

 

"Dare to be naïve." - Buckminster Fuller

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

vrgdubey wrote:

The gauge of the wire is 24AWG. 

 

Ten meters of 24 AWG has a resistance of

almost one ohm.  Perhaps try bigger wire.

 

--Mike

 

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

avr-mike wrote:
Ten meters of 24 AWG has a resistance of

almost one ohm.

plus significant inductance.

Worst case, the input voltage will briefly double (hot plug)

Wcalc

 

"Dare to be naïve." - Buckminster Fuller

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

avr-mike wrote:
Ten meters of 24 AWG has a resistance of almost one ohm. Perhaps try bigger wire.
In fact, 24 AWG has 84.1976 ohms per km, or 0.084 ohms per m.  A 10m power cable has 20m of conductor, so that's 1.68 ohms.

https://www.powerstream.com/Wire_Size.htm

 

It's still not clear from the OP and his aide where that 10m cable is used.  If it carries 24V to the 5V switcher, then the wire resistance won't be much of an issue.  If it carries 5V from the switch to a module, that's another story.

 

However as noted power isn't necessarily the mail culprit (although it may be implicated).  Oscillator stability is the main issue.  And yes, while power can affect that, we are assured that the problem exists even with a single isolated board.

 

gchapman wrote:
plus significant inductance.
That is the greater concern, as it can boggle the switcher.

 

OP:  Don't you have a scope you can put on your rig to find out more?

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

I mentioned in #23

With 200 units, you have 400 wires arriving at the power supply, correct?   If instead, they share the same bus , it will need to be perhaps 18 gauge or heavier wire.  What wiring are you using?

with 6+ amps flowing you want to be in the 16-18 gauge wire range, maybe 20 if you want lousy voltage. certainly not 24! 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Note post #38 - External capacitor size 22pF

Note post #48 - External capacitor size 1.8pF.

 

Not quite the same thing.  S.

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

There’s been many assumptions made, but no hard evidence. There may be more than one problem, so I’d suggest you challenge your assumptions otherwise you’ll keep guessing.
Check the clock fail circuitry - even though it is supposedly not enabled. This might take you 1 hour. If it comes up negative, then you have some hard evidence. What happens if you short or remove the crystal? Two very simple tests. When failed, is the crystal oscillating? Putting a cro probe will upset the circuit, so wire in something like a 74hc04 inverter. The mere fact of wiring in the hc04 will add a few pF to the circuit, so it might tip the balance. That alone is hard evidence.

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

Scroungre wrote:
Note post #38 - External capacitor size 22pF

Note post #48 - External capacitor size 1.8pF.

 

Not quite the same thing.  S.

Note also that #48 makes calculations based on a crystal CL of 9 pF.  OP has not indicated CL of their crystal.  Nevertheless, unlikely that 22pF is ideal. Likely quite a bit too high.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

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

joeymorin wrote:

Scroungre wrote:
Note post #38 - External capacitor size 22pF

Note post #48 - External capacitor size 1.8pF.

 

Not quite the same thing.  S.

Note also that #48 makes calculations based on a crystal CL of 9 pF.  OP has not indicated CL of their crystal.  Nevertheless, unlikely that 22pF is ideal. Likely quite a bit too high.

 

Mr. Chapman specified (in #48, and in #50 w/ specific part number) a crystal with a CL of 9pF.  I've always used 18pF externally on my xtals, but they and the affiliated caps are all thru-hole.  I would suspect that all SMT (especially small SMT, 402 or so) would desire a lot less capacitance.  Down in the pico-farad weeds, you might just get enough capacitance between the trace and the PCB ground plane with no external caps at all!  Don't try it unless you know what you are doing... smiley  S.

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

avrcandies wrote:
I do believe you don't understand and are causing an issue starting with your initial nonsense post (#21). I have asked what matters that would cause a tech to say it is running at xx freq vs yy freq.

 

Candies, you are completly missing the point, have you ever been/done an EMC/EMI. Have you seen with your eyes the kind of tests they are making...what they are doing.

 

If you did, then I do not understand your behaviour. if you didnt then I suggest to google on that a bit. A long wire (Here in our case 10m) connected to an IO will radiate the multiple of the clock of the chip. then ofcurse here is it matters 1MHz or 8MHz. sometimes electromagnetic interference could totaly cause the device not to work. So please chill a bit.

 

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

A smile from the side line:

 

It made me smile and think of my first "real" job where I was to make a communication driver. My boss gave me a roll with a 50m flat cable that was connected so I had a 300m wire, in the middle of the roll he had placed a relay that interrupted itself. When I could send 9600 baud through it he would trust my driver :)

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

sparrow2 wrote:

A smile from the side line:

 

It made me smile and think of my first "real" job where I was to make a communication driver. My boss gave me a roll with a 50m flat cable that was connected so I had a 300m wire, in the middle of the roll he had placed a relay that interrupted itself. When I could send 9600 baud through it he would trust my driver :)

 

another example a capacitive sensor. in general capacitve sensors are very suspectible to noise/EMI...etc. thats why shielding is required, filtering...etc.

 

The magic word for Mr Candies is "Noise". now try to spend a day searching about this topic, your keywords are:

NOISE*EMI*EMC*FREQUENCY

 

EDIT:

Add *ANTENNA* to your search. I think one of the highly qualified members here mentioned this.

Last Edited: Wed. Feb 27, 2019 - 10:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Let it go Moe, let it go. The niceness line has been crossed and no value is being added.

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

Kartman wrote:
Let it go Moe, let it go. The niceness line has been crossed and no value is being added.

 

Allright, you are right.

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

Kartman wrote:
Let it go Moe, let it go. The niceness line has been crossed and no value is being added.

Agreed

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

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

Kartman wrote:
When failed, is the crystal oscillating?
(though after the crystal oscillator) If pin PB0 is available then the CLKO signal due to the CKOUT fuse bit.

11.8 Clock Output Buffer

The device can output the system clock on the CLKO pin. To enable the output, the CKOUT fuse has to be programmed. This mode is suitable when the chip clock is used to drive other circuits on the system. The clock also will be output during Reset, and the normal operation of I/O pin will be overridden when the fuse is programmed. Any clock source, including the internal RC oscillator, can be selected when the clock is output on CLKO. If the system clock prescaler is used, it is the divided system clock that is output.

Kartman wrote:
Putting a cro probe will upset the circuit, ...
There are inexpensive low capacitance differential probes (amplitude of XTAL, common-mode voltage of XTAL)

A current probe can be wrapped around either signal XTAL1 or XTAL2 though will need a LNA to amplify that for the scope.

 


DIY active differential probe characterization « Dangerous Prototypes

Is there one more recent than '15?

Recent Texas Instruments E2E blog?

Recent Analog Devices blog?

 

"Dare to be naïve." - Buckminster Fuller

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

few devices start behaving randomly like by seeing seven segment display it pretends that device started working on 1 MHz instead of 11.0592 MHz.   And some devices does not display anything but few segments of seven segment glows

Ok, what happens if you set them to run on the RC oscillator intentionally?  Do the segments always/never/sometimes light up? You need to give more details on what your software is dong.  A 7-seg display should function at either freq, perhaps with more flicker. Is it a matter of not receiving valid uart data & displaying garbage?  If so, how do you detect a valid message is rcvd? There should at least be some default values (0?) displayed regardless & almost any clock speed would at least show those until being overwritten.   You have not provided enough details yet.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

Scroungre wrote:
Mr. Chapman specified (in #48, and in #50 w/ specific part number) a crystal with a CL of 9pF.
Specified? No  Copied? Yes

Am trying to intuit for imrana326 and all.

smiley

Scroungre wrote:
I've always used 18pF externally on my xtals, ..
22pF capacitors and a 16MHz HC49 crystal work well for XMEGA though design efforts on XMEGA and PB megaAVR are about a half decade apart.

Fractions of a micro-amp are an issue for some applications therefore partial swing crystal oscillator or no crystal oscillator (so, replace UART BRG with UART FBRG and add UART auto-baud; megaAVR 0-series)

Scroungre wrote:
Don't try it unless you know what you are doing... smiley
Do try even if you don't know as you will know.

One avenue to data then information then knowledge is by practice; by a professor - you will remember that which you create by your hands.

Don't try if the lack of a clock signal will disable safeties.

 


Atmel Launches Next-Generation Low-power 8-bit AVR MCUs (PB megaAVR press release)

Choose the right quartz crystal for your energy saving MCU with this simple test

08.15.17

(end of first paragraph)

The Pierce oscillator circuit, a closed loop system most commonly integrated into low power ICs, sustains oscillation at an operating point, depending on the crystal plating capacitance (CL), crystal equivalent series resistance (ESR), and oscillator amplifier’s gain and phase response associated with the oscillator’s transconductance (gm). But, how do you know if your crystal’s parameters match your system?

 

...

404 for the first URL at the bottom of that article; corrected :

Understanding the basics of the Pierce oscillator

by Syed Raza (Abracon, was Director of Engineering, now VP of Engineering)

The designer’s challenge is to optimize performance with the quartz crystal

...

 

"Dare to be naïve." - Buckminster Fuller

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

 and a 16MHz HC49 crystal work well for XMEGA

 

So, admittedly, I've used some 16 MHz Xtals on some Xmega projects.

Setting the PLL to 2 gave me 32 MHz, the top end of the in spec operating frequency.

 

But I recall a Thread or two that discussed whether the Xmega's internal oscillator was designed for external Xtals and a frequency of <= 4 MHz, with the expectation of using the PLL to bump up the operating frequency to 32 Mhz or whatever.

 

I'm not on the right computer to look at an Xmega Data sheet, but I think the OP is using a Mega anyways, so it really doesn't matter, and isn't a factor in his failure modes.

 

JC  

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

DocJC wrote:
I'm not on the right computer to look at an Xmega Data sheet, ...
XMEGA E5 datasheet has XOSC all the way down to 0.4MHz by a resonator with a lot of load capacitance and XOSC at partial swing (partial or full swing for 16MHz)

DocJC wrote:
... but I think the OP is using a Mega anyways, so it really doesn't matter, and isn't a factor in his failure modes.
Concur

The intent of the post was to ready one for possible risks (removal of crystal oscillators, EOL is low probability of failure)

 

edit : ATXMEGA128A1U XOSC has been characterized :

  • typical values for RQ (negative impedance) (approx 100 ohms to 13K ohms)
  • crystal ESR < min(RQ) / safety factor
  • typical values for start-up time duration (approx 1ms to 3ms)
  • typical values for CXTAL1, CXTAL2, and therefore CLOAD (approx 4pF)

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Wed. Feb 27, 2019 - 04:30 PM

Pages