Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

M1284P Odd Reset Issue
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Mon May 11, 2020 3:03 pm    Post subject: M1284P Odd Reset Issue Reply with quote

I have a 6pcs of a board with the M1284P. It has an external crystal with the oscillator programmed for maximum delay, DIV8 disabled, JTAG
disabled and BOD at 4.3v (VCC=5V).

1 board works fine.

The others exhibit this odd behavior of not running until the JTAGICE3 is plugged onto the board. Then they run fine even if it
is disconnected until the power cycles. I can duplicate it exactly the same on all of the affected boards 100% of the time.

I am relying on the internal reset circuitry (may have been a mistake) but since manually resetting the processor does not help
I am doubting that to be the issue.

Any clue what may be going on? I have been using Bascom and various AVR's for years and haven't seen this sort of problem.
I suspect it is something simple and I am going to have an "AHA" moment but going in circles is no fun.


(BASCOM-AVR version : 2.0.8.2 )
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Mon May 11, 2020 7:32 pm    Post subject: Reply with quote

i do not know what kind of hardware you connected to the reset pin ?
but it is important not to leave out such important info.

do not put caps on the reset pin.
the internal pull up should be sufficient but you can add a pull up of 4K7.
i am not sure if the problem is that the processor keeps in reset, or that it does not start.

not starting is usually because the oscillator is not stable. you might want to test using a different ext. osc.

_________________
Mark
Back to top
View user's profile Visit poster's website
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Mon May 11, 2020 7:38 pm    Post subject: Reply with quote

albertsm wrote:
i do not know what kind of hardware you connected to the reset pin ?
but it is important not to leave out such important info.

do not put caps on the reset pin.
the internal pull up should be sufficient but you can add a pull up of 4K7.
i am not sure if the problem is that the processor keeps in reset, or that it does not start.

not starting is usually because the oscillator is not stable. you might want to test using a different ext. osc.



There is nothing connected to the reset pin other than the ISP connector.

I put a scope on the crystal and it looks good. Frequency is spot on. I have used the same crystal and caps on another
board with the ATMega1284P and did not experience this problem though that one is a DIP package and this one is QFP.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Mon May 11, 2020 7:50 pm    Post subject: Reply with quote

but how quick is the crystal stable when you turn the power on? and how quick is the 5V stable?

casing should not matter but... it might be the case that it is produced in a different plant with different technology.
you can ask microchip about it.

i had a similar problem with an xmega: the programmer would cause a reset some times. i had to use an external pull up.
i guess that the osc. start up time(fuses) is not sufficient for the osc. you use. but without scope image of the power and osc. it is hard to tell.

_________________
Mark
Back to top
View user's profile Visit poster's website
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Mon May 11, 2020 8:04 pm    Post subject: Reply with quote

albertsm wrote:
but how quick is the crystal stable when you turn the power on? and how quick is the 5V stable?

casing should not matter but... it might be the case that it is produced in a different plant with different technology.
you can ask microchip about it.

i had a similar problem with an xmega: the programmer would cause a reset some times. i had to use an external pull up.
i guess that the osc. start up time(fuses) is not sufficient for the osc. you use. but without scope image of the power and osc. it is hard to tell.


The best case I could figure out was to simply pull the banana plug out of the power supply and jam it back in giving
me a very sharp rise on the 5v supply.

I tried a small cap on the reset line. Also tried an external pullup on the reset line as well as both.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Mon May 11, 2020 8:22 pm    Post subject: Reply with quote

so you use a crystal. which value ? and what kind of load ? what is the brand/datasheet?
and what value for the caps ?

you could try to swap the xtal from the working board to another and see if that fix it.

_________________
Mark
Back to top
View user's profile Visit poster's website
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Mon May 11, 2020 8:30 pm    Post subject: Reply with quote

albertsm wrote:
so you use a crystal. which value ? and what kind of load ? what is the brand/datasheet?
and what value for the caps ?

you could try to swap the xtal from the working board to another and see if that fix it.



The crystal is one of these: https://www.digikey.com/products/en?keywords=300-8204-1-ND

The caps are 22pF.

What I find unusual is that I took both of the BOM for a board that the company I work for has made 100's of
and never had an issue. I am not saying that I am foolish enough to believe that it is not possible though!
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Mon May 11, 2020 9:18 pm    Post subject: Reply with quote

you should first make sure that the essential parts are what you think they are.
then clean the board. depending on the used reflow cleaning (or not) there might be some residue left having influence on the caps.
make a small program that will just print a counter in a loop each sec,
this way you can see if the micro starts, and/or if it doesnt reset. when the counter keeps counting up you know there is no reset.

the 22 pF : i would start from 15pF and go up in steps.

also check the revision of the processor.

and last : since you changed from DIP to QFN/MLF : The large center pad underneath the QFN/MLF package should be soldered to ground on the
board to ensure good mechanical stability.

dont know if it is only for mechanical performance.

all vcc/gnd pins should have a 100 nF cap as close as possible. (each side). I do not say you did not do that but i sometimes see that different.

_________________
Mark
Back to top
View user's profile Visit poster's website
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 862
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Mon May 11, 2020 11:59 pm    Post subject: Reply with quote

With crystals I had bad results, as some of them (even the caps where according to specs) would not start up correctly.
Since then I am only using external oscillators or internal with OSCCAL to get the frequency close to what it should be.
Crystals in my opinion are a bad choice for professional designs.
Regards Hubert
Back to top
View user's profile
hgrueneis

Bascom Member



Joined: 04 Apr 2009
Posts: 862
Location: A-4786 Brunnenthal

austria.gif
PostPosted: Tue May 12, 2020 12:02 am    Post subject: Reply with quote

Also, I always have a 10K resistor to VCC on the reset. Caps on reset are a no no!
Hubert
Back to top
View user's profile
O-Family

Bascom Expert



Joined: 23 May 2010
Posts: 183
Location: Japan

japan.gif
PostPosted: Tue May 12, 2020 1:50 am    Post subject: Reply with quote

If the watchdog reset is running at high speed, it may appear that the reset pin is not working.
It's a good idea to put the fuse bits back in the factory default and run a simple test program to check the AVR status before moving on to the next inspection step.
Back to top
View user's profile Visit poster's website
JC

Bascom Member



Joined: 15 Dec 2007
Posts: 490
Location: Cleveland, OH

usa.gif
PostPosted: Tue May 12, 2020 3:38 am    Post subject: Reply with quote

Interesting problem.

All good advice above.

Know that putting a scope probe on the Xtal isn't a good test, as it changes the Xtal environment.
If the uC has a CloOut pin, and you can route the clock to that pin without screwing up external circuitry, then put your scope probe on that pin to monitor the oscillator.

Generally, Cload - Cs = (C1xC2) / (C1 + C2)
where Cload is given in the Xtal's data sheet, 10 pf in your case.
Cs is the board and pin's capacitance.
That is very hard to measure, but one might typically use 5 pf for a good estimate.
C1 and C2 are the caps for the Xtal.

So, your Xtal caps should be about 10 pf.
Your value of 22 pf is significantly higher.

You might try ordering some precision 10 pf caps, (some caps have a very large tolerance), and replace the two caps on a board and see if that helps,
(After you clean the board, as mentioned above).

Can yo post a schematic of your PCB?
Can you post a good photo of the board?

MC's hardware App Note mentions putting an isolated, analog grounded, ground plane under the Xtal pins and the Xtal, and its caps.
I've done that on a few boards, but have many without that and without any problems.
That, however leads to the next question, do you have any power or signal lines running under the Xtal, caps, and traces to the uC?

Are ALL of the Vcc & AVcc and Ground pins connected?
Do each pair of power pins have their own by-pass cap, what value, and how close to the uC's pins?

How far is the Xtal from the uC's pins?

Have you tried the boards with several different power supplies?
(Different start up dV/dt and different noise between the different power supplies.)

How did you solder the boards?
Commercially manufactured?
Hand soldered?
Frying pan or kitchen oven?

JC
Back to top
View user's profile Visit poster's website
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1534
Location: Basel, Switzerland

switzerland.gif
PostPosted: Tue May 12, 2020 6:21 am    Post subject: Reply with quote

Hi,

Just try adding an external pullup to the reset pin, if the atmel powers up correctly when the JTAGICE3 is plugged in I'd guess that there's a bit of noise on the reset pin. Without seeing yout PCB layout it's hard to say, but everything Points in the direction.

Something between 4k and 10k should do the trick.

Regards
Ian Dobson

_________________
Home of AVRTimer, the Bascom timer value calculator.
http://www.planet-ian.com

Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile Visit poster's website
rkumetz

Bascom Member



Joined: 23 Jan 2007
Posts: 165
Location: Vermont

usa.gif
PostPosted: Tue May 12, 2020 8:39 pm    Post subject: Reply with quote

To answer some of the questions, the board was assembled by a contract mfr so it is not a home-brew creation.

The crystal is about 3mm away from the AVR pins.

I also tried the internal oscillator with no change.

I tried a 4.7K and 10K on the reset pin.

The power supply is a lab type supply which is super clean.


Here is what I did find today:

Changing BODEN from 4v3 to 2v7 causes all of the boards (except the one I accidentally smoked with the ground on my scope probe :( ) to power up and run.
While this does solve the immediate crisis I would like to figure out exactly what is going on since I normally select 4v3 with a 5v system.

I do appreciate the advice that everyone has provided! As you know whenever you have to get something done fast every possible problem will surface to
get in the way and sometimes things that would be obvious if it was someone else's problem don't come to mind. Thank you all.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5078
Location: Holland

blank.gif
PostPosted: Tue May 12, 2020 9:15 pm    Post subject: Reply with quote

you best contact microchip about it. this is a hardware problem, not related to the code or bascom-AVR
The errata does not show a problem but that does not mean much.
The problem could be caused by a combination of conditions.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR All times are GMT + 1 Hour
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
You cannot attach files in this forum
You cannot download files in this forum