Log in

View Full Version : USB watchdog timer



axeman
- 10th September 2010, 13:23
Hi All,

looking to make a USB watchdog timer. ie PIC circuit connected via USB (I know the new chips have USB support) and software running on PC. software on PC sends 'something' every 30 seconds etc. PIC is monitoring, looking for these keepalives. if Keepalive no received in 60 minutes then drop power relay pin to reboot PC - simple.

I see there are some USB commands in PICBASIC - but has anyone used them to do anything like I'm talking about there - could it be done in PICBASIC (without ASY code)

this is pretty close to what I'm looking for : http://www.j-works.com/wdt284.php

ScaleRobotics
- 11th September 2010, 02:23
I know you asked not in assembly code ... but ....

You might be interested in an article from Nuts and Volts magazine August 2010 on page 39, called the WatchPuppy. It does pretty much just what you are talking about, and uses a pic chip 16f873 and a UM232R usb to serial converter.

I'm sure it is covered in copyright protection, so I can't attach the article. You would have to find the magazine.

But here is the code:
http://radiosky.com/WatchPuppy/

mackrackit
- 11th September 2010, 04:00
Why not just increment a VAR with a timer. When a Keep Alive is received the VAR drops back to zero. If the VAR reaches "X" then re-boot.

No ASM if PBP interrupts are used.

axeman
- 11th September 2010, 04:14
yes that's the basic idea in the code. the core code like that seems to be the easy part - how are you going to;

1. listen to a USB port for certain event? what will the event look like, what will the PICBASIC code look like?

2. Write a program in Windows(7) that does the PC side of sending that 'event' down the USB cable which ultimately resets the watchdog timer etc.

axeman
- 11th September 2010, 04:16
You might be interested in an article from Nuts and Volts magazine August 2010 on page 39, called the WatchPuppy. It does pretty much just what you are talking about, and uses a pic chip 16f873 and a UM232R usb to serial converter.

thanks! you forced me to subscribe.. but that's probably a good thing anyways.

it looks ideal. ie the article you refer to.

But, in the spirit of invention.. does anyone know how to make one in PIC basic.. I guess I just like the idea of building it myself :-)

mackrackit
- 11th September 2010, 04:21
This might help you out.
http://www.picbasic.co.uk/forum/content.php?r=178-USB-CDC-Communications-for-Dummies!

USBIN on the MCU side. A simple program on the PC to send data.

axeman
- 11th September 2010, 04:25
This might help you out.
http://www.picbasic.co.uk/forum/content.php?r=178-USB-CDC-Communications-for-Dummies!

USBIN on the MCU side. A simple program on the PC to send data.

that's a great little article! .. I think I need to learn VB to write a small app that sends something down the COM port ...

mackrackit
- 11th September 2010, 04:35
Here just happens to be a thread on VB and serial running.

Might find everything you need. One stop shop.

Let us know how it goes. Intersting project.

axeman
- 11th September 2010, 04:40
Here just happens to be a thread on VB and serial running.

?? where :-)

mackrackit
- 11th September 2010, 04:44
http://www.picbasic.co.uk/forum/showthread.php?t=13609

Sorry , that is the second time I did that today.