Working with the Freetronics USBDroid Android Open Accessory Protocol-compatible Arduino-compatible board
20 October 2011¶
I needed to view the USBDroid schematic / project worksheet PDF file to find out what the pins are used by the SD card and USB Host IC. (Originally this file wasn't linked from the product page but it is now.)
According to this document the details are:
- D10, D11, D12, D13 are used by USB Host interface. (SPI, I assume)
- D9 used by USB Host IC
- D4 used by microSD card Chip Select (in addition to SPI, I assume)
Testing with Arduino 0022. Initially using the
Examples > SD > Files example to test the SD functionality. Using the
D4 pin for chip select means the default example should work without modification.
Arduino Uno as the board type.
(It might just be my imagination but the LEDs on the board seem insanely bright. :) )
Board requires a mini-USB (not standard- or micro-sized) connector on the USB cable used for programming (supplied with the board).
Files example ran happily once uploaded.
There are some hardware differences between the USB Host Shield, Arduino Mega ADK and USBDroid--namely which/whether the INT, GPX or RST pins from the MAX3421E are brought out to Arduino pins. In theory this means behaviour of these boards could differ depending on how the support libraries are written. Given that I've only just noticed this difference it seems like it's not a big issue with the current libraries.
(The biggest potential issue is that the RST (reset) and GPX lines aren't connected to the Arduino so although the library thinks its resetting the USB Host IC it's actually not.)
The benefit of having fewer pins brought out from the USB Host IC to the Arduino is that you have more Arduino pins to play with. Keep in mind however that if you use Arduino pins that other shields/boards use for the RST/GPX/INT lines that your code will be incompatible with those boards. e.g.
NB: Please do not use Digital pin 7 as input or output because is used in the comunication with MAX3421E
- Non broken out on headers: PJ3 (GP_MAX), PJ6 (INT_MAX), PH7 (SS).
SimpleHandbag demo from the Handbag for Android library and it worked happily. w00t!
SD header include in one location in the
SimpleHandbag demo generates the error snippet:
Arduino.app/Contents/Resources/Java/libraries/SD/utility/Sd2PinMap.h:279: error: expected unqualified-id before numeric constant
moving it to a different location doesn't trigger a compile error but the device isn't recognised when connected to the phone.
My first guess is that it's something to do with one library setting
SS_PIN with a
#define and the other with a
const declaration but I haven't investigated further.
28 January 2012¶
While I was at linux.conf.au 2012 I managed to get Handbag & SD & LCD shield support running on a USBDroid along with a Freetronics LCD shield. It required moving all the debug strings into Flash memory.
You can view it in action toward the end of my talk: https://www.youtube.com/watch?v=4yBkSwP9x7s
I should upload some code. :)