USB, serial and you… (video, an Adafruit after school special)

Connecting a microcontroller to a computer or laptop is a common problem: For decades, all computers had serial ports and parallel/printer ports. These were great for engineers because they were easy to connect to – data sent from the computer showed up exactly the way it was sent. Nowadays, few computers have parallel or serial ports, they have been replaced with USB. USB is better for users because theres only one connector, and information can be sent really fast with no errors.

But the trade-off is that USB is more complex than serial or parallel since data is wrapped in complicated, super-fast packets. So what if you still want that serial port? Well, you can use a usb-serial converter. These have little chips in them that are very specialized – they show up in your computer as a serial port but they do it through USB. The good news is that these are very common and cheap, but the bad news is that they are not very good for microcontroller hackers.

Why? For one thing, these big 9-pin cables had to reach many meters so what the designers did is make the voltage on them rather high, about 20V from negative to positive. Microcontrollers tend to want no more than 3 or 5V! Plugging this into your microcontroller will quickly damage it permanently! If you want to use one of these cables with your micro, you can build a converter from the 20V down to 5V, often called a MAX232 converter. Some cables are hackable to bring the voltage down so if you’re excited to tear apart an adapter and solder some wires that can be a solution. For most makers, we really suggest you use is an FTDI cable or adapter.

FTDI chips simply take the USB signals and output 3 or 5V cleanly, so you don’t have a risk of zapping your electronics. Another nice thing about these cables and adapter is that you can use the 5V from your computer to power a project, up to half an amp. Basically like the USB/serial adapters they show up as serial ports to your computer, but these have the right voltage levels.

Ftdifriend Lrg

We have two options for FTDIness, cables and adapters. The cables are all in one piece with plugs on either end. The FTDI chip is inside the head of the cable. The adapters are small circuit boards, you can use any miniUSB cable, and the plug in the end matches the pinout of the cable. So why would you want the circuit board? For one, its a little less expensive. Another thing is that it has visible LED that blink when serial data is sent or received, which can be handy for debugging. Another fun thing you can do with the FTDI friend is change the voltage levels for power and data from 5 to 3v or change the 6th pin from RTS to DTR which may be useful for some hacker projects.

Ftdifriendback Lrg

OK one question we get a lot is whats the difference between something like the USBtinyISP programmer and an FTDI adapter? Both plug into a USB port, that is true, and both can be used to program AVR. but they are different things. The USBtinyISP and other USB AVR programmers are specially made to program raw AVR microcontrollers, just as they show up from the factory. The USBtinyISP isnt meant for sending debugging messages or other data. On the other hand, if you have a chip with a bootloader on it already, like an Arduino, you can use the FTDI friend to upload new firmware and transmit serial data for debugging or logging.

Usbtinyisp Lrg

However, you can’t really use the FTDI friend to program a raw chip without a lot of effort and its pretty slow. So, for programming new AVRs, use a USBtinyISP. To bootload onto preprogrammed AVRs and pass data, use a FTDI friend.

Remember, FTDI Friend is your friend, not your FTDI enemy.


Adafruit publishes a wide range of writing and video content, including interviews and reporting on the maker market and the wider technology world. Our standards page is intended as a guide to best practices that Adafruit uses, as well as an outline of the ethical standards Adafruit aspires to. While Adafruit is not an independent journalistic institution, Adafruit strives to be a fair, informative, and positive voice within the community – check it out here: adafruit.com/editorialstandards

Join Adafruit on Mastodon

Adafruit is on Mastodon, join in! adafruit.com/mastodon

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Join over 36,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


Maker Business — “Packaging” chips in the US

Wearables — Enclosures help fight body humidity in costumes

Electronics — Transformers: More than meets the eye!

Python for Microcontrollers — Python on Microcontrollers Newsletter: Silicon Labs introduces CircuitPython support, and more! #CircuitPython #Python #micropython @ThePSF @Raspberry_Pi

Adafruit IoT Monthly — Guardian Robot, Weather-wise Umbrella Stand, and more!

Microsoft MakeCode — MakeCode Thank You!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — #NewProds 7/19/23 Feat. Adafruit Matrix Portal S3 CircuitPython Powered Internet Display!

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



2 Comments

  1. The ultimate product would be both in one. A USBTinyISP with built in FTDI. Plub them *both* into your board and you have programmer and debugger in one.

    Yes, I’d buy one!

  2. @Chris: The USBTinyISP chip is an AVR as well and it has enough processing power to do an ’emulated’ FTDI cable. There’s a lot of examples on the V-USB web site on how to do serial communications with AVRs.

    Programming a USBTinyISP and an FTDI into the chip used now (An Attiny2313 IIRC) might not fit because the AVR’s flash memory is not big enough. An Atmega8 would probably be able to do it.

    Having an USB-to-serial on the same chip might also be very useful for in-circuit debugging. There are a few programmers out there which are based on V-USB and emulate a full STK500.

Sorry, the comment form is closed at this time.