ISP Programmer for ATmega32 Microcontroller
So far I’ve discussed about the micro controller and the compiler software. I’ve yet not written anything about programming.
ATmega32 series micro controllers support 3 types of programming
- Parallel Programming
- ISP Programming or serial Programming
- Programming via JTAG
Here ISP stands for In System Programmer. To burn a micro controller just the burning Hardware is not enough, it requires software also that would download the program present in a computer or memory device into the micro controller.
Now the software which I am concerned about is named PONY PROGRAMMER 2.06. My circuit is adapted from its website. It uses PC COM PORT to download the program into the micro controller. It have signal amplitude of +5 to +12 volt representing binary ‘1’ and -5 to -12 representing ‘0’.
The micro controller, ATmega32 is programmed using the pins meant for SPI communication. To enable programming, the microcontroller is taken to the RESET state by pulling its reset pin LOW (Logic 0, or say 0 V), in this state, microcontroller is programmable in either mode (Parallel programming and serial programming). Micro controller always accepts 0 V as logic 0 and +5 V as logic one.
So as I’ve described before, there is a mismatch between the signal transmitted by PC and signals accepted by the micro controller. Signals are made suitable for micro controller. In the programmer, Zener diodes provide necessary conditioning of the signals. It is so attached that it converts ±12 volt signal to +5-0 volt signal which is suitable for the micro controllers. A resistance is necessary to limit the current in the nodes of Zener diodes, without the resistors, the voltage can burn the Zener diode, and computer internal circuits may also receive harms.
A high signal (+5V) in the ‘Reset’ pin of micro controller brings it into operational state. A low signal (Ground) drives it into programming mode. As internal pull up resistors are provided at the reset pins, so if nothing is connected to this pin, the micro controller tries to execute the program written within it. Designers may provide a resistance capacitance reset circuit, but it’s not always necessary. Whatever, a push button is used most of the time to provide reset facility. Here in the burner circuit, an open collector output is provided to the reset pin, it is driven by the programmer through the port. This much is enough.
The necessary data transmission and reception work portion is handles by the pony programmer. Follow the links provided to download pony programmer. The following burner circuit can burn ATmega32 microcontroller, connect the derived signals to the adjacent pins, attach the cable to com port, power up the device i.e. micro controller, and the micro controller is ready to be programmed.
ISP Programmer Circuit Diagram
So that is how the Circuit is set up, now let me tell you that the micro controller runs upon the internal calibrated RC oscillator in the pictures. So that there is no crystal is attached. Yet the micro controller is programmable. Let us see the software settings. First of all, select the port, to which you have attached the device! And the programming device from the menu “Set Up>Interface Set Up…”. Select “SI Prog I/O”, this one provides fastest programming speed. And about the ports, it should be com port for this programming cable! Now select the port you have the cable attached to.
Now come to the device selection menu. Here ATmega32 belongs to the AVR family. So it is listed under “Devices> AVR micro”. Select ATmega32 as your device. Auto detection will also do.
Now after this two vital things check out If your circuit is working or not. Choose “Command>Read All”
Now if you see that it is reading the micro controller without any error message, your programming cable is working and you can program the micro controller with it.
You can Burn your hex file with it (Compilers provide hex files to program micro controllers). Just open “File> Open Device File…” now an window will open, now browse for your hex file, load it into the pony programmer, and burn. Pony programmer supports click and drag operation too. That means, if you drop the hex file into the pony programmer, it will automatically catch it.
Components:
DB9 female connector
2 X 1K resistors
2 X 5.1 V Zener diode
1 X 15K resistor
Vero board
BC 547 or any general purpose NPN transistor
Male Relimate connector (6PIN & 2PIN)
Links for Reference:
Note: 1. Make sure that you have a COM PORT in your computer hardware and your operating system recognizes it. Check it from “Control Panel > Administrative Tools > Computer Management”. In the cascaded list pane, find the following
“Computer Management > System Tools > Device Manager > Ports (com & LPT)”. If COM ports are present under this list, this circuit will work fine. Else, look for a USB based burner.
Note 2. This burner will work fine for ATmega16 too. For ATmega8, you need to connect the signals to the respected pins.
Note 3 .You can omit the male 2-PIN Relimate connector
Bibliography
Lancos.com and Atmel
You may also like:








@Anish
The switching between normal mode and programming mode is made by the reset pin. The reset pin has two functions. If it is tied high, the micro controller will run in normal mode. this pin is internally pulled up by a resistor. So even if users are not connecting any resistor, the micro controller will run in normal mode
And when the RESET pin is tied low, the micro controller enters programming. Two types of programming can be made in this mode. ISP and parallel programming.
Oh, sorry i didn’t read the post completely.I have another question though. Will a serial to usb converter work with this ISP programmer?
Hi rakesh,
So, the atmega32 does not require the programming voltage. But how it switches between programming mode and normal mode? like the PICs
Ow, sorry. About the voltages, I meant that 13.2V. ATmega32 doesn’t need it. Some micro controller requires this voltage for some modes of the programming.
@Shurid
ATmega32 doesn’t need any voltage as some of the ATtiny micro controllers or some PIC micro controllers need it. The transformer is required for the circuit 5V regulator, it supplies power to the micro controller.
And about the Zener diodes, It doesn’t actually converts the voltage. The term “Shaping” is more appropriate for it’s operation. A Zener diode brings down the voltage between two nodes to the Zener diode’s voltage rating by draining current through it.
Another thing, Rakesh, that transformer (in image 3), have u used it for supplying the programming voltage (~13.2V) to the uC ?
rakesh …
“Zener diodes provide necessary conditioning of the signals. It is so attached that it converts ±12 volt signal to +5-0 volt signal which is suitable for the micro controllers …” — can a zener convert voltages ? or are u talking about level down the voltage ??