| : |
BBMC is a small utility for bit banging functions on the mc13224v using libftidi. BBMC let's you to erase and reset Redbee Econotags and similar hardware.
BBMC is part of the libmc1322x package. You can find it in libmc1322x/tools/ftditools
You need the libftdi 0.17 or later. To get the required development library in Debian you can:
$ apt-get install $ apt-cache policy libftdi-dev
libftdi-dev:
Installed: 0.17-1+b1
Candidate: 0.17-1+b1
Version table:
*** 0.17-1+b1 0
80 http://ftp.debian.org testing/main Packages
50 http://ftp.debian.org unstable/main Packages
100 /var/lib/dpkg/status
0.13-2 0
200 http://ftp.debian.org stable/main Packages
$ apt-get install libftdi-dev/testing
at the time of this writing, 0.17 was available in testing or later.
Then run make in the ftditools directory.
$ cd tools/ftditools $ make cc -Wall -Wextra -lftdi bbmc.c -o bbmc
Erase a redbee econotag:
./bbmc -l redbee-econotag erase Found 1 devices with vendor id 0x0403 product id 0x6010 Opening device 0 interface 1 using layout redbee-econotag setting VREF2 erase toggle reset waiting for erase setting VREF2 normal toggle reset done.
If you have multiple devices with the same vendor and product id (e.g. multiple econotags) you will be prompted for which device to use:
./bbmc -l redbee-econotag erase Found 2 devices with vendor id 0x0403 product id 0x6010 [0] Manufacturer: FTDI, Description: Dual RS232-HS, Serial ? [1] Manufacturer: FTDI, Description: Dual RS232-HS, Serial ? Use which device? 1 Opening device 1 interface 1 using layout redbee-econotag setting VREF2 erase toggle reset waiting for erase setting VREF2 normal toggle reset done.
You can do the same thing but avoid the prompt with the "-i" switch:
$ ./bbmc -l redbee-econotag -i 1 erase Found 2 devices with vendor id 0x0403 product id 0x6010 Opening device 1 interface 1 using layout redbee-econotag setting VREF2 erase toggle reset waiting for erase setting VREF2 normal toggle reset done.
The full usage is shown below:
$ ./bbmc --help
Usage: bbmc [options|overrides] -l|--layout layout command
Commands:
reset: Toggles reset pin
erase: Sets VREF2 erase mode; toggles reset; waits 2 sec.; sets normal; toggles reset again
Required options:
-l|--layout specifiy which board layout to use
layout is not necessary with a full
set of overrides
Layout overrides:
--interface FTDI interface to use
--dir direction (1 is output)
--reset_release reset release command
--reset_set reset set command
--vref2_normal vref2 normal
--vref2_erase vref2 erase
Layouts:
redbee-econotag: Redbee Econotag
interface: 0x0001
dir: 0xc400
reset release: 0x0400
reset hold: 0x0000
vref2 normal: 0x4000
vref2 erase: 0x8000
redbee-usb: Redbee USB stick
interface: 0x0002
dir: 0x0460
reset release: 0x0400
reset hold: 0x0000
vref2 normal: 0x0040
vref2 erase: 0x0020
Options:
-i|--index specifiy which device to use (default 0)
-v|--vendor set vendor id (default 0x0403)
-p|--product set vendor id (default 0x6010)
*** You must specify a layout or a complete set of overrides
Notice that you can also specify the vendor and product id to use.
You can also, however, override the built-in commands for a particular layout. This is useful if you are developing new hardware that uses a different hookup from the Redbee Econotag or Redbee Usbstick.
You will need some pretty low-level knowledge of the FTDI controller to do both the design of the hardware and to determine the values for these overrides. Feel free to email mc1322x@devl.org if you need help.