Serial Programmer's Circuit (Hardware)
This is the easiest programmer circuit to make. You just have to get Serial Port connector and three 1K resistors and you are done ! Circuit Diagram is attached.
Now open the datasheet of Atmega you are using (I am using Atmega-16). Go to the pin configuration and find the following pins and connect the programmer. Programming is done through SPI (Serial Peripheral Interface) which involves MISO, MOSI and SCK pins. RESET is used to reset the chip. 0 volt on this pin will reset the chip and for normal running it should be pulled up to +5V.
- MOSI (Master Out Slave In)
- MISO (Master In Slave Out)
- SCK (Serial Clock)
- RESET
- GND (Ground)
Now connect the power supplies that is Vcc and GND to the micro controller.
Vcc = +5V and GND = 0V
Do not forget to connect Reset to Vcc with a 1K/10K resistor for pulling up.
Thats it ! We are ready with the hardware :)
Software
As I told you there are two parts of a programmer, hardware and software. We built this hardware as it is very easy with just 3-4 components. Now we need software which support this hardware and can comminucate with micro controller using this circuit. There are 2 good softwares for Windows. They are,
Both of them support Serial as well as Parallel port, but I have always preferred serial port because it has only 9 pins, hence a smaller connector is required.
Now let us discuss about them.
At-Prog
I consider it as simplest programmer ever ! It was my first programmer. The circuit we discussed is actually based on this programmer. Download the folder from the website, unzip it. It has an executable file named at-prog.exe double click to execute it.
Go to PORT and select the address of serial port (by default COM1). Once you click that Serecon2 detected should appear in the Activility tab. That is the name of the programmer circuit.
Turn on the power supply and connect the circuit to the micro controller.
Click on Check, it should show OK in the Activity tab and device name (ATMEGA16) will automatically come in the tab below check option. This is the autodetect option of this programmer which autodetects the device name connected by its signature.
Now just open the device file from File--->Open and click on Write. It will write and verify the program. Done ! So simple isnt it ? :)
Pony Prog
One of the most commonly used programmers on Windows. Download it from the website and install it. Now lets set it up for our hardware.
First select AVR micro and AVR-Auto (you can also specify device name, Atmega16) in the chip options (last two drop down tabs)
Go to the Setup---->Interface-Setup. Then do the settings as shown in the picture below. Then connect the circuit to the microcontroller, turn on the power supply. Now click on Probe. You should get Test OK message. If not, check your connections again.
Now lets read the Microcontroller. Go to Command---->Read All. It should start reading the signature and the flash memory. You should get Read Successful message after that.
So we are done with the settings and testings. Everything is working fine :) Now just open the hex file from File---->Open-Device-File
Go to Command---->Write-Program(Flash). It will start writing and then veryfying the code. Congratulations :) you did it !
No comments:
Post a Comment