SAMD11 Provides Two Serial Ports For Price Of One

While the average computer user likely hasn’t given much thought to the lowly serial port in decades, the same can’t be said for the hardware hacker. Cheap serial-to-USB adapters are invaluable for snooping debug ports or programming chips, and if you ask us, you can never have too many laying around the bench. [Quentin Bolsée] loves them so much that he’s even figured out how to build a dual-port adapter with a SAMD11C14 microcontroller.

As [Quentin] explains in the write-up, this isn’t just some kind of Y-cable. When connected to the host computer, the adapter shows up as two distinct serial ports, each with independent settings for things like baud rate and parity. This handy little gadget will let you tap into the serial ports of two devices simultaneously if you’re looking to do some Hollywood-style hacking, but more practically, it allows you to establish a debug and programming interface to the same board using just one USB connection.

[Quentin] milled a custom PCB for his adapter, which we have to say looks phenomenal, but those with more limited equipment at home should be able to send the MIT licensed board files off for production. He’s also provided the source code for the SAMD11C14’s firmware, so you’ve got everything you need to spin up your own version of this neat tool.

Two ports not enough for your parallel hacking needs? Believe it or not, we’ve also seen a quad USB-to-serial adapter that you can put together, though it’s a considerably more complex circuit.

22 thoughts on “SAMD11 Provides Two Serial Ports For Price Of One

        1. If it’s still serving the 404 I think the site should still be up….
          However, this is possible if using a service like the one Cloudflare offers to externally cache your website and serve it up if yours goes down.

  1. Not sure what advantage this has over other solutions to this problem, like the blue pill serial monster and other projects that pretty much do the same thing with varying numbers of serial ports. Why would you go to all this trouble of getting a PCB manufactured etc, when you could just flash a bluepill to do the same thing with 3 serial ports for only a few dollars.

    1. Somewhat negated by the cost of a Samd11 these days, but a blue pill is more like $10-20 now. Though you could do it with an rpi pico. In any case, this isn’t “most efficient solution to the problem”-a-day. Board libraries from vendors also often don’t show how to do USB with eg multiple CDC serial ports, just one of each type of interface, so extra education value.

      1. @rpavlik said: “Somewhat negated by the cost of a Samd11 these days, but a blue pill is more like $10-20 now. Though you could do it with an rpi pico.”

        Yeah the STM32F chips used on the Blue/Black Pill board (STM32F103C8T6L I think) are forever unobtanium. But they are arguably over-kill for this application too.

        At first glance IMO the RP2040 is arguably the best option as a chip for this application. It has two HW UARTS with added RTS/CTS support, plus at $1.00 each the chip itself is cheaper than the SAMD11 and it’s widely available.[1][2] The Raspberry Pi Pico board is still $4.00 each and is also widely available. For example, right now the Raspberry Pi Pico is $4.00 ea. qty.-any @ Digi-Key w/10,092 in stock.[3] There is a working RP2040/Pico core for the Arduino IDE.[4] The Arduino IDE is cross-platform and it can be installed or run stand-alone. And of-course there’s the official Raspberry Pi Pico C/C++ SDK.[5] Nothing special is needed to program the RP2040/Pico as purchased.

        The Microchip SAMD11C14 Cortex-M0+ chip is pretty cheap and still readily available.[6][7] Right now they’re running $1.55 ea. qty.-1-24 @ Microchip w/34,400 in stock, and $1.65 ea. qty.-1-24 @ Mouser w/5,938 in stock. Both parts are 14SOIC. Unfortunately while there is a good Arduino IDE core for the SAMD21, I doubt it will work with the SAMD11. So if you don’t have it already you’ll need to install Microchip (ex. Atmel) Studio 7, which is big but pretty good and it still seems to be free and uncrippled (which is historically unusual for Microchip).[8] I doubt the SAMD11 comes with a USB bootloader so some way will be needed to program the first chip. Finally, I’m pretty sure Microchip Studio 7 is still Windows only.

        * References:

        1. Raspberry Pi Pico SDK: hardware_uart

        https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__uart.html

        2. RP2040 Price and Stock

        https://www.findchips.com/search/RP2040

        3. Raspberry Pi Pico Price and Stock

        https://www.digikey.com/en/products/detail/raspberry-pi/SC0915/13624793

        4. earlephilhower / arduino-pico

        https://github.com/earlephilhower/arduino-pico

        5. Raspberry Pi Pico / PR2040 Documentation

        https://www.raspberrypi.com/documentation/microcontrollers/

        6. ATSAMD11C14 @ Microchip

        https://www.microchip.com/en-us/product/ATSAMD11C14

        7. SAMD11C14 Price and Stock

        https://www.findchips.com/search/SAMD11C14

        8. Microchip Studio for AVR® and SAM Devices

        https://www.microchip.com/en-us/tools-resources/develop/microchip-studio

    1. Need is such a tricky thing to pin down, I mean I could get by the awkward way using an Arduino as a USB to serial (I think that is all I have capable of the feat in an at all sane way right now), but this is so neat and tidy looking and far easier to put in ones electronic toolbox for future use, would make any time I needed such a feature so much easier…

  2. If you’re more into STM32, then check out or clone https://github.com/satoshinm/pill_serial.git

    It uses the STM32F103C8T6 / (Previously: “Blue Pill” (Recent blue pills are fake)) together with LibOpenCM3 to get 3 serial ports on an USB connector.
    I’ve briefly test driven this project by starting two terminal emulators and echoing data from one serial port to another on a breadboard.

    1. I’ve been using the Blue Pill 3-port code for a while now. In fact I just bought a pack of 5 Blue Pills with the express purpose of making them into 3-port modules. What I will often do is take two of the ports Rx and use them to monitor the Tx and Rx of some attached serial device. Then I build that into a “XYZ Monitor” adapter and hand it off to IT&V (Integrated Test and Verification).

  3. I like the idea, but I’ve got some complaints, too. However, they won’t affect the application of this device, so please don’t be upset or sad. The users who will use it are likely happy with it. :)

    “Both ports provide 5V power to the target directly from the USB lines, and are resilient to 5V data thanks to a protection resistor on RX. The TX lines always output 3.3V logic.”

    Uh-oh. That might be a problem if an RS232 receiver is on the other end.
    5v would still be within the tolerance, but 3.3v is totally borderline. With just 3v, RS232 can’t decide if the level is high or low. Would have been better if there was a jumper to enable an 5v output, too. That would also allow to directly bit-bang the datalines for transistors etc. with traditional TTL levels.

    Don’t get me wrong. That’s propably complaining at a high level, but..
    Let’s be sincere, in real world, circuits often are connected in a hacky way. Let’s just look at ordinary Serial-USB converter cables from the past 25 years: They never outputted V.24 levels at -12v/+12v, but merely TTL at 0v/+5v. And now it’s even worse. 3.3v.

    That’s why so many USB cables failed to connect with traditional serial devices. All of them which weren’t equipped with digital transceiver chips (modems etc) failed to work. But people didn’t know that. Real RS232 had positive/negative levels that could power, transistors, opamps and comperators easily.

    1. But even forty years ago there were some “RS232” devices that were 5 v only.

      I have a vague memory that the Brother/Radio Shack portable floppy drive that connected over a serial interface used only 5V. I can’t remember if it was still useable with regular RS232.

Leave a Reply to DanCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.