Go Down

Topic: Hanging mCU (Read 618 times) previous topic - next topic

AMPS-N

I wanna try simple code on arduino UNO. The watchDOg timer program.

I wanna know how to do it:

I wanna hang cpu for 1min by that time i wanna check whether the watchdog timer can take care of hanged cpu issue.

please let me know how to do it.
If any code please share it here.
Is it possible to do it:
AMPS

dc42

The maximum timeout for the watchdog timer is about 8 seconds.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

PeterH

If you want your sketch to trigger the watchdog then you just need to enable the watchdog and then not reset it. It would be helpful if you designed your sketch to do something obvious when it resets so that you can tell when the reset has occurred, such as flashing the onboard LED in a recognisable pattern.
I only provide help via the forum - please do not contact me for private consultancy.

AMPS-N

Since i am new to this can some one share me the COde for doing this...


How to make CPU hangs for Ever , i wanna test these . I wanna test fro some abnormal condtion..Please help me out

If some one share me the code it will be helpfull.
AMPS

retrolefty


Since i am new to this can some one share me the COde for doing this...


How to make CPU hangs for Ever , i wanna test these . I wanna test fro some abnormal condtion..Please help me out

If some one share me the code it will be helpfull.


Hang forever is easy:

Code: [Select]
while(1) {}

Lefty

Nick Gammon


How to make CPU hangs for Ever , i wanna test these .


Hang forever? Get some liquorice and pretend it is a CPU.

Come on, man. What is your project? You want to get a processor and have it hang forever? To what purpose?
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

dhenry

Quote
How to make CPU hangs for Ever , i wanna test these . I wanna test fro some abnormal condtion..


Code: [Select]
while (1) continue;
does it.

You may also output the POR status on some pins so you know why the mcu was reset.

PeterH


Since i am new to this can some one share me the COde for doing this...


Since you're new to this, why don't you just try writing some code and try it for yourself? There's nothing complex or difficult in what you're trying to do and plenty of other people have already done the same thing so I'm sure Google will turn up loads of examples for you to follow. The fact that you're new to Arduino doesn't absolve you from the need to do things for yourself.
I only provide help via the forum - please do not contact me for private consultancy.

Groove

Quote
I wanna
@OP, is it really too much trouble to type two "t"s and a space?
Per Arduino ad Astra

Go Up