Shop OBEX P1 Docs P2 Docs Learn Events
watchdog classes — Parallax Forums

watchdog classes

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2010-04-17 00:55 in General Discussion
I have uploaded some watchdog classes here:
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/peripheral/watchdog/

There are:
Watchdog.java - abstract superclass for all watchdog classes
SoftWatchdog.java - class that implements a watchdog using a timer object
Max690.java - class for Maxim MAX690 watchdog ic. This can be used for all Maxim watchdog ic's
that have a three-state watchdog pin (usually called wdi)

regards peter

Comments

  • jmspaggijmspaggi Posts: 629
    edited 2010-04-15 01:14
    Hi Peter,

    Max690 seems to not been sold anymore. Too hold.

    Will any of those been a good replacement? www.maxim-ic.com/quick_view2.cfm/qv_pk/2226

    There is Open-Drain and Open-Drain. Which one should I choosed?

    Or do you have a better one to suggest? I really like MAX6373 / MAX6374 because of the first edge minimum startup delay option. That way, you don't have to worrie how long it will take the Javelin need to restart.

    Can I connect it to the serial communication to the terminal? That way it will not reset when I will re-program the Javelin... Or that will corrupt serial communication?

    Thanks,

    JM
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2010-04-15 10:26
    I have used the MAX6301.
    You simply set the timeoutperiod with a single capacitor.
    After the 6301 has asserted its reset output (250msec pulse if I am correct)
    it won't activate the watchdog function until there has been a pulse on the WDI input.
    Allow a timeoutperiod of 5 seconds so if you program the javelin it will first fail due to reset
    but then program it again. The trick is not to issue a pulse to WDI for the first minute or so.
    That gives you plenty of time to reprogram the javelin.
    You can also add a jumper to disconnect the 6301 from the javelin reset pin.


    I used this connection

    ················ +5v
    ················· |
    ················ [noparse][[/noparse]1K]
    ················· |
    ················ ---
    ················ \ /· LED (activity monitor, optional)
    ·················---
    ················· |
    Jav IO pin o
    +
    o WDI 6301

    Jav RESET pin o
    o RESET out 6301


    regards peter
  • jmspaggijmspaggi Posts: 629
    edited 2010-04-15 12:35
    Hi Peter,

    Thanks for your reply. I will go with this solution. That will save me a lot of time.

    On the datasheet http://datasheets.maxim-ic.com/en/ds/MAX6301-MAX6304.pdf they are using caps for the timeout. Should I just leave those pins free?

    Thanks,

    JM
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2010-04-15 13:16
    You must connect caps to set the reset pulsewidth and the timeout period.
    And you must use extended mode (see page 6/7 Watchdog timer.

    et Reset-Timeout Input. Connect a capacitor between this input and ground to select the reset timeout

    period (tRP). Determine the period as follows: tRP = 2.67 x CSRT, with CSRT in pF and tRP in μs

    tRP = 267 ms = 267000 us = 2.67 x CSRT
    CSRT = 100000 pF = 100 nF = 0.1 uF

    Set Watchdog-Timeout Input. Connect a capacitor between this input and ground to select the basic
    watchdog timeout period (tWD). Determine the period as follows: tWD = 2.67 x CSWT, with CSWT in pF and

    tWD in μs. The watchdog function can be disabled by connecting this pin to ground.

    tWD = 13.35 s / 500 = 26.7 ms = 26700 us = 2.67 x CSWT
    CSWT = 10000 pF = 10 nF = 0.01 uF

    Watchdog-Select Input. This input selects the watchdog mode. Connect to ground to select normal mode
    and the basic watchdog timeout period. Connect to VCC to select extended mode, multiplying the basic
    timeout period by a factor of 500. A change in the state of this pin resets the watchdog timer to zero.

    Tie WDS (and RESET IN) to +5V. This enables extended mode with 500 x 26.7 ms = 13.35 sec timeout period.

    regards peter

  • jmspaggijmspaggi Posts: 629
    edited 2010-04-15 13:42
    Ok, thanks. I will do that.

    I will buy the component today or tomorrow, and post a status when it will be done.

    JM
  • jmspaggijmspaggi Posts: 629
    edited 2010-04-16 19:13
    Hi Peter,

    I have connected everything expect the reset, and the 2 caps. I only have 0.1 uF caps. Do you think I can put that for both Cswt and Csrt?

    Because I tried, but the watchdog is never reseting. I have not connected it to the Javelin but the a LED do "see" the result...

    JM
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2010-04-16 20:00
    Here is the schematic I used.
    The 0.1uF (100nF) should do fine.

    regards peter
  • jmspaggijmspaggi Posts: 629
    edited 2010-04-16 20:49
    That's what I did. But my LED is not turning on. My activity LED is blinking. The other one, on the reset output, is not, even with I stop the pulse.

    Ok. I will try to review everything. Also, I will try to change the caps to get WD>60s. So I will be able to re-programme the Javelin without getting the reset...

    Again, I will keep the list posted when it will works. So far, it's not [noparse]:([/noparse]

    JM
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2010-04-16 22:36
    Its an open drain output.

    reset out o----|<|--[noparse][[/noparse]1k]--- +5V

    Led turns on when reset output goes low. It will stay low for about 0.25 sec
    so all you will see is a very short flash.

    regards peter
  • jmspaggijmspaggi Posts: 629
    edited 2010-04-17 00:55
    Hi Peter,

    Finally I configured it in normal mode instead of extend one, and it seems to be working with the caps I have. The timeout period is about 5s (10s if I put only 1 cap), and the reset period is quite short, but I have the time to see it.

    My concern is that when it reach the timeout, it's resetting the Javelin every 10 seconds... Which did not give it the time to start the main loop.

    So I increased the timeout to 90 seconds by putting 9 x 4.7 caps in parallele. Now I have a 90 seconds timeout, which give me enought time to reset the Javelin or reprogram it. I will just have to buy a 47 cap when I will have time. Also, a 90 seconds timeout is not an issue for my application. But can be for others. so values might have to be adjusted.

    The only remaining issue will be to find a way to connect to the Javelin Reset pin because the demo board don't really allow that.

    Also, I found what my propeller will be used for. I will use it as a Javelin PIN extension kit to add 30 I/O to the Javelin instead of using DC-16.

    Thanks again for your priceless support!

    JM
Sign In or Register to comment.