element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs First experience "building" a USB interface: success!
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: modalpdx
  • Date Created: 7 Sep 2016 7:07 PM Date Created
  • Views 686 views
  • Likes 5 likes
  • Comments 4 comments
  • spaghetti
  • usart
  • ch340g
  • usb 2.0
  • attiny104
Related
Recommended

First experience "building" a USB interface: success!

modalpdx
modalpdx
7 Sep 2016

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

 

 

(Image from sunrom.com.)

 

The breadboard, however, was COMPLETELY spaghetti-ish.

 

image

 

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. image

 

image

 

(Don't look at my bad hand-solder job. I was in a rush.)

  • Sign in to reply

Top Comments

  • uscdadnyc
    uscdadnyc over 9 years ago +1
    To: ER. Great write-up. Over the past Three years I have accumulated stuff that is RaspPi/Arduino related. To hedge my bets, I admittedly bought stuff that I really did-not-know whether I actually needed…
  • DAB
    DAB over 9 years ago +1
    Nice post. Any time you have a successful project helps convince you and others that you can do more and that you are learning. We all started somewhere. Well done. DAB
Parents
  • DAB
    DAB over 9 years ago

    Nice post.

     

    Any time you have a successful project helps convince you and others that you can do more and that you are learning.

     

    We all started somewhere.

     

    Well done.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 9 years ago

    Nice post.

     

    Any time you have a successful project helps convince you and others that you can do more and that you are learning.

     

    We all started somewhere.

     

    Well done.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • modalpdx
    modalpdx over 9 years ago in reply to DAB

    Thanks! I hope some day I can slow down on learning and speed up on creating, but I guess there's no rush. I don't do any of this for a living so it's mostly just having fun.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube