style="display:inline-block;width:468px;height:60px"
data-ad-client="ca-pub-8809257555105760"
data-ad-slot="9085542108">


Trick or Treat

Learning About AVR : How to connect Android's ADK to Spark Fun's USB Host Shield

Date : Sat,28 January 2012
Writer : Ataya P

AVR ATMEGA168P
Working Platform :
Lenovo Notebook , Intel Pentium Dual Core T2080 1.73GHz
2Gbyte RAM
Ubuntu  10.04 LTS- the Lucid Lynx

Hardware :
ATMega168P development kit from Akitsuki shop at Akihabara 
(ATmega168/328マイコンボードキット)
http://akizukidenshi.com/catalog/g/gK-04590/

You may also require AVR-USBasp as a hardware programmer
http://www.aitendo.co.jp/product/2312

Spark Fun USB Host Shield
http://www.sparkfun.com/products/9947

  Recently, I have some interest about Android's ADK. So, I just check on the internet. A lot of ADK boards can be found but most of them are too expensive for me. I did some researchs and found out later that it's a cheapest way to do that function by using  Spark Fun USB Host Shield (only about 2600 Yen) and my old Akihabara AVR board.

Let's do it
1. Download Fixed Android's ADK tool for USB Host Shield here ->
http://letsmakerobots.com/files/DIY-demokit.zip

2.Download the Arduino version 2.2 (The ADK libraries works with version 2.2 and ERROR when using with version 1)
http://arduino.cc/en/Main/Software
 
3.Extract the fixed ADK tool and the Arduino. Copy [DIY-demokit/libraries/AndroidAccessory] and [DIY-demokit/libraries/USB_Host_Shield] directories to [arduino-0022/libraries] directory.

4. For sure, Just download Arduino version 2.2 's bootloader into the board. (Just read chapter 2 here)

5.Then run the Arduino IDE and open [DIY-demokit/examples/demokit_uno.pde]. (don't worry about what the code do. I just want to test the connection with the Android phone.)

6. Verify the code and upload binary file to the AVR board.
Upload binary to avr board

7.Go download the official ADK tool at
https://dl-ssl.google.com/android/adk/adk_release_0512.zip

8.Do as they said to compile the Android demo project and install the demo app into your phone.(They said it should work on Android 2.3.4 but my work on Toshiba tablet 3.2 Honeycomb)
http://developer.android.com/guide/topics/usb/adk.html#running-demokit

9.Now test the connection. First, it is important to ...
     9.1) Make sure that your USB Host Shield board is version DEV-09947 the previous version seems to has problem about MAX_GPX & MAX_RESET define have been swapped. This library code won't work for that old board.

Look behind the USB Host Shield board. It must be this number written on it.
   
    9.2) Plug the power adapter to the arduino board and do not use usb's power to powering the boards because only usb's power is not enough to operate both Arduino and USB Host Shield boards.
    9.3) Make sure you turn on the power switch on USB Host Shield board.

10.Open the demo app on your phone.

11.Then connect your Android phone to USB Host Shield board via USB cable.

12. If everything right, your phone should show connected message and Woopie !! It works !!!

Confirm connect message should be display

It works !!



Useful Link :
Original code are from this web->
http://letsmakerobots.com/node/26839


GO GO GO AVR !!!

Custom Search