1786f25134b737bcadb7f664d49e7a57648b6ea8
[fw/altos] / ao-bringup / turnon_teledongle
1 #!/bin/sh
2
3 echo "TeleDongle v0.2 Turn-On and Calibration Program"
4 echo "Copyright 2010 by Bdale Garbee.  Released under GPL v2"
5 echo
6 echo "Expectations:"
7 echo "\tTeleDongle v0.2 powered from USB"
8 echo "\t\twith TIdongle (on /dev/ttyACM0) cabled to debug header"
9 echo "\t\twith coax from SMA to frequency counter"
10 echo
11 echo -n "TeleDongle serial number: "
12 read SERIAL
13
14 ../ao-tools/ao-rawload/ao-rawload -r ao_led_blink.ihx
15 echo "LEDs should be blinking"
16 sleep 5
17
18 ../ao-tools/ao-rawload/ao-rawload -r ao_radio_xmit.ihx
19 echo -n "Generating RF carrier.  Please enter measured frequency: "
20 read FREQ
21
22 CAL_VALUE=`nickle -e "ceil(434.55 / $FREQ * 1186611)"`
23
24 echo "Programming flash with cal value " $CAL_VALUE
25 ao-load --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2.ihx $SERIAL
26
27 echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE
28 echo "Unplug and replug USB, cu to the board, confirm freq and record power"