Backpaq
From MoDe
| Table of contents |
These accessories are considered priceless as they are no longer being made - please be careful with them.
Backpaq Accelerometer
The accelerometer is not really an "accelerometer" since it only detects orientation based on gravity. If you want to use it, you'll need to install a bunch of packages. First, do:
root@h3900:~# ipkg install kernel-module-h3600-backpaq-accel-2.4 root@h3900:~# ipkg install backpaq-firmware
The first command (should) installs 3 kernel modules. They are:
/lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/pcmcia/h3600_backpaq.o /lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/char/h3600_backpaq_fpga.o /lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/char/h3600_backpaq_accel.o
The second command installs 2 binaries used to program the fpga:
/etc/fpga_test_fifo.4349.bin /etc/fpga_test_fifo.4345.bin
After installing, insert the ipaq into the backpaq sleeve, then load the kernel modules by doing:
root@h3900:~# modprobe h3600_backpaq_accel Using /lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/pcmcia/h3600_backpaq.o Using /lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/char/h3600_backpaq_fpga.o Using /lib/modules/2.4.19-rmk6-pxa1-hh39/kernel/drivers/char/h3600_backpaq_accel.o
Check the modules have been loaded correctly with "lsmod" - you should see the 3 modules listed above somewhere. Additionally, you should have the following files in /proc/backpaq and /dev/backpaq:
root@h3900:~# ls /proc/backpaq/ accel activate_flash activate_pcmcia eeprom fpga root@h3900:/proc/backpaq# ls /dev/backpaq/ accel cam_accel cam_accel_xyz fpga
If not, then reboot your ipaq and try reloading the modules again. If after several tries it still doesn't show up, then your backpaq is probably broken.
Once that's done, check the status of the fpga by doing:
root@h3900:~# cat /proc/backpaq/fpga
f2000000 Major version : ffff
f2000004 Firmware version : ffff
f2000008 FPGA control : ffff
f200000c FPGA status : ffff
f2000010 FPGA program : ffff
f2000014 PCMCIA power : ffff
f2000018 Flash control : ffff
f200001c General control : ffff
f2800080 FPGA firmware rev : ffff
f280008c Camera live mode : ffff
f2800090 Camera integration time : ffff
f2800094 Camera clock divisor : ffff
f2800098 Camera fifo information : ffff
f280009c Camera fifo data available : ffff
f28000a0 Camera fifo status : ffff
f28000a4 Camera row count : ffff
f28000ac Camera integration command : ffff
f28000b0 Camera interrupt fifo : ffff
f28000b4 Interrupt mask : ffff
f28000b8 Interrupt status : ffff
Busy count : 0
Bytes written : 0
Usage count : 0
FPGA program status : Not programmed
Sometimes the fgpa status says "OK" or "CRC Error" instead of "Not programmed", but that's ok.
Next, program the fpga by doing:
root@h3900:~# cat /etc/fpga_test_fifo.4349.bin > /dev/backpaq/fpga (invoke VOODOO MAGIC!!)
root@h3900:~# cat /proc/backpaq/fpga
f2000000 Major version : ffff
f2000004 Firmware version : ffff
f2000008 FPGA control : ffff
f200000c FPGA status : ffff
f2000010 FPGA program : ffff
f2000014 PCMCIA power : ffff
f2000018 Flash control : ffff
f200001c General control : ffff
f2800080 FPGA firmware rev : 4349
f280008c Camera live mode : 0000
f2800090 Camera integration time : 0000
f2800094 Camera clock divisor : 0040
f2800098 Camera fifo information : 0820
f280009c Camera fifo data available : 0000
f28000a0 Camera fifo status : 0302
f28000a4 Camera row count : 00e2
f28000ac Camera integration command : 0000
f28000b0 Camera interrupt fifo : 00bf
f28000b4 Interrupt mask : ffff
f28000b8 Interrupt status : 0000
Busy count : 153916
Bytes written : 234456
Usage count : 0
FPGA program status : Okay
The lines highlighted in bold are the ones the check. If, for whatever reason, the output differs (e.g., the status line says "CRC Error" or "Bad Lines"), then reboot and try again.
To check the status of the accelerometer, do:
root@h3900:~# cat /proc/backpaq/accel
f28000c0 Duration Xt1 : 0x58e9
f28000c4 Duration Xt2 : 0x343c
f28000c8 Duration Yt1 : 0x4833
f28000cc Duration Yt2 : 0x44ab
f2800008 Cam Duration Xt1 : 0x50d6
f280000c Cam Duration Xt2 : 0x38bb
f2800010 Cam Duration Yt1 : 0x4420
f2800014 Cam Duration Yt2 : 0x4576
f2800018 Cam Duration Zt1 : 0x3514
f280001c Cam Duration Zt2 : 0x531a
Calibration xoffset : 0x8000
Calibration xscale : 0x8000
Calibration yoffset : 0x8000
Calibration yscale : 0x8000
Cam Calibration xoffset : 0x8000
Cam Calibration xscale : 0x8000
Cam Calibration yoffset : 0x8000
Cam Calibration yscale : 0x8000
Cam Calibration zoffset : 0x8000
Cam Calibration zscale : 0x8000
Calculated acceleration X : 0x010a (+1.039 g)
Calculated acceleration Y : 0x0019 (+0.097 g)
Calculated acceleration X : 0x00b3 (+0.699 g)
Calculated acceleration Y : 0xfff6 (-0.039 g)
Calculated acceleration Z : 0xff1e (-0.882 g)
Hopefully, you get a reading similar to the last ones highlighted. If so, then you have a working accelerometer.
To use the accelerometer with python. install the following package:
root@h3900:~# ipkg install pyaccelerometer
This installs the accelerometer.py module to /usr/lib/python2.4/site-packages. You can execute the module by doing "python accelerometer.py", which outputs a bunch of (x,y) readings pertaining to orientation.
==========================
To install the "kernel-module-h3600-backpaq-accel-2.4", the following feed can be added to the "ipkg.conf"
"http://www.gtlib.gatech.edu/pub/handhelds.org/feeds/unstable/"
Backpaq Camera
TODO
Backpaq Flash
TODO
--Ning (mailto:nsong@csail.mit.edu)
Last edit: 3/06/06
