I'm trying to find a way to make a connection between a custom MCU-based device (accessory) and an Android device (smartphone or tablet). The goal is to exchange some data as with the old and good asyncronous serial (RS232/UART/RS485).
My goal is to let the user configure the device through its smartphone, without power up a laptop or using local HMI (that will be surely worse than Android HMI). Considering only the core functionalities of the device, I could use a simple AVR or the smallest among Cortex-M devices. I hope to produce at least 1000pcs, so the price is important.
I found some ways, maybe you can suggest other.
*Accessory is USB Host, Android is USB Device* This is the most compatible way. Indeed, old Android devices have USB device only port, so the only solution to make a connection is to develop a USB host on the accessory. At the same time, I think this is the most complex way (at least for me, that never developed embedded USB connections in the past).Android released two reference designs that use this method: ADK2011 and ADK2012.
ADK2011 uses the simple ATmega1280 MCU with the MAX3421 USB Host controller (they are connected through SPI). MAX3421 is very specialized device and its price is very high. Maybe it is more convenient to make a custom cable with MAX3421 to avoid mounting it on every board, but the user couldn't use a standard USB cable for configuration.
ADK2012 uses a single MCU (ATSAM3X8E from Atmel, that is a Cortex-M3 MCU) with USB Host integrated peripheral. Of course, the source code is very complex and the MCU is much bigger than I need for normal use. I know SAMD21 (Cortex-M0+ from Atmel) has a USB Host peripheral: will be simple to port ADK2012 source code for ATSAM3X8E to SAMD21?
*Accessory is USB Device, Android is USB Host* This should be simpler for accessory development, but I will lost the compatibility with many Android devices that don't support USB OTG, hw or sw (my 1-year old smartphone from Samsung doesn't have USB OTG).There are many low-end MCU with USB Device peripheral. Do you know some reference design that shows how to communicate with Android USB OTG port?
Any other suggestions?