Programming atmega using USBasp
For burning a program in a AVR uc using usb port instead of parallel or serial then USBasp is the best option. For circuit diagram of USBasp click here. following are the procedure for burning the hex file
-
Install the avrdude (winavr) ,it can be downloaded from click here
-
Download USBasp driver ,you can download it from click here
-
Connect cable directly to USB port of computer .
-
Wait for windows information “New Hardware Found USBASP”. If device isnt detected, check the board for errors and reconnect again;
-
After device is detected Driver setup wizard opens. Select where USBASP driver is located. It is in directory you’ve downloaded with firmware. If you unpacked in D: drive, than driver should be in D:\usbasp.2006-12-29\bin\win-driver\ and press next:
-
there are many GUI available on net , using which u can burn the code , i think AVR8_Burn-O-Mat was the easiest one which can be downloaded from click here , dis GUI is self explanatory .
-
select the uc , specify the hex file
-
click on write , it will show msg flash successfully written.
-
click on verify to verify.
-
if got some error msg instead of flash succesfully written , these may be the reasons for the error
-
avrdude: error: could not find USB device “USBasp” with vid=0x16c0 pid=0x5dc , reason may be
“USBasp” is not Connect , check your connector or u haven’t installed the driver (install it) click here
2. avrdude: error: program enable: target doesn’t answer. 1 , reason for dis error
- Programmer isn’t connected with Target circuit
- ISP Connector is bad connection
- Target circuit power is OFF
3. avrdude: verification error , first mismatch at byte 0x002a0x31 != 0xb1 , reason is verify error so try again.
4 . if you got an error message “flash successfully written error while verifying flash” the reason for this error is the power supply , Vcc which you are providing is less than the specified value 5 – 4.5 V .
……..if you found this tutorial helpful or have any suggestions … do leave a comment.
