Servo Control Board Bench Test

Details to follow

Update to Bitwizard Servo Frimware

To prevent the quad copter from causing unnecessary damage, Bitwizard have provided a custom upgrade to the servo board. Automatic default/kill  system has been implemented.  When activated the systems will revert a servo or motor to the default value within a defined time frame.  The "default value" address for the boards at 0x30-37 and the "timeout when it activates" address are at 0x38 to 0x3f.

The way it works is you set a default value, and it reverts to the default value after the indicated time. The time can be set between 0.1 and 25.4 seconds. Turn the feature off again by writing 0x00 or 0xff.

The zip contains the .hex files ready for flashing to the servo board.

 

To update the servo board one should follow the Bitwizard instructions which are:

 

http://www.bitwizard.nl/wiki/index.php/Field-upgrade_bitwizard_boards

If you have a raspberry pi, and there is a reason to upgrade your bitwizard board and you have a raspberry pi, then this can be done....

Get the modified avrdude binary from:

 http://project-downloads.drogon.net/files/avrdude_5.10-4_armhf.deb

Next you have to make a connection from your raspberry pi SPI0 bus to the programming connector for your board.

First the SPI0 bus on the raspberry pi. On rpi_serial and RPI_UI you have a 6-pin SPI connector. usually marked "SPI0". (sometimes it is marked SPI2... sorry.).

On your target board there is a pattern of 6 pads that form the programming connector. However 5 of the six pins are shared with the SPI connector. So using the SPI connector is more convenient. We'll take care of the sixth next.

Near the SPI connectors, on most boards you'll find a solder jumper. At the moment the center pad is connected to one of the other pads with a tiny track. Your SPI connector becomes a programming connector if you short the center pad with the pad without the tiny track. I use a 7cm piece of 220V cord that has been stripped for 1cm as a brush against the two pads that I want to connect. Any other trick that connects the two pads will work. People who are upgrading an I2C version have the option of simply using a blob of solder to make the connection. Leaving the little track is not a problem. (we cut the little track during development to make one of the SPI connectors a programming connector leaving the other SPI connector as the SPI connector....)

On the rpi_ui the procedure to make the SPI0 port a programming port is slightly different: Put a jumper on the jumper block in the 1-2 position (horizontal, near the SPI connector). Most of you won't have a jumper block installed. Any temporary connection between the two pins is acceptable, provided you can keep it stable for the few seconds it will take to program the board.

Then to program the board, you will have to do something like:

avrdude -P gpio -u -c gpio -p atmega328  -U eeprom:r:ee.hex:i
avrdude -P gpio -u -c gpio -p atmega328  -U flash:w:i2cmega_rpi_ui.hex
avrdude -P gpio -u -c gpio -p atmega328  -U eeprom:w:ee.hex

of course substituting the name hexfile that we sent you.


For the devices with atmega328 parts, you will need to have the definition of that part in your /etc/avrdude.conf. You can get an upgraded version from http://www.bitwizard.nl/software/avrdude.conf Install it in /etc . The commands above first try to read the eeprom, then flash the part, then rewrite the eeprom. This should now conserve your serial number in the eeprom. Not that it's terribly important.

Most our smaller expansion boards have an attiny44 chip as their brains. Use "attiny44" instead of "atmega328" in your commandline above. rpi_ui, xxx_motor and xxx_7seg have atmega328 processors.

note

The avrdude GPIO programmer will 'grab' the programming pins from the SPI module if you have it loaded. The SPI module will take them back if you remove it from the kernel and re-insert it, or if you use gpio_setfunc . (Use the first method until I have time to document how to do it with gpio_setfunc). The "killtime" is not preserved over poweroff. Thus if you want to activate it, you need to set it on every boot. For your purposes, I'd say that you could already test with this. Set your "spintime" as the timeout. Set the default value to the spinvalue. This means that you'll have an "illegal" startup/default value.  But when the feature activates, your quad will come down and keep spinning until you manage to turn it off manually.