From: drowe67 Date: Thu, 22 May 2008 02:00:25 +0000 (+0000) Subject: added test results, expect test script, and made wispcar output easier to parse X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=0273cc79097b3f4b4a9d11e6f75ef6cf066cef20;p=freetel-svn-tracking.git added test results, expect test script, and made wispcar output easier to parse git-svn-id: https://svn.code.sf.net/p/freetel/code@25 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/wispcar/documentation.txt b/wispcar/documentation.txt index 63bd892f..7aff1113 100644 --- a/wispcar/documentation.txt +++ b/wispcar/documentation.txt @@ -42,6 +42,11 @@ Project Plan [ ] Install in Solar powered AP (Rowetel) [ ] WP300 Testing + [ ] Test 1: false watchdog firing + + test_watchdog.tcl Exepct script + + sends 'w' every sec, look for false WD fire + + results: after approx 40 hrs, 91,000 seconds, no false firing + [ ] Test to determine watchdog doesn't fire by mistake + leave running for 1 week + stable power & router @@ -158,11 +163,11 @@ TODO List --------- [ ] schematic - [ ] pinout of 78L05 - [ ] pinout of power FET - [ ] pinout of BC548 + [X] pinout of 78L05 + [X] pinout of power FET + [X] pinout of BC548 [ ] connect + & - together on unsued op-amp sections - [ ] TAPR open harwdare license + [X] TAPR open harwdare license [X] svn repository + with datasheet pdfs ? @@ -171,6 +176,8 @@ TODO List [ ] unused LM324 inputs + check if its really OK to GND them [X] blog post +[ ] test at 5A for 24 Hrs + + given FET on-resistance do we need a heat sink? [X] README in SVN + this file [ ] Add 4th digit to sleep timer diff --git a/wispcar/test_watchdog.tcl b/wispcar/test_watchdog.tcl new file mode 100755 index 00000000..41e84117 --- /dev/null +++ b/wispcar/test_watchdog.tcl @@ -0,0 +1,38 @@ +#!/usr/local/bin/expect -f +# test_watchdog.tcl - Expect script to test wispcar watch dog timer. +# +# Assumes /etc//etc/minirc.mini4800.dfl config file configured for +# 4800 baud + +set rs232 dragonballz +set send_slow {1 0.2} +set timeout -1 + +# connect to machine with RS232 port + +spawn ssh $rs232 +expect "$ " +send "killall -9 minicom\r" +expect "$ " +send "minicom mini4800.dfl\r" + +# Keep sending 'w' every second +# This shoud mean WD _never_ times out + +set fire 0 +set count 0 +while {1} { + send "w" + expect -re "(...) (...) (.) (...) (...) (...) (.) (...) (.)" + set v $expect_out(1,string) + set w $expect_out(9,string) + if {$w == "w"} { + # watchdog has fired + set fire [expr $fire+1] + send "w" + } + set count [expr $count+1] + puts "count: $count fire: $fire" +} + +close diff --git a/wispcar/wispcar.asm b/wispcar/wispcar.asm index 03348e79..8550fa45 100644 --- a/wispcar/wispcar.asm +++ b/wispcar/wispcar.asm @@ -67,21 +67,21 @@ ; ; 4800 BAUD RS232 OUTPUT ; ====================== -; -; Vsense -; | Isense -; | | Last char received (ASCII) -; | | | Last char received (decimal) -; | | | | Watchdog timeout counter -; | | | | | Watchdog fire counter -; | | | | | | Sleep state machine state -; | | | | | | | Sleep timeout counter -; | | | | | | | | -; 040 031 032 012 000 0 000 w---reason for last restart -; b - Wispcar (re)booted -; w - watchdog timer fired -; s - we went to sleep -; +; Name of script on host that parses this line +; | Vsense +; | | Isense +; | | | char received (ASCII) +; | | | | Last char received (decimal) +; | | | | | Watchdog timeout counter +; | | | | | | Watchdog fire counter +; | | | | | | | Sleep state machine state +; | | | | | | | | Sleep timeout counter +; | | | | | | | | | +; wispcar 040 031 - 032 012 000 0 000 w---reason for last restart +; b - Wispcar (re)booted +; w - watchdog timer fired +; s - we went to sleep +; - - restart flag reset ; ; COMMANDS ; ======== @@ -334,7 +334,7 @@ inch_n_delay ; clear previous rx char - movlw ' ' + movlw '-' movwf SERBUFI ; init delay loop for 1999996 cycles @@ -407,7 +407,7 @@ inch_n1 movlw WD_TIMEOUT ; reset watchdog timer movwf wd_timeout - movlw ' ' ; clear reboot flag + movlw '-' ; clear reboot flag movwf restart_flag clrf sleep_state ; reset sleep state machine for good measure @@ -694,6 +694,26 @@ wait_adc_v btfsc ADCON0,1 ; skip if A/D conversion finished goto wait_adc_v + ; print 'wispcar' to get host to call script called wispcar. + ; This script can then parse wispcar output + + movlw 'w' + call outch_n + movlw 'i' + call outch_n + movlw 's' + call outch_n + movlw 'p' + call outch_n + movlw 'c' + call outch_n + movlw 'a' + call outch_n + movlw 'r' + call outch_n + movlw ' ' + call outch_n + ; print voltage to RS232 movf ADRES, 0