Okay, so most folks are going to read this and go "Huh? Who cares, I did that when I was 4." However, in all my years of dinking with electronic gizmos, I've never before "built" a USB interface to an MCU. That is, until today.
I recently bought a set of 5 CH340G chips via eBay. If you have a cheap $3 Arduino UNO knock-off or perhaps a cheesy USB/TTL adapter off of eBay, odds are good you have a device that uses this chip for USB instead of the usual FTDI chip. I think I paid around $4 for the set, free shipping. Can't beat that. I'm sure the quality pales in comparison to FTDI's chips, but I'm not looking for quality, I'm just looking for a basic USB connection that interfaces with the USART of the ATTiny104 MCU on my Xplained Nano board.
Holy wowza, there's a lot of hardware that's required outside of the CH340G chip! It's a good thing that I've gone on lots of pointless buying sprees on eBay, collecting capacitor sets, different flavors of jumper wires, etc, because I had all the parts. There's no better feeling than when you decide to embark on an electronics project and you don't have to order a damn thing because you have everything you need.
The schematic that I used was only slightly spaghetti-ish:
(Image from sunrom.com.)
The breadboard, however, was COMPLETELY spaghetti-ish.
The Xplained Nano board on the smaller breadboard was programmed to receive a single byte via USART and copy that byte into PORTA, which would then either turn on or turn off pins (PA0 - PA7) depending on whether the pin's associated bit was on or off. I had this working fine with the built-in USB hardware, but this is the first time I've gotten it to work with home-grown external USB hardware wired directly to the MCU. I shouldn't be too surprised that it works, but shoot me, I am.
Anyway, I just wanted to yell about my minor victory. I guess I need to crank up Eagle now and bang out a basic ATTiny104 dev board so I can stop hammering on my Xplained Nano. If nothing else, I can put on a MINI USB connector. Micro USB connectors are like plastic food wrap to me. Grrr...
That's all, folks. Time to get back to work. 
(Don't look at my bad hand-solder job. I was in a rush.)



Top Comments