Go Down

Topic: MEGA32u4 vs ATtiny85 (Read 84 times) previous topic - next topic

Domino60

Mar 20, 2016, 07:09 pm Last Edit: Mar 20, 2016, 07:54 pm by Domino60

So months ago I wanted to try to program a Uno (atmega328p) to work as a keyboard
but after asking in the forum people told me that's impossible with Uno and I should try
Arduino Leonardo (Mega32u4) so I've seen many tutorials and I said ok, np I'll try in the future
but today watching youtube I pressed this video:

https://www.youtube.com/watch?v=1L85O_mFwjI

and a question came in my mind, how exactly is he doing that? Is ATtiny85 possible to work as
a keyboard? How?

So I'd like to know how if anyone got information.
To be or not to be? Read a book and you will see.

dmjlambert

Well you can configure a bare ATtiny85 to connect to a USB port using zener diodes and resistors like that guy did.   The most common way to do that is to just buy a digispark or trinket, which already have those parts with the ATtiny85 on the board.   Then you could search on the Internet for making Trinket or Digispark act like a keyboard. 
Pro Trinket can also be a keyboard, and that is your ATmega328P. 
 
This stuff is easier if you use an ATmega32U4 because there are no additional libraries or special software to load.   The Leonardo core and built-in libraries for Arduino just have the keyboard functions ready to use and you have to add absolutely nothing.   If you are interested in ATtiny85 just because it is small, you may want to look at DF Robot Beetle or CJMCU Beetle, which are the same size as the Digispark, but they are Leonardo-type boards made with ATmega32U4.   

Domino60

Quote
Well you can configure a bare ATtiny85 to connect to a USB port using zener diodes and resistors like that guy did.   The most common way to do that is to just buy a digispark or trinket, which already have those parts with the ATtiny85 on the board.   Then you could search on the Internet for making Trinket or Digispark act like a keyboard. 
Pro Trinket can also be a keyboard, and that is your ATmega328P.
Can't I just use a attiny uploading bootload from uno and write keyboard code like leonardo? or there is no lib's for that ?
To be or not to be? Read a book and you will see.

dmjlambert

I'm sure if you want to dig up some libraries somewhere you can do that.   If you want to go that route, follow the tutorial you found, or look up tutorials in your favorite language for Digispark or Trinket.   You can find add-on libraries to do what you want, which is to do VUSB (virtual USB) with HID on arbitrary pins of a chip that does not have a built-in USB port and circuitry.   You would still need to add the zener diodes and resistors and USB plug or socket to make the USB interface.   

With a Leonardo or Leonardo derivative like DF Robot Beetle, the USB circuitry is already there and the chip itself has a built-in USB pins making external zener diodes unnecessary, and the library and commands are already there built into the Arudino IDE with no add-on necessary.   So I guess it is up to you the amount of effort you want to make.   I have not done very much work trying to simulate through software a USB port on a chip that doesn't have USB built-in, because I have plenty of chips and boards on hand with the functionality built-in (ATmega32U4 for example).


Domino60

Well I don't care about the circuits I can build one on my one I done in the past many designs
will be easy to build a mini usb pcb, the other question that I try to find is if there is already lib's for arduino
using ATtiny85 as keyboard, example, libs in arduino IDE...etc

I don't want to use other softwares to upload codes..etc I'd like to use the Arduino IDE for this work.
To be or not to be? Read a book and you will see.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy