3
\$\begingroup\$

I have developed an Android app which talks to an Arduino Mega through USB.

The C code is 1.8kb and will fit on an ATTiny85 chip in order to shrink the circuit to almost nothing. The problem is...

How do I introduce USB to the circuit so I can still talk to it with the Android app?

\$\endgroup\$
1
  • \$\begingroup\$ What the physical connectivity / communication medium between Android and your device. Is it direct USB (i.e. Android is running USB host), or via PC i.e. PC plays USB host, and Android / PC talk over say TCP/IP or Bluetooth etc. ? \$\endgroup\$
    – bdutta74
    Feb 4, 2012 at 6:25

2 Answers 2

6
\$\begingroup\$

Take a look at V-USB. I've used it with ATtiny85. It's essentially a firmware-only USB implementation for AVRs that don't have "built-in" USB.

The V-USB site also has a decent list of example projects you could use as a starting point. Not sure about how/if you can interface with android or not.

One thing to be aware of is their licensing model. You have to pick either GPL or commercial license. If you don't want to bother with adhering to GPL their commercial option has a "hobby" license for $9.90.

\$\endgroup\$
5
  • \$\begingroup\$ can you actually fit V-USB inside an ATTiny? \$\endgroup\$
    – vicatcu
    Feb 4, 2012 at 4:05
  • \$\begingroup\$ Yes, their main reference project (the "PowerSwitch") actually uses the ATtiny2313 which only has 2K flash. obdev.at/products/vusb/prjobdev.html \$\endgroup\$
    – Craig
    Feb 4, 2012 at 4:21
  • \$\begingroup\$ AFAIU, there are several gotchas. For example V-USB or most of the bitbanged SW USB implementations do not work well on Windows 7. Some people did manage to get it working on Windows 7 32-bit, after hacking around with Vista drivers apparently, but no solution exists for 64-bit. \$\endgroup\$
    – bdutta74
    Feb 4, 2012 at 6:28
  • \$\begingroup\$ I have Win7 (64-bit) and it worked for me. \$\endgroup\$
    – Craig
    Feb 4, 2012 at 7:30
  • \$\begingroup\$ So this is really just the USB port connected to the ATtiny and the circuit and nothing more than that? Genius! Thank you... Ill try to update how it goes. \$\endgroup\$ Feb 9, 2012 at 10:13
5
\$\begingroup\$

There are some USB solutions for AtTTiny85 available but all of them are just clever hacks. In my opinion proper USB connection can be achieved using only hardware-USB devices. You should look for devices like ATMega8u2. Chip is much bigger but software like LUFA (http://code.google.com/p/micropendous/wiki/ADK) will make a relatively stable and easy solution for you. Especially if you are rather Arduino guy than engineer.

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.