How to Make a simple AVR programmer

Dec 30, 2010 08:10 AM

make a simple AVR developer cum programmer



We have always fascinated by the wonders of digital electronics around us ,making our life more advanced in all aspects . I  will help you all to make a simple, multipurpose AVR developer with this demo circuit ,which displays a srting on the LCD module 

The reason for selecting AVR is because of its low coast and availability even though there are other groups of MCUs like. PIC (from Microchip) but PIC MCU is not easily available. The software I used in this project is Codevision AVR , unfortunately  this  software is not a freeware and other  freeware alternatives  are there, such as WINAVR, but is not easy to  implement .Try  codevision and you will feel the way I do.

Now let’s get to our topic, AVR development board and programmer,. Well.. to begin the actual topic you must know the fundamentals of a microcontroller and a little knowledge of C programming. if you posses  the two pre-requisites then you are ready to move forward , else just take your own time  to master these things .

I would prefer these books “embedded C programming and atmel AVR “ by Barnett, which describes the Complete AVR  C programming  it gives a quick and concise reference in both hardware and software areas, in depth .

And for software development please obtain codevision AVR from  HPinfotech  ,a demo version  with 3 KB code usability  can be freely downloaded from here.

To make a simple programmer I recommend you to download a freeware ponyprog from here and a simplified version of programmer hardware schematics is given below, a similar programming hardware is given in the ponyprog  website, but believe me this the simplest possible hardware I can obtain

A word about this programmer , simplicity of this design is due to the in built circuitry for new technology known as a ISP (In System Programming) with only five programming lines, viz MISO, MOSI,SCK,RESET,GND . Which enables the users to program the hex files directly to the microcontroller without any costlier & bulkier flash programming unit . (in the above schematics a 2*6 header is given ,just use six pin single header )

A common confusion with the user is the connection of MOSI &MISO pins , for this circuit just connect MOSI ,MISO,RESET,SCK,GND to the respective pin of your MCU(micro controller) it’s that simple!

A word of caution ! a parallel port needed for this circiut to impliment programming fuctionality, but most of the modern laptops are not provided with parallel port, for them please buy USB parrallel port or reffer to the serial interface from here.

The LCD module is standard 16*2 type Hitachi HD44780 compatible LCD   configured as 4 bit mode to minimize connections and complexity  

Let's start our work

For your simplisty I'm taking atmega8, this MCU has 8 KB of flash , 1KB of RAM ,512  bytes of EEPROM packed in just 28 pin makes our degisn simple but as powerful as of other atmegas'.

Just assemble the board as per the  schematic diagram which can be downloaded from here.

an assembled board looks just like this , I used a small piece of strip board which is cheap and easily available.....

As u can see the ports are directly connected to the SIP  (SINGLE INLINE PACKAGE) sockets so that we can use the port easily , we  do not need to solder...!!!!!!!!!

which makes this a multi purpose unit .......! I MEAN IT!! look above the rest button and you will notice a small jumper which is currently on the reset side that means the unit now works as a normal developing board ,,place the jumper to the other side and it is now  ISP programming mode

now open codevisionavr

Select new from  file  menu and type the following code:

or you  can download as a text file from here.  

select make from project menu

after compilation window will look like this.....(to reference )

At this point you have succesfully created a hex file , which can be burned to you target board so let's program the chip!!!!!!!!!

open the hex file using ponyprog 

opened window look like this!!!!

select chip as atmega8 from AVR micro

Before programming the chip connect the board in ISP mode select interface setup form setup menu click probe button if every thing is correct " test-ok dialog box appears " and looks like this

If you feel lost ,then just set the parameters as given in the image

before writting we have to erase the chip even though it is new ,select erase from command menu

the output is given below

there won't be any error prompt and also any other dialog if the connections are correct if the there is any wrong or improper connection the result will be opposite ,ie there will be some dialog saying " a device is missing or anything like that, with three radio  buttons.

now burn the program

select write all from command menu , after writing a varification process takes place and a "write succes " displays like this

power on the board

lcd lightes up..........

and displays the  pre-programmed message like this....

and that's  it!!!!!!!!!!!

for further reference please take atmega8 datasheet and codevision avr reference manual

feel free to contact me for any assistance or for critics

thanks.......................

Comments

No Comments Exist

Be the first, drop a comment!