Hello everyone, welcome back.
In my last post on the AVR tutorial series, I talked about the hardware requirements for working with AVR series of microcontrollers. Also, in the post before that, I had talked about the installation of the winAVR Integrated Development Environment(IDE) needed for programming the controller. I also talked about the USBASP programmer that is needed for burning the Hex file that is generated after compilation of the code into the microcontroller. Therefore in this post, I am going to talk about how to install the USBASP drivers on your system, connect the programmer to the controller and calibrate it. These all steps are needed in order to communicate between your PC and the controller for any type of project development.
So, if you take a look at the pin diagram of the ATmega 16 microcontroller, you will find that pins 6, 7, 8 and 9 are also called MOSI, MISO, SCK and RESET. Pin 10 is the VCC pin and pin 11 is the GND pin.
MOSI: Master Out Slave In.
MISO: Master In Slave Out.
SCK: Serial Clock.
RESET: Reset Interrupt pin for the microcontroller.
VCC: Power pin with a voltage of 5 Volts.
GND: Ground pin with a voltage of 0 Volts.
Now, if you look at the circuit diagram of the USBASP programmer, you will see the same pins mentioned over there too.
Now, all you need to do is connect them both with each other to communicate between your PC and the microcontroller. What I mean by this is connect the MOSI pin on the programmer to the MOSI pin on the controller and MISO pin to the same on the controller and so on. Also, for some programmers, you need to connect the TXD and RXD pins on the microcontroller with either the GND pin or the 4th and 6th pin in the programmer. Keep in mind that this is required only in some types of USBASP programmers and not all. I haven’t yet been able to point out why this is needed in some and not all. To be safe, you should connect the TXD and RXD pins anyway.
Another thing to be kept in mind while making the connections is that if you are making the connections between the microcontroller and the programmer using a ribbon cable like the one shown in the picture to the right, then the connections will be reversed at the microcontroller end. Not to be confused, just make the connection with the microcontroller as per the picture below this line if you are using a ribbon cable else make the connection as shown in the picture above.
After you have made the connections you will need to install the USBASP drivers on your PC for your Operating System to recognize the programmer when you plug it in at the USB port.
You can get the USBASP drivers by clicking here. After downloading them comes the task of installation which is a little tricky as we need to disable Device Signature for windows in order to install the drivers. Therefore go through the video below where I explain how to do that in details.
As I mentioned in the video you can check the connection between your PC and the microcontroller by opening the Command Prompt and typing the code written below.
avrdude -c usbasp -p m16
If your connection is successful you will get a message like this:
This means that successful communication has been set up between your PC and the microcontroller and we are ready for building our first project. We are going to do exactly that in the next post where I will talk about interfacing an LED with the controller.
Shop Smart with us to follow this tutorial series:
- Boards and Programmer, Breadboards
830 Point Breadboard for solderless prototyping
- Type: solderless
- Points: 830
- Brand: GL-12,
- Size: 175X67X8mm,
- Package Contain: 1 Piece of brand new 830 points breadboard
- 128 Group of 5 Connected Terminals,
- 8 Bus of 25 Connected Terminals
- Colour: White
- ATMEL AVR Microcontrollers, Electronic Components
Atmega16A Microcontroller 8 Bit ATMEL AVR MicrocontrollerATMEL AVR Microcontrollers, Electronic Components
Atmega16A Microcontroller 8 Bit ATMEL AVR Microcontroller
- Controller family: ATmega AVR
- IC or Chip: ATmega16
- Type: AVR Microcontroller
- Pin counts: 40
- Pin type: through hole
- Operating voltage range: 1.8V-5.5V
- Package contains: 1 X original ATmega16 IC
AVR USBASP Programmer For Arduino Raspberry-Pi Robotics
- Package contains: unused 1 USBasp Programmer
- Can work on many platforms like Linux, window, Mac etc.
- There is no need of any external device or component
- Gives speed upto 5KBPS
- Can programme many devices like, AVR, Raspberry PI, Arduino etc
- Low cost and small size
- Simple board of ATmega8 or ATmega88 and other passive components
If you want to continue on with this series I would ask you to visit our YouTube channel and subscribe to receive continuous notifications. You can also subscribe to our Newsletter below to get email notification of each post as and when they are posted.
Thanks a lot for reading through this post. Feel free to follow through this series and comment your queries in the comment box below. Also feel free to contact us regarding any out of stock product and we will try to get back to you as soon as possible.