I've fallen in love with the new Microchip megaAVR microcontrollers due to their low cost and ease of use, thanks to libraries such as megaTinyCore and megaCoreX. However, the chip shortage over the past few years has made it difficult to source these chips, and I'd often find older AVR microcontrollers easier to obtain. This was also a big reason why my other project, the Launchpad, hasn't been making much progress for a couple of years.

After working with various old and new ATmega and ATtiny chips for my Arduino projects, I've found a few inconveniences when trying to work simultaneously between them. The biggest of which is the difference in the programming interface (ICSP vs UPDI), requiring a separate programming device for each. I've also started getting into using ESP8266 and ESP32 microcontrollers on my projects, which need a serial programmer that switches down to 3.3V.

My Integrated Serial Adapter (ISA) aims to solve these woes by combining multiple programmers onto a single board with the ability to switch between 5V and 3.3V power.

PROBLEM:

  • Mainstream Arduinos use old AVR chips
  • Microchip makes CHEAPER & BETTER new AVR chips
  • Old AVR uses ICSP
  • New AVR uses UPDI, which is not compatible with ICSP
  • Working with both old and new AVR chips

SOLUTION:

  • Combine ICSP & UPDI programming
  • Use switches to change between modes
  • Add serial Passthrough for normal programming (and debugging)
  • Voltage selection (5V, 3.3V) for powering target device

MODE SWITCHING

Changing programming modes is made possible through the use of DPDT switches that route the serial RX and TX connections accordingly. The same method is used to switch between 5V and 3.3V power.

HOW ISA WORKS

SERIAL PROGRAMMING

  • Uses a CH330N/CH340N chip, a cousin of the popular CH340G USB-to-Serial IC.
  • CH340N has a smaller size and built-in clock source, unlike the CH340G.
  • V3 pin is a 3.3V source but is only rated for 30mA. An external 3.3V regulator is integrated into the board to power target devices with 3.3V.
  • A 100nF capacitor is placed in series with the RTS pin to provide a reset pulse for the target device.

UPDI PROGRAMMING

  • ISA utilizes SerialUPDI, which performs excellently on CH340 chips and is included in most libraries that allow you to work with the new Microchip AVR microcontrollers in the Arduino IDE.
  • Serial UPDI turns normal serial converters into UPDI programmers using minimal passive components.
  • The board only needed an extra Schottky diode across the RX and TX lines, as well as a 470-ohm series resistor to program with UPDI.

ICSP PROGRAMMING

  • ICSP is done via an ATtiny814 microcontroller programmed with a modified ArduinoISP sample sketch in the Arduino IDE.
  • The ATtiny is set to run at 10MHz so that it can work at 5V and 3.3V.
  • Higher capacity variants of the 14-pin ATtiny chip can also be used as long as it has at least 2kB RAM.
  • The ATtiny will be flashed with the built-in UPDI programmer circuit via a jumper (JP1).

More than a year after switching to KiCAD, I started developing this project in October 2021 and got the first version of the board made and assembled by May 2022. I have been using it since then but was not able to post this project earlier due to prior commitments (as well as University). It's only recently that I've had the time to properly release this project.

Special thanks to MCUdude and SpenceKonde for writing their respective libraries that make working with the new AVR microcontrollers within the Arduino IDE possible.

Another one goes to Stefan Wagner here in Hackaday for his board and programmer projects that I've been inspired by. Coincidentally, he also posted a similar project earlier this year which I'd recommend you check out!

LICENSE

This work is licensed under a Creative Commons Attribution 4.0 International License.