BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 8:41 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Watchdog Timer ?? AtomPro 40
PostPosted: Thu Sep 16, 2010 4:22 pm 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
Hi
With the AtomPro 40;
is it possible to use the internal Watchdog Timer of the processor ?
I have seen in the HD64F..Manual that there is a Watchdog Timer.
But have no idea if it is to use in the Atom40 Pro…??
In the Internet I fount something for the atom like:
.
TIMEWATCHDOG and getwatchdog
.
Syntax
getwatchdog variable
variable is a bit, nibble, byte, word or long variable which stores
the timeout count.
.
But not for the AtomPro….??
.
Somebody knows some documentation, some link..?
Or know how to use the internal Watchdog Timer ??

Thanks Heinz


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Thu Sep 16, 2010 6:39 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello, Heinz.
The WATCHDOG commands are unique to the PIC versions of the Atom, ie, the Nanos, The BasicATOM modules and the interpreter chips.
There are timers to work with in the Pros. What did you want to do with these?

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Thu Sep 16, 2010 8:11 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
OK, I found my list of commands compiled last summer from all the Atom manuals, BasicAtom and Pro, and made a PDF of them. This can be found at:
http://forums.basicmicro.net/syntax-manual-f501/alphabetized-list-of-commands-all-parts-t9433.html

It's not complete, read the thread text. However, the vast majority of the commands are there, and it will help keep track of which commands work with which BMicro parts. Most of the recently added HSERVO-related commands from the last couple of months (say, July to Sep 16th, 2010) are Pro.
Later.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Fri Sep 17, 2010 9:35 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Just to clarify, there is no Watchdog timer setup on the AtomPro. The H8 processor can use a watchdog timer but it is nothing like the Atom/Nano watchdog. You wil have to look at the H8 hardware datasheets to see if their watchdog timers will do what you want.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Sun Sep 19, 2010 12:15 pm 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
Hi kenjj, Hi Nathan
thanks for your fast replay.
I use BasicMicrocontroolers, because only sometimes I have a programming project, and the basic- language is rather easy.

“ There are timers to work with in the Pros. What did you want to do with these?”

My Atom is used in a workshop with a lot of electromagnetic disturbance .
When the processor crashs I would like, after maximum 1 sec. to get the Atom40Pro resetting .
My Atom40 made sometime a reset because of disturbing and even crashed from time to time .

I have no experience in programming besides basic-language.
My project is already in use. I like to ad some more feathers, this is why I switched from the Atom40 to the Atom40Pro.
Looking at the H8 hardware datasheets,
If seams to be difficult for me to use the internal watchdog timer not using basic-commands, so I my better should ad an external watchdog – chip...?
thanks for your helpful answers and clarifications.
regards Heinz


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Sun Sep 19, 2010 1:05 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello, Heinz. You threw me there, you must have meant "features", not "feathers"! ;)
Open Studio's manual and go to page 175. Interrupts are covered from that point. You'll want to find one of the overflow commands (has "OVF" in its name) for the PLUS ONLY and read up on how to use interrupts.
Basically, you set the timer to running and every time it rolls over from its highest setting to zero, it generates a reset. BUT in your main loop you want to keep resetting its value to 1 or something. As long as your program runs properly and you reset that value before rollover happens, the timer never overflows and the interrupt never happens. If the Pro goes off the deep end, the timer reaches overflow and the interrupt happens. This starts the Pro on a course of recovery contained in the interrupt routine you created for just this emergency.

All this is fine IF the problem created doesn't include corruption of your interrupt code.

If you can add more circuitry, then you will want to add a watchdog chip, perhaps one of the MAXIM parts. Or a 555 which you just keep retriggereing before it goes low out and bangs the Pro reset pin.

If radiation is a problem, why not encase the circuit in a metal box?
Luck!

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Mon Sep 20, 2010 12:21 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
You can also enable the watchdog timer on the AtomPro. Its a little complicated to clear the watchdog(have to send several commands) but it can be enabled. You need to make sure the watchdog will not overflow while inside a basic command because the AtomPro basic library does not handle the watchdog timer clearing.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Fri Oct 01, 2010 5:19 am 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
Hi Kenjj, Hi Nathan
yäh English is not my language —

I understand how the watchdog timer works, but don’t know how to use the syntax.
But ok. I found a Max699 and it works fine. I added a small routine to see on the Display how often a reset or a power cut happen.
………………………………
My circuit is already in a metal box, but I use a lot of sensors, relays and thyristors, high power switching.
The Atom Pro seems to me is more disturbing-resistant then the Atom.
Since many Days there was no reset.
If you know a link, a sample code or good explanation how to use the syntax for the watchdog timer, I would be curios to understand it.

have a good time


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Sat Oct 02, 2010 10:55 pm 
Offline
Citizen

Joined: Thu Aug 19, 2010 9:34 pm
Posts: 17
The best thing is to prevent the crash in the first place. When your micro runs in harsh environment, use big filter capacitors on your power supply, or better yet, use power supply with battery backup / battery charger. The battery acts as a sponge. It absorbs some spikes and provides extra power on voltage dropout.

Make sure all your input / output wires use clamping diodes or transient supressors. The Atom is not built for abuse. It is built for performance. You have to provide the external protection. Yes, you can use Porsche to pull trailer, but why would you do that?


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Mon Oct 04, 2010 8:53 am 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
The Atom and AtomPro modules are fairly robust. You'd need some pretty serious noise to glitch them. But beginner is right, that you should always design your circuit for it's intended environment.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Mon Oct 04, 2010 7:04 pm 
Offline
Citizen

Joined: Thu Aug 19, 2010 9:34 pm
Posts: 17
In microcontroller world even innocent looking relay can generate 100 volt spikes (pretty serious noise) if the relay doesn't have clamping diode soldered right across the coil pins. Some relays have the diode built-in, but most do not. You can also have some 24 vac or more of inductive voltage on long wire runs in a shop. The current is very low, but still destructive to the micro over a time. There are so many factors that can cause trouble, you could write a book of misery. Ground loops can make your program crash or behave unpredictable. These things are hard to find since they're not present full time. They come and go as they please. In microcontroller design (that applies to computers as well) power supply is critical part. Don't cut corners on power supply design. Otherwise you may get memory and parity errors, program runaway and lot of crashes you won't be able to explain.


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Mon Oct 04, 2010 9:15 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
I happened to have lunch at a electronics industry show with a research scientist from Fairchild Electronics.

He was telling everyone around the table about how his lab equipment and computers would go crazy once a month. He finally figured this always happened in the middle of the last week of every month, and made it a point to limit his work to unimportant matters around that time. He explored the building a few times, trying to detect the source of the trouble, with no success. After a year of this (why so long?) he went to his department head and told him of his problem. The head just grunted," Must be Ted."

He explained that once a month "Ted" would lock himself up in a small room in this guy's section of the building to do destructive testing of high voltage suppression parts. This involved extreme voltages and currents, at numerous frequencies, and these tests usually ended in eruptions of sparks and smoke. All this mayhem was no doubt the source of this guy's problems.

The decision was made to post a message to everyone in this building announcing "Ted's" date for these tests.

Anyone in your building named Ted, Heinz?

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Sun Oct 10, 2010 1:23 pm 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
Hi kenjj..... beginner and Nathan.…. thanks for all suggestions
kenjj…not exactly Ted…
but a fluorescent lamp with induction and mechanical-contact starter……
Before this one caused sometimes a reset, even it is 10 meters away
Also a short(1-2sec) power cut made the atom sometimes to hang.
…..
I use not only a metal box, but a, external powersupply, transient supressors, kabel shielding, connected only on one site, thyristor with optocoupler and zero crossing switching, relais with antiparalell diode and a R-C filter across the contacts.
….But still before may Atom40 hang or resets from time to time.

…And it hang often, when I did not remove my programming adapter.
only the adapter, not the com-cable…..
may be reset disturbing on ATN…??
…………………….
For extensions I needed more memory, changed to the Atom40 Pro and added a Max699.The Max is not only a watchdog timer. It keeps a reset while power up, so in this way it prevents the atom to hang when a short power cut happen.
Now….since weeks the Atom Pro did not reset....
…the only way I can believe is, that the Atom Pro is more disturbing resistant….???
Heinz


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Sun Oct 10, 2010 4:03 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
It sure looks like you covered every hardware possibility.

OK, we're talking about modules here, right? To my knowlege, all the programming is done over a serial connection to a PC or Mac. What do YOU mean by
"…And it hang often, when I did not remove my programming adapter." :?:
Programming adapter?! WHAT adapter?

You can also have resets caused by software problems. F'rinstance, jumping out of GOSUBs with out using RETURNs, or nesting too many GOSUBs, causes stack overflow and leads to strange problems, even restarts.
Later.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Watchdog Timer ?? AtomPro 40
PostPosted: Mon Oct 11, 2010 4:28 am 
Offline
Citizen

Joined: Wed Mar 13, 2002 11:00 am
Posts: 32
Hi Kenjj
On the main board I have 4 pins for programming.
Between the 4 pins and the standard Com-Cable I use an adapter.
(4 pin to Com-Connector including 10 cm Cable)
And if I didn’t remove the adapter, an reset happened more often.
Heinz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO