SAMD21 does not always start on power-up

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

An application often does not start on powerup. Starts just fine on external reset. Default fuses. Minimal initialization. No fancy clocking, just internal OSC8M. Just flashes an LED. Thoughts?

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

If this is a custom board not an Xpro I would check the power rail

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

Starts just fine on external reset.

That says a lot.  

 

David

 

 

 

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

"That says a lot" - can you elaborate?

This is a custom board. I have another custom board that seems to work fine. So it does look as there is possibly some design flaw with that particular board. Or the micros got (semi-)killed during manufacturing or something. The issue is more prominent when something is plugged into the UART and thus the external TX backfeeding the micro's RX. On the other hand, I almost always have something connected to a UART on almost all boards, and usually that does not cause any problems.

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

If it always works with an external reset then the reset circuit you use at power up might be flaky.  The power rail might be ramping up too slowly for the reset circuit.  Can you post the schematic? 

 

David

 

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

No, I cannot post the schematic. There is no "reset circuit", just a 10K pullup and a cap on the reset line. Same as on the "good" boards with the same SAMD21 micro. "The power rail might be ramping up too slowly" - I don't see anything in the datasheet why that would be a problem. Somewhere in the datasheet they say something along the lines that "this eliminates the need for external reset circuitry to guarantee stable operation when powering up the device". The way I read this is that the power supply characteristics should not matter (well, as long as eventually the power gets into the valid operational range; and the voltages do looks good on the scope). (BTW, I'm a software guy. So I don't necessarily know what I'm talking about.)

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

Well the RC network has a time constant and if the power rises slow compared to the time constant it might not generate a reset.  The SAMD21 Xplained pro uses this: 

 

Your circuit might only just be working so you have a 10k pullup and a capacitor but what is the value of the capacitor?

<edit> typo

 

David

Last Edited: Tue. May 24, 2016 - 02:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a schematic checklist in the datasheet that gives recommendations on decoupling caps, placement and such. And there should be something on rise time in the characteristics chapter.

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

The capacitor is 0.1uF. I still don't understand why the rise time would make any difference.

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

If you look at the Xplained pro schematic the RC network is 100k and 0.1uF.  You have 10k and 0.1uF so 10 times faster.  Try changing the 10k for 100k and see if that resolves the problem.  In essence your circuit requires the power to ramp up 10 times faster than the Xplained pro and holds the reset for 1/10th of the time.  Check out http://www.electronics-tutorials...​.   

 

David

 

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

The schematic Checklist shows 10K (and 100nF). But again, why does it matter? Where does it say anything about power rise time?

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

You currently have an intermittent power up reset problem. If you press the reset button when the power is up it works every time. this suggests to me that your reset circuit timing is on the edge.  Increasing the capacitor or resistor will increase the time the reset is held low so try replacing the 10k or solder another capacitor across the one in place.  Power rails always take time to reach the operating voltage and you have tolerances in the components used in the power and reset circuits.  This means there will be a variation in the power rail rise time and the reset timing increasing the reset time by increasing the resistor or capacitor will hopefully resolve your issue.  

 

David

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

"your reset circuit timing is on the edge" - what edge? Show me the "edges" in the datasheet! I know that if I change things (or to be precise, ask my hardware guys to change things, since I'm not capable of doing any hardware work myself), it might start to work (better). That is not what I'm really after in this thread. I want to understand why what I have doesn't work in the first place.

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

I am sure you understand race conditions in async software well this is likely to be a race condition in hardware. 

 

The time the reset line is held low is set by the resistor and capacitor and the rate that power rises when switched on.  It looks like your reset time is 'on the edge' of being held on long enough with valid power applied to the processor.  By increasing the time constant of the circuit it should resolve the reset problem so there is no longer a race condition and the reset line is held low long enough for the processor to react and reset cleanly. 

 

I hope this goes someway to explaining and if not try reading http://www.sigcon.com/Pubs/edn/p... also https://www.maximintegrated.com/...​.  You will also see there are many ICs that are designed to provide power up reset.  Hopefully this will satisfy your need to know.  

 

David   

 

 

 

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

VDDANA was not connected. Connecting it seems to have fixed the problem. No idea what VDDANA has to do with POR.

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

Not sure which version of SAMD21 you are using but this is from the SAMD21L datasheet:   

 

7.2.4.1 Minimum Rise Rate

 

The integrated power-on reset (POR) circuitry monitoring the VDDANA power supply requires a minimum rise rate. Refer to the “Electrical Characteristics” on page 790 for details.   

 

 

David

 

 

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

That must be it. Thanks for pointing that out. (In 7.2.1 they list a number of things that VDDANA powers. But apparently it is needed for other things too, like POR. And I see for BOD too.)