This project is a small programmer for AVR microcontrollers using an RS232serial connection. The circuit has a feature that allows the firmware to beloaded to the target microcontroller, and the serial line to be passed throughto the target without manual intervention. A jumper setting allows for theprogrammer firmware to be updated. The microcontroller used in the programmerhardware is now the ATTiny4313. The original AT90S2313 is obsolete and theATTiny2313 is now too limited.
Sep 26, 2014 This tutorial focuses to teach you how to program AVR Serial Communication (UART). UART plays an important role in almost every embedded applications which we see in our day to life and hence it was considered to be very important concept in every Microcontroller. The above design demonstrates the. Entire AVR programmer has been build with using common parts and fits in the case of the serial connector. The socket pcb has been created to fit a 28-DIP AVR ATmega8 microcontroller, but you can build a socket pcb for any other AVR microcontroller out there.
The firmware manages the programming of an expandable range of AVRmicrocontrollers, FLASH, EEPROM and fuse bits, using the SPI port of the targetwith the reset pin asserted. Versions of firmware are provided for theATTiny2313 and ATTiny4313. The former is deprecated. The latter is needed tohandle the increasing number of AVR target types.
A Linux GUI is provided. This reads the AVR fuse bits and signature bits andadapts the GUI configuration to the detected microcontroller type. The GUI maybe used directly with a bootloader following the AVR109 command interface.
Connect the 2-pin 5V DC power, noting the polarity is respected.
Connect a 4-wire serial cable to the PC either directly if the PC has a serialport, or via a serial-USB adapter. The default serial port is /dev/ttyUSB0appropriate for the adapter. The -P command line switch allows another port tobe defined, such as /dev/ttyS0 for the PC's serial port.
Connect the 6-pin programming cable to the target.
The GUI when invoked should show the target AVR processor type plus a number ofadditional details. If the serial port is incorrect the GUI will try out anumber of baud rates and close.
Take care when changing the lock/fuse bits as this can brick the processor ifdone incorrectly.
More information is provided at Jiggerjuice.
(c) K. Sarkies 19/07/2014
Eagle files and gerbers for a programmer designed for Microchip's series of AVR microcontrollers.
Overview
Microchip's series of AVR chips are simple 8 bit microcontrollers often used in Arduino boards. This programmer board can be used to program fuses and flash for bare AVR chips.
Features
Compatible with USBASP firmware and features, including slow clock.
Selectable target voltage of 3.3v, 5v, or target provided (1.8v - 5.5v).
Built-in serial to USB converter.
Board can remain connected to target after programming.
USB-C interface to PC with full ESD and overload protection.
Design
This board is based on the hardware design for USBASP and is 100% compatible wth the USBASP firmware. I designed it to support different target voltages (namely 3.3v) and wanted built-in serial IO so I could connect a single connector to boards I design.
The board shows up as two USB devices: a FTDI serial port and a USBASP programmer. There is an on-board USB hub that exposes both devices. Target voltage is selectable through the VTARG switch and has three values:
5V (left): Provide 5 volts as power and logic levels to the target board.
Float (middle): Adapt to whatever voltage the target board is using.
3.3V (right): Provide 3.3 volts as power and logic levels to the target board.
If your board provides voltage of its own make sure you keep VTARG in the middle position.
The different voltage levels are shifted through an array of level shifters. This circuit will change direction of the signals if PGM is bridged, which allows for initial programming of the board. All connections other than TXD and RXD also go to a high-impedance state whenever the red programming light is off (I reuse that signal line so I don't need any modifications to the USBASP firmware). Signal direction and tri-state is controlled by discrete logic, again so no USBASP mods are needed. The level shifters I'm using go to high-impedance state when VCCA or VCCB is grounded. This is handled by a push-pull pair of mosfets driven by discrete logic.
Programming
Once the board is complete it must be flashed with the USBASP code. You need another working programmer for this.
Bridge the PGM pins on the board and set VTARG to either 5v or 3.3v depending on the output voltage of your existing programmer.
Connect your existing programmer's connector to the board.
Set your programmer to use a slow clock.
Run 'make Makefile88 fuses' from the USBASP project.
You can now turn off the slow clock feature of your programmer.
Run 'make Makefile88' to flash the firmware.
If successful, a green LED should be lit on the board. This LED is controlled by the USBASP firmware so it's a good indicator everything's working. Remove the bridge to PGM and you should be good to go.