Hi,
I use this:
PIC 10F200 source code:
/*
File: main.c
Author: arsi
Created on May 22, 2015, 10:32 AM
*/
#include <xc.h>
#include <stdbool.h>
#include <stdint.h>
#define _XTAL_FREQ 4000000
#pragma config WDTE = ON// Watchdog Timer (WDT enabled)
#pragma config CP = OFF// Code Protect (Code protection off)
#pragma config MCLRE = OFF// Master Clear Enable (GP3/MCLR pin fuction is
digital I/O, MCLR internally tied to VDD)
void delay1() {
__delay_ms(1000);
}
bool flag =false;
int counter = 0;
void main(void) {
#asm
CLRWDT
CLRF TMR0
CLRWDT
MOVLW 0b00001111
OPTION
#endasm
CLRWDT();
TRIS = 0b1110;
CLRWDT();
GP0 = 0;
__delay_ms(500);
CLRWDT();
TRIS = 0b1111;
CLRWDT();
//pause for BBB boot up
for (int i = 0; i < 120; i++) {
delay1();
CLRWDT();
}
counter = 0;
while (true) {
delay1();
if (counter < 120) {
CLRWDT();
}
if (flag != GP1) {
counter = 0;
flag = GP1;
}else {
counter++;
}
}
}
*******************************************************************************************
wd script on BBB:
#!/bin/bash
sleep 10
echo 60 > /sys/class/gpio/export
echo"out" > /sys/class/gpio/gpio60/direction
while :
do
echo"0" > /sys/class/gpio/gpio60/value
sleep 1
echo"1" > /sys/class/gpio/gpio60/value
sleep 1
done
***********************************************************************************************
Arsi
------------------------------------------------------------------------
*From:* Kb2pnm
*Sent:* Saturday, March 22, 2014 6:08PM
*To:* Beagleboard
*Subject:* [beagleboard] Hardware watchdog for BBB
HI, I have been working for a wile on safe power supply for BBB with
backup power provided by supercapacitors. In case of power failure there
is just enough time to safely and nicely shut down BBB. For some
reason BBB does not always wake up fully. I need hardware dogwatch. Did
anybody design such a thing? I was able to find some design for ardunio:
http://www.playwitharduino.com/?p=291.
Anybody has any experience with hardware dogwatch for BBB??
Thanks in advance
Robert
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google
Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/57397009.2000005%40chello.sk.
For more options, visit https://groups.google.com/d/optout.