diff options
Diffstat (limited to 'ao-bringup')
| -rw-r--r-- | ao-bringup/.gitignore | 2 | ||||
| -rw-r--r-- | ao-bringup/Makefile | 58 | ||||
| -rw-r--r-- | ao-bringup/ao_bringup.h | 33 | ||||
| -rw-r--r-- | ao-bringup/ao_init.c | 28 | ||||
| -rw-r--r-- | ao-bringup/ao_led_blink.c | 50 | ||||
| -rw-r--r-- | ao-bringup/ao_radio_init.c | 251 | ||||
| -rw-r--r-- | ao-bringup/ao_radio_test.c | 18 | ||||
| -rw-r--r-- | ao-bringup/ao_radio_xmit.c | 28 | ||||
| -rw-r--r-- | ao-bringup/megametrum.cfg | 4 | ||||
| -rw-r--r-- | ao-bringup/megametrum.gdb | 2 | ||||
| -rw-r--r-- | ao-bringup/testplan | 17 | ||||
| -rwxr-xr-x | ao-bringup/turnon_telebt | 48 | ||||
| -rwxr-xr-x | ao-bringup/turnon_teledongle | 48 | ||||
| -rwxr-xr-x | ao-bringup/turnon_telemetrum | 49 | ||||
| -rwxr-xr-x | ao-bringup/turnon_telemini | 48 | ||||
| -rwxr-xr-x | ao-bringup/turnon_teleshield | 48 | ||||
| -rwxr-xr-x | ao-bringup/turnon_teleterra | 48 |
17 files changed, 780 insertions, 0 deletions
diff --git a/ao-bringup/.gitignore b/ao-bringup/.gitignore new file mode 100644 index 00000000..dc7beb52 --- /dev/null +++ b/ao-bringup/.gitignore @@ -0,0 +1,2 @@ +ao_led_blink +ao_radio_xmit diff --git a/ao-bringup/Makefile b/ao-bringup/Makefile new file mode 100644 index 00000000..7fdde985 --- /dev/null +++ b/ao-bringup/Makefile @@ -0,0 +1,58 @@ +CC=sdcc +DEBUG=--debug + +CFLAGS=--model-small --debug -I../src/core -I../src/cc1111 + +LDFLAGS=--out-fmt-ihx --code-loc 0xf000 --xram-loc 0xf400 --xram-size 1024 --iram-size 0xff + +INC = \ + ao_bringup.h + +BRINGUP_SRC = ao_init.c + +BRINGUP_REL=$(BRINGUP_SRC:.c=.rel) + +XMIT_SRC = \ + ao_radio_init.c \ + ao_radio_xmit.c +XMIT_REL=$(XMIT_SRC:.c=.rel) $(BRINGUP_REL) + +LED_SRC = \ + ao_led_blink.c + +LED_REL=$(LED_SRC:.c=.rel) $(BRINGUP_REL) + +SRC=$(BRINGUP_SRC) $(XMIT_SRC) $(LED_SRC) + +ADB=$(SRC:.c=.adb) +ASM=$(SRC:.c=.asm) +LNK=$(SRC:.c=.lnk) +LST=$(SRC:.c=.lst) +REL=$(SRC:.c=.rel) +RST=$(SRC:.c=.rst) +SYM=$(SRC:.c=.sym) + +PROGS=ao_radio_xmit.ihx ao_led_blink.ihx + +PCDB=$(PROGS:.ihx=.cdb) +PLNK=$(PROGS:.ihx=.lnk) +PMAP=$(PROGS:.ihx=.map) +PMEM=$(PROGS:.ihx=.mem) +PAOM=$(PROGS:.ihx=) + +%.rel : %.c + $(CC) -c $(CFLAGS) -o$*.rel $< + +all: $(PROGS) + +ao_radio_xmit.ihx: $(XMIT_REL) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(XMIT_REL) + +ao_led_blink.ihx: $(LED_REL) + $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(LED_REL) + +clean: + rm -f $(ADB) $(ASM) $(LNK) $(LST) $(REL) $(RST) $(SYM) + rm -f $(PROGS) $(PCDB) $(PLNK) $(PMAP) $(PMEM) $(PAOM) + +install: diff --git a/ao-bringup/ao_bringup.h b/ao-bringup/ao_bringup.h new file mode 100644 index 00000000..99fa4fba --- /dev/null +++ b/ao-bringup/ao_bringup.h @@ -0,0 +1,33 @@ +/* + * Copyright © 2009 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef _AO_BRINGUP_H_ +#define _AO_BRINGUP_H_ + +#include <stdint.h> +#include <cc1111.h> + +void +ao_radio_init(void); + +void +ao_radio_idle(void); + +void +ao_init(void); + +#endif diff --git a/ao-bringup/ao_init.c b/ao-bringup/ao_init.c new file mode 100644 index 00000000..5dababde --- /dev/null +++ b/ao-bringup/ao_init.c @@ -0,0 +1,28 @@ +/* + * Copyright © 2009 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include "ao_bringup.h" + +void +ao_init(void) +{ + CLKCON = 0; + while (!(SLEEP & SLEEP_XOSC_STB)) + ; + P1 = 0; + P1DIR = 3; +} diff --git a/ao-bringup/ao_led_blink.c b/ao-bringup/ao_led_blink.c new file mode 100644 index 00000000..1e4c143d --- /dev/null +++ b/ao-bringup/ao_led_blink.c @@ -0,0 +1,50 @@ +/* + * Copyright © 2010 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include "ao_bringup.h" + +#define nop() _asm nop _endasm; + +void +delay (unsigned char n) +{ + unsigned char i = 0, j = 0; + + n <<= 1; + while (--n != 0) + while (--j != 0) + while (--i != 0) + nop(); +} + +main() +{ + ao_init(); + /* Set p1_0 and p1_1 to output */ + P1DIR = 0x03; + P1INP = 0x00; + for (;;) { + P1 = 1; + delay(5); + P1 = 2; + delay(5); + P1 = 3; + delay(5); + P1 = 0; + delay(5); + } +} diff --git a/ao-bringup/ao_radio_init.c b/ao-bringup/ao_radio_init.c new file mode 100644 index 00000000..11932506 --- /dev/null +++ b/ao-bringup/ao_radio_init.c @@ -0,0 +1,251 @@ +/* + * Copyright © 2009 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include "ao_bringup.h" + +/* Values from SmartRF® Studio for: + * + * Deviation: 20.507812 kHz + * Datarate: 38.360596 kBaud + * Modulation: GFSK + * RF Freq: 434.549927 MHz + * Channel: 99.975586 kHz + * Channel: 0 + * RX filter: 93.75 kHz + */ + +/* + * For 434.550MHz, the frequency value is: + * + * 434.550e6 / (24e6 / 2**16) = 1186611.2 + */ + +#define FREQ_CONTROL 1186611 + +/* + * For IF freq of 140.62kHz, the IF value is: + * + * 140.62e3 / (24e6 / 2**10) = 6 + */ + +#define IF_FREQ_CONTROL 6 + +/* + * For channel bandwidth of 93.75 kHz, the CHANBW_E and CHANBW_M values are + * + * BW = 24e6 / (8 * (4 + M) * 2 ** E) + * + * So, M = 0 and E = 3 + */ + +#define CHANBW_M 0 +#define CHANBW_E 3 + +/* + * For a symbol rate of 38360kBaud, the DRATE_E and DRATE_M values are: + * + * R = (256 + M) * 2** E * 24e6 / 2**28 + * + * So M is 163 and E is 10 + */ + +#define DRATE_E 10 +#define DRATE_M 163 + +/* + * For a channel deviation of 20.5kHz, the DEVIATION_E and DEVIATION_M values are: + * + * F = 24e6/2**17 * (8 + DEVIATION_M) * 2**DEVIATION_E + * + * So M is 6 and E is 3 + */ + +#define DEVIATION_M 6 +#define DEVIATION_E 3 + +/* + * For our RDF beacon, set the symbol rate to 2kBaud (for a 1kHz tone), + * so the DRATE_E and DRATE_M values are: + * + * M is 94 and E is 6 + * + * To make the tone last for 200ms, we need 2000 * .2 = 400 bits or 50 bytes + */ + +#define RDF_DRATE_E 6 +#define RDF_DRATE_M 94 +#define RDF_PACKET_LEN 50 + +/* + * RDF deviation should match the normal NFM value of 5kHz + * + * M is 6 and E is 1 + * + */ + +#define RDF_DEVIATION_M 6 +#define RDF_DEVIATION_E 1 + +/* This are from the table for 433MHz */ + +#define RF_POWER_M30_DBM 0x12 +#define RF_POWER_M20_DBM 0x0e +#define RF_POWER_M15_DBM 0x1d +#define RF_POWER_M10_DBM 0x34 +#define RF_POWER_M5_DBM 0x2c +#define RF_POWER_0_DBM 0x60 +#define RF_POWER_5_DBM 0x84 +#define RF_POWER_7_DBM 0xc8 +#define RF_POWER_10_DBM 0xc0 + +#define RF_POWER RF_POWER_10_DBM + +static __code uint8_t radio_setup[] = { + RF_PA_TABLE7_OFF, RF_POWER, + RF_PA_TABLE6_OFF, RF_POWER, + RF_PA_TABLE5_OFF, RF_POWER, + RF_PA_TABLE4_OFF, RF_POWER, + RF_PA_TABLE3_OFF, RF_POWER, + RF_PA_TABLE2_OFF, RF_POWER, + RF_PA_TABLE1_OFF, RF_POWER, + RF_PA_TABLE0_OFF, RF_POWER, + + RF_FREQ2_OFF, (FREQ_CONTROL >> 16) & 0xff, + RF_FREQ1_OFF, (FREQ_CONTROL >> 8) & 0xff, + RF_FREQ0_OFF, (FREQ_CONTROL) & 0xff, + + RF_FSCTRL1_OFF, (IF_FREQ_CONTROL << RF_FSCTRL1_FREQ_IF_SHIFT), + RF_FSCTRL0_OFF, (0 << RF_FSCTRL0_FREQOFF_SHIFT), + + RF_MDMCFG4_OFF, ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) | + (CHANBW_M << RF_MDMCFG4_CHANBW_M_SHIFT) | + (DRATE_E << RF_MDMCFG4_DRATE_E_SHIFT)), + RF_MDMCFG3_OFF, (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT), + RF_MDMCFG2_OFF, (RF_MDMCFG2_DEM_DCFILT_OFF | + RF_MDMCFG2_MOD_FORMAT_GFSK | + RF_MDMCFG2_SYNC_MODE_15_16_THRES), + RF_MDMCFG1_OFF, (RF_MDMCFG1_FEC_EN | + RF_MDMCFG1_NUM_PREAMBLE_4 | + (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)), + RF_MDMCFG0_OFF, (17 << RF_MDMCFG0_CHANSPC_M_SHIFT), + + RF_CHANNR_OFF, 0, + + RF_DEVIATN_OFF, ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) | + (DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)), + + /* SmartRF says set LODIV_BUF_CURRENT_TX to 0 + * And, we're not using power ramping, so use PA_POWER 0 + */ + RF_FREND0_OFF, ((1 << RF_FREND0_LODIV_BUF_CURRENT_TX_SHIFT) | + (0 << RF_FREND0_PA_POWER_SHIFT)), + + RF_FREND1_OFF, ((1 << RF_FREND1_LNA_CURRENT_SHIFT) | + (1 << RF_FREND1_LNA2MIX_CURRENT_SHIFT) | + (1 << RF_FREND1_LODIV_BUF_CURRENT_RX_SHIFT) | + (2 << RF_FREND1_MIX_CURRENT_SHIFT)), + + RF_FSCAL3_OFF, 0xE9, + RF_FSCAL2_OFF, 0x0A, + RF_FSCAL1_OFF, 0x00, + RF_FSCAL0_OFF, 0x1F, + + RF_TEST2_OFF, 0x88, + RF_TEST1_OFF, 0x31, + RF_TEST0_OFF, 0x09, + + /* default sync values */ + RF_SYNC1_OFF, 0xD3, + RF_SYNC0_OFF, 0x91, + + /* max packet length */ + RF_PKTLEN_OFF, 64, + + RF_PKTCTRL1_OFF, ((1 << PKTCTRL1_PQT_SHIFT)| + PKTCTRL1_APPEND_STATUS| + PKTCTRL1_ADR_CHK_NONE), + RF_PKTCTRL0_OFF, (RF_PKTCTRL0_WHITE_DATA| + RF_PKTCTRL0_PKT_FORMAT_NORMAL| + RF_PKTCTRL0_CRC_EN| + RF_PKTCTRL0_LENGTH_CONFIG_FIXED), + RF_ADDR_OFF, 0x00, + RF_MCSM2_OFF, (RF_MCSM2_RX_TIME_END_OF_PACKET), + RF_MCSM1_OFF, (RF_MCSM1_CCA_MODE_RSSI_BELOW_UNLESS_RECEIVING| + RF_MCSM1_RXOFF_MODE_IDLE| + RF_MCSM1_TXOFF_MODE_IDLE), + RF_MCSM0_OFF, (RF_MCSM0_FS_AUTOCAL_FROM_IDLE| + RF_MCSM0_MAGIC_3| + RF_MCSM0_CLOSE_IN_RX_0DB), + RF_FOCCFG_OFF, (RF_FOCCFG_FOC_PRE_K_3K, + RF_FOCCFG_FOC_POST_K_PRE_K, + RF_FOCCFG_FOC_LIMIT_BW_OVER_4), + RF_BSCFG_OFF, (RF_BSCFG_BS_PRE_K_2K| + RF_BSCFG_BS_PRE_KP_3KP| + RF_BSCFG_BS_POST_KI_PRE_KI| + RF_BSCFG_BS_POST_KP_PRE_KP| + RF_BSCFG_BS_LIMIT_0), + RF_AGCCTRL2_OFF, 0x43, + RF_AGCCTRL1_OFF, 0x40, + RF_AGCCTRL0_OFF, 0x91, + + RF_IOCFG2_OFF, 0x00, + RF_IOCFG1_OFF, 0x00, + RF_IOCFG0_OFF, 0x00, + + RF_MDMCFG4_OFF, ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) | + (CHANBW_M << RF_MDMCFG4_CHANBW_M_SHIFT) | + (DRATE_E << RF_MDMCFG4_DRATE_E_SHIFT)), + RF_MDMCFG3_OFF, (DRATE_M << RF_MDMCFG3_DRATE_M_SHIFT), + RF_MDMCFG2_OFF, (RF_MDMCFG2_DEM_DCFILT_OFF | + RF_MDMCFG2_MOD_FORMAT_GFSK | + RF_MDMCFG2_SYNC_MODE_15_16_THRES), + RF_MDMCFG1_OFF, (RF_MDMCFG1_FEC_EN | + RF_MDMCFG1_NUM_PREAMBLE_4 | + (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)), + + RF_DEVIATN_OFF, ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) | + (DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)), + + /* max packet length */ + RF_PKTLEN_OFF, 0xff, + RF_PKTCTRL1_OFF, ((1 << PKTCTRL1_PQT_SHIFT)| + PKTCTRL1_APPEND_STATUS| + PKTCTRL1_ADR_CHK_NONE), + RF_PKTCTRL0_OFF, (RF_PKTCTRL0_WHITE_DATA| + RF_PKTCTRL0_PKT_FORMAT_NORMAL| + RF_PKTCTRL0_CRC_EN| + RF_PKTCTRL0_LENGTH_CONFIG_FIXED), +}; + +void +ao_radio_idle(void) +{ + if (RF_MARCSTATE != RF_MARCSTATE_IDLE) + { + RFST = RFST_SIDLE; + do { + ; + } while (RF_MARCSTATE != RF_MARCSTATE_IDLE); + } +} + +void +ao_radio_init(void) { + uint8_t i; + for (i = 0; i < sizeof (radio_setup); i += 2) + RF[radio_setup[i]] = radio_setup[i+1]; +} diff --git a/ao-bringup/ao_radio_test.c b/ao-bringup/ao_radio_test.c new file mode 100644 index 00000000..8efb03cc --- /dev/null +++ b/ao-bringup/ao_radio_test.c @@ -0,0 +1,18 @@ +/* + * Copyright © 2009 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include "ao_bringup.h" diff --git a/ao-bringup/ao_radio_xmit.c b/ao-bringup/ao_radio_xmit.c new file mode 100644 index 00000000..be3333af --- /dev/null +++ b/ao-bringup/ao_radio_xmit.c @@ -0,0 +1,28 @@ +/* + * Copyright © 2009 Keith Packard <keithp@keithp.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include "ao_bringup.h" + +main () +{ + ao_init(); + ao_radio_init(); + ao_radio_idle(); + RFST = RFST_STX; + P1 = 1; + for (;;); +} diff --git a/ao-bringup/megametrum.cfg b/ao-bringup/megametrum.cfg new file mode 100644 index 00000000..e95c6f2b --- /dev/null +++ b/ao-bringup/megametrum.cfg @@ -0,0 +1,4 @@ +# openocd config for MegaMetrum using the Olimex ARM-USB-OCD dongle + +source /opt/stm32/share/openocd/scripts/interface/olimex-arm-usb-ocd.cfg +source /opt/stm32/share/openocd/scripts/target/stm32l.cfg diff --git a/ao-bringup/megametrum.gdb b/ao-bringup/megametrum.gdb new file mode 100644 index 00000000..964ae1f3 --- /dev/null +++ b/ao-bringup/megametrum.gdb @@ -0,0 +1,2 @@ +target remote localhost:3333 +monitor poll diff --git a/ao-bringup/testplan b/ao-bringup/testplan new file mode 100644 index 00000000..2c0e4e08 --- /dev/null +++ b/ao-bringup/testplan @@ -0,0 +1,17 @@ +Low level hardware tests + + * cpu + * barometer + * accelerometer + * flash + * gps + * igniter continuity + * igniters + * radio calibration + * led + +Higher level tests + + * USB serial communication + * memory flashing + * reading/writing eeprom diff --git a/ao-bringup/turnon_telebt b/ao-bringup/turnon_telebt new file mode 100755 index 00000000..3b8bd3e4 --- /dev/null +++ b/ao-bringup/turnon_telebt @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleBT v0.1 Turn-On and Calibration Program" +echo "Copyright 2011 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleBT v0.1 powered from USB" +echo "\t\twith TeleDonle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith coax from SMA to frequency counter" +echo +echo -n "TeleBT serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD -D 100 -r ao_led_blink.ihx +echo "LEDs should be blinking" +sleep 5 + +$RAWLOAD -D 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD -D 100 --cal $CAL_VALUE /usr/share/altos/telebt-v0.1*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle new file mode 100755 index 00000000..320cd8ff --- /dev/null +++ b/ao-bringup/turnon_teledongle @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleDongle v0.2 Turn-On and Calibration Program" +echo "Copyright 2010 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleDongle v0.2 powered from USB" +echo "\t\twith TIdongle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith coax from SMA to frequency counter" +echo +echo -n "TeleDongle serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD -D 100 -r ao_led_blink.ihx +echo "LEDs should be blinking" +sleep 5 + +$RAWLOAD -D 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD -D 100 --cal $CAL_VALUE /usr/share/altos/stable/teledongle-v0.2*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_telemetrum b/ao-bringup/turnon_telemetrum new file mode 100755 index 00000000..faf49d43 --- /dev/null +++ b/ao-bringup/turnon_telemetrum @@ -0,0 +1,49 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleMetrum v1.2 Turn-On and Calibration Program" +echo "Copyright 2010 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleMetrum v1.2 powered from USB" +echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith coax from UHF to frequency counter" +echo +echo -n "TeleMetrum serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD --device 100 -r ao_led_blink.ihx +echo "the red LED should be blinking" +sleep 5 + +$RAWLOAD --device 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD --device 100 --cal $CAL_VALUE \ + /usr/share/altos/stable/telemetrum-v1.2*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_telemini b/ao-bringup/turnon_telemini new file mode 100755 index 00000000..4450d6f6 --- /dev/null +++ b/ao-bringup/turnon_telemini @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleMini v1.0 Turn-On and Calibration Program" +echo "Copyright 2011 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleMini v1.0 powered from LiPo" +echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith frequency counter able to sample RF output" +echo +echo -n "TeleMini serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD -D 100 -r ao_led_blink.ihx +echo "LEDs should be blinking" +sleep 5 + +$RAWLOAD -D 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD -D 100 --cal $CAL_VALUE /usr/share/altos/stable/telemini-v1.0*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_teleshield b/ao-bringup/turnon_teleshield new file mode 100755 index 00000000..e9f651fb --- /dev/null +++ b/ao-bringup/turnon_teleshield @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleShield v0.1 Turn-On and Calibration Program" +echo "Copyright 2012 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleShield v0.1 powered from USB" +echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith coax from SMA to frequency counter" +echo +echo -n "TeleShield serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD -D 100 -r ao_led_blink.ihx +echo "LEDs should be blinking" +sleep 5 + +$RAWLOAD -D 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD -D 100 --cal $CAL_VALUE /home/bdale/debian/altos/src/teleshield-v0.1/*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" diff --git a/ao-bringup/turnon_teleterra b/ao-bringup/turnon_teleterra new file mode 100755 index 00000000..b63da2ff --- /dev/null +++ b/ao-bringup/turnon_teleterra @@ -0,0 +1,48 @@ +#!/bin/sh + +if [ -x ../ao-tools/ao-load/ao-load ]; then + AOLOAD=../ao-tools/ao-load/ao-load +elif [ -x /usr/bin/ao-load ]; then + AOLOAD=/usr/bin/ao-load +else + echo "Can't find ao-load! Aborting." + exit 1 +fi + +if [ -x ../ao-tools/ao-rawload/ao-rawload ]; then + RAWLOAD=../ao-tools/ao-rawload/ao-rawload +elif [ -x /usr/bin/ao-rawload ]; then + RAWLOAD=/usr/bin/ao-rawload +else + echo "Can't find ao-rawload! Aborting." + exit 1 +fi + +echo "TeleTerra v0.2 Turn-On and Calibration Program" +echo "Copyright 2012 by Bdale Garbee. Released under GPL v2" +echo +echo "Expectations:" +echo "\tTeleTerra v0.2 powered from USB" +echo "\t\twith TeleDongle (on /dev/ttyACM0) cabled to debug header" +echo "\t\twith coax from SMA to frequency counter" +echo +echo -n "TeleTerra serial number: " +read SERIAL + +echo $RAWLOAD + +$RAWLOAD -D 100 -r ao_led_blink.ihx +echo "LEDs should be blinking" +sleep 5 + +$RAWLOAD -D 100 -r ao_radio_xmit.ihx +echo -n "Generating RF carrier. Please enter measured frequency: " +read FREQ + +CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"` + +echo "Programming flash with cal value " $CAL_VALUE +$AOLOAD -D 100 --cal $CAL_VALUE /home/bdale/debian/altos/src/teleterra-v0.2/*.ihx $SERIAL + +echo "Serial number "$SERIAL" programmed with RF cal value "$CAL_VALUE +echo "Unplug and replug USB, cu to the board, confirm freq and record power" |
