1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-26 00:39:20 +02:00
ben-wpan/prod/atben
Werner Almesberger 39c37258c5 prod/: P_ON test for atusb can't work as intended ... because we're not in P_ON
The explanation is simple: reset from any state but P_ON throws us
back into TRX_OFF, not P_ON. That's why the P_ON test only worked
predictably after power-cycling the board.

- prod/atusb (gpio_usb): removed P_ON test
- prod/atben (gpio_ben): added comment to P_ON test explaining why
  it works in this case
2011-06-12 07:46:26 -03:00

82 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
. ./Common
gpio_ben()
{
# MMC DDCCDD
# 10KM32
#
# SMSMnI
# CITOSR
# Ben pull-up * * = no PU
# Reset pull v-vv^-
#
# P_ON state (after reset; transceiver pull-up/downs active)
# (Note: this only works on atben because we power-cycle to reset)
step "GPIO scan (P_ON)"
cmd "$LOCAL_EXEC \"atrf-gpio -d $LOCAL_DUT -p \
zzozho '# reset state' \
0zozho '# test SCLK' \
zz1zho '# test SLP_TR' \
zzo0ho '# test MOSI' \
zzoz0o '# test nSEL'\""
doit
# TRX_OFF state (transceiver pull-up/downs inactive)
step "GPIO scan (TRX_OFF)"
cmd "$LOCAL_EXEC \"atrf-gpio -d $LOCAL_DUT \
hHHhho '# TRX_OFF state' \
0HHhho '# test SCLK' \
00Hhho '# test MISO' \
hH0hho '# test SLP_TR' \
hHH0ho '# test MOSI' \
hzHh0o '# test nSEL'\""
doit
# INT
step "GPIO scan (INT)"
cmd "$LOCAL_EXEC \"atrf-gpio -d $LOCAL_DUT -p \
xxxxxo '# reset state' \
0x04=1 '# TRX_CTRL_1.IRQ_POLARITY = 1' \
xxxxxh '# test INT (1)' \
xxxx0h '# test INT (2)' \
xxxx1h '# restore nSEL' \
0x04=0 '# TRX_CTRL_1.IRQ_POLARITY = 0' \
xxxxho '# test INT again'\""
doit
# SLP_TR
step "GPIO scan (SLP_TR)"
cmd "$LOCAL_EXEC \"atrf-gpio -d $LOCAL_DUT \
'00!85' '# write 0x55 to the buffer' \
00/85 '# read back the buffer value' \
xx1hxo '# enter SLEEP' \
xx0hxo '# leave SLEEP' \
00/0xff '# read back the buffer value'\""
doit
}
xtal_ben()
{
step "Crystal frequency"
cmd "$LOCAL_EXEC atrf-xtal -d $LOCAL_DUT -b \\\`cat $CLKREF\\\` -p 50 100"
expect_re ppm # we catch any problems via the exit code
}
begin ben.profile ben.xtal
# power ?
gpio_ben
identify
xtal_ben
spectrum
transmit