Now you know what tools are required for MCU based development. And you are familiar with their uses. Now time to start some real development.To cover these parts you must have some basic knowledge and tools of electroniccircuit fabrication. So now, let us start with the most important tool the programmer.

Making a programmer.

There are many different types of programmers available on the net. The basic difference is their interface with the PC. Basically, there are three types of programmers.
  • Serial Port based
  • Parallel Port based
  • USB Port based.

Of these serial port based and parallel port based programmers are easy to make in minimal cost. However, the parallel port is little bulky as compared to serial port, I prefer serial one. One of the best programmers I have come across is PonyProg(http://www.lancos.com) Serial Device Programmer it is a package of simple and low cost programmer with easy to use GUI software. I have been using it from long time. So here I will teach you to make PonyProg device programmer.

 

Note
As the serials and parallel ports are very old technologies they are fast disappearing from PCs. Most laptops are not having them and even desktops are dropping them. Therefore, its no surprise that your PC does not has serial ports. In this case, you have to use USB AVR programmer. See our shop http://shop.extremeelectronics.co.in it’s available for only Rs320 ($6.00). The future is USB.

 

Things you will need.

S .No

Component

Value

Qty

1 Transistor BC 547 1
2 Zener Diodes 5.1V 2
3 Resistor 3.3K 2
4 Resistor 10K 1
5 Resistor 15K 1
6 DB9 Female connector 1
7 6 Pin Connector 1
8 General purpose PCB, Wires -

DB9 connector is which connects to your PCs serial Port. Its looks like this.

DB9
A DB9 Connector.

And the 6 Pin connector will make you programmer easy to connect/disconnect from the target board. Now assemble the programmer according to the schematic. Note that the pin numbers are marked on the DB9 connector itself.

avr programmer schematic

Schematic (Download)

avr programmer photo

My Prototype

avr programmer schematic

Finished with protective cover.

Now your programmer is ready !!! Note that the programmer has 6 pin output with following signals
  • RESET(1)
  • MOSI(2)
  • MISO(3)
  • SCK(4)
  • GROUND(5)
  • NOT-CONNECTED(6)
The 2,3,4 are for data transfer. In addition, there is an ISP connector in the target having same signals and these must be connected to matching signals of programmer. So take care while installing the connectors. The next thing you need is a basic microcontroller circuit. Ya it will have a MCU and some basic circuitry to run it. Let us see how to do that.

A basic target system

To design a basic target capable of ISP for AVR series of microcontrollers you need to have
  • Power supply for MCU.
  • Crystal Oscillator (for CPU clock)(optional)
  • Proper signal at Reset.
  • ISP connector
  • Aref For ADC.(optional)

Power Supply

Most of the MCUs available works off a 5v power supply except their low voltage versions. They need a clean and stable 5V power supply. This is achieved using the 7805 voltage regulator IC. Also the MCUs have a separate power supply for its analog parts to increase their accuracy and reduce noise. This must not be connected directly with the digital supply but connected via an LC network with the Vcc. You need not care this if you are not going to use the ADC(analog to digital converter) . You can conned AGND to GND and AVcc to Vcc.

Crystal Oscillator

This is like a heart for MCU. It provides a beat that makes the MCU take steps. In AVR series of MCU each clock pulse executes one instruction (some instruction needs more than one clock cycle to execute) for accurate timing in you application you need a crystal oscillator. It provides a clean, voltage and temperature independent clock source. Generally,you can use crystals from 1 MHz to 16 MHz on most AVRs as required for your project. Actually the AVR has a internal oscillator also !!! that means this can be omitted. But one limitation is there the internal oscillator provides maximum frequency of 1 MHz if that’s enough for you, then its ok else you have to go for an external crystal of say 12Mhz or 16 Mhz.

Reset Signal.

This signal must be high (5V) for normal operation and can be pulled low to reset the device. You can connect a switch to reset the device from it.

ISP Connector

For flexibility you should have a nice connector for is so that you can connected/disconnect a programmer easily for programming. The MCU has 3 PINs for the downloading a program in its flash namely • MOSI – Master Out Slave In • MISO – Master In Slave Out • SCK – Serial Clock That’s for date transfer and you also need to connect RESET PIN of MCU to the ISP Connector so that programmer can put it in programming mode. One more pin should be their that is the common or ground of the two system. So all you need is a 5 PIN connector for programming. However, our AVR programmer has one additional PIN that is not connected to any thing so you need a 6 PIN connector in your target system.

Aref

This pin must be provided with the reference voltage for the inbuilt Analog to digital convertor. Also this pin is suggest by Atmel to be decoupled with a 0.1uF capacitor. I am providing this in my schematic to be complete. You can omit this if you are not going to use ADC for now. More on these on tutorial on ADC. A basic target schematic

basic atmega8 development board

Basic Target for ATmega8 MCU.(Download)

 

Components Required.

S.No

Name

Component

Value

Qty

1 IC1 Microcontroller ATmega8 1
2 IC2 7805 voltage regulator 1
3 C1,C2 Electrolytic Capacitors 100uF 1
4 C6 1uf 1
5 R1 Resistor 330 1
6 R2 1K 1
7 C3,C7,C8 Ceramic Disk Type capacitor 0.1uF 3
8 C4,C5 22pF 2
9 LED1 LED 1
10 D1 Diode 1N4007 1
11 Q1 Crystal Oscillator 12MHz 1
12 J1 Power Jack Connector 1
13 6 PIN Connector 1
14 General Purpose PCBs, wire etc

You can make the above in general purpose PCBs (Vero board) or in a Breadboard. After making it, double check the connections. Use a socket for the MCU so that it can be easily removable. Then check the voltage levels at the supply pins in the socket with multi-meter. It should be very close to 5 volts.

See Also

Download PDF version| Get Adobe ReaderFree !!!

Whats next
Now you have the basic hardware tools in the next part we will be downloading and installing software tools.WinAVR – A free C compiler for AVRsAVR Studio – The IDE for AVRs from there manufacturer. This will be our front-end for the above compilerPonyprog – A free serial device programmer.