Custom Controller

HeroXLazer

10 Feb 2017, 01:38

I want to make a USB-A ATMEGA32U4 controller, and was wondering what the schematic would be compared to a normal keyboard schematic. How would I do that?

User avatar
vvp

10 Feb 2017, 10:47

Take e.g. Teensy 2.0 schematic from here. And adjust it with the usb connector of your choice. But realize that ATmega32u4 can work only as an USB device (ie as a slave on USB bus) and therefore using USB-A connector is against the USB standard. You cannot easily make ATmega32u4 based controller board to work as USB master (which is supposed to use USB-A connector).

You need to be careful about selecting the crystal and the corresponding capacitors. Section 5 of this document gives you some leads. A bit more detailed info (but for a different controller) is here.

User avatar
DMA

10 Feb 2017, 11:23

Also you are much better off the atmega as a family. It's not even "yesterday", it's "eons past", things are done much i much easier way nowadays.

pomk

10 Feb 2017, 13:46

Unless you have some legacy software you need to run on ATMEGA I'd suggest looking into newer/faster/cheaper designs.

HeroXLazer

10 Feb 2017, 23:57

DMA wrote: Also you are much better off the atmega as a family. It's not even "yesterday", it's "eons past", things are done much i much easier way nowadays.
What do you mean? Should I use a different "brain"?

Findecanor

11 Feb 2017, 00:41

The AVR ATmega32u4 is easy to program, is robust, has good documentation and there is a lot of firmware for it, but it does not run as fast as ARM Cortex M-based microcontrollers and it tends to not have much RAM, program flash or EEPROM. Also, the AVR are not as cheap, but that matters mostly if you buy in bulk.

BTW, "USB Type A" is the connector on the host side. I don't know if that is what you meant... There are couple other microcontrollers in the same family that have OTG-capability, being able to be either a host or "device".
You would probably need additional hardware if you want it to be host and device at the same time... I think there was someone who made a USB-to-USB adapter with the ATmega32u4 though.

User avatar
DMA

11 Feb 2017, 01:21

HeroXLazer wrote:
DMA wrote: Also you are much better off the atmega as a family. It's not even "yesterday", it's "eons past", things are done much i much easier way nowadays.
What do you mean? Should I use a different "brain"?
Something with ARM core. Kinetis, STM32, cypress... Doesn't really matter, but for the first one there's more than one firmware is available so you can spare yourself A LOT of programming hours. kiibohd and tmk to name two most prominent in alphabetical order.

Save yourself some time. You'll definitely need it for other things.

Keyboard as an USB host though.. is strange. You may be meant "micro-usb"? That's type B.
type C is all the rage tho

HeroXLazer

11 Feb 2017, 02:16

Okay, thanks. USB-A wasn't a mistake. I wanted to use USB-C, but it's confusing to even do 2.0 on a controller. I'll try to do USB-C 2.0. Do you have any recommendations on which model to use?

User avatar
Ratfink

11 Feb 2017, 02:57

HeroXLazer wrote: Okay, thanks. USB-A wasn't a mistake. I wanted to use USB-C, but it's confusing to even do 2.0 on a controller. I'll try to do USB-C 2.0. Do you have any recommendations on which model to use?
USB Type-C isn't hard to use for 2.0, you just need two pull-down resistors. This link is pretty helpful for some common use cases. As to which connector to use, I'd recommend something like an Amphenol 12401548E4#2A: unshielded surface mount pins for the first row, through-hole pins for the second row. The pins on all through-hole USB Type-C connectors I've seen (except for very expensive rugged ones) are very short, so you'll want a board probably no thicker than 0.8 mm to make sure the pins go all the way through.

User avatar
DMA

11 Feb 2017, 06:40

HeroXLazer wrote: Okay, thanks. USB-A wasn't a mistake.
you didn't elaborate tho. what you'll be doing with usb _host_ keyboard? It's definitely not what devices expect.

USB-C is trivial, as outlined, just don't make those two pullups one. You'll fry everything that way

Post Reply

Return to “Workshop”