Saturday 20 April 2019

Arduino as AVR Programmer


Can you use the Arduino as an AVR programmer?



Answer



I use the mega-isp solution mentioned above - the Arduino avrisp sketch is here



http://code.google.com/p/mega-isp/downloads/list


I do not use the shield they have - I made up a simple cable using two 6 pin dual-in-line header sockets to fit the programming ISP connector on your Arduino. (I did not have two dil sockets so I used standard single in line and superglued two 3 pin sockets together.


You then need a piece of ribbon cable or some wire.


Arduino 6 pin ISP


Connect each pin on one socket the the corresponding one on the other, with the exception of pin 5 = Reset. Connect one end of the cable to pin 5 - this is the end that will connect to the target AVR that you wish to program. Connect the other end of the pin 5 wire to a floating pin connector.


To use connect the cable to the arduino by placing over the ISP programming connector and connecting the floating lead to digital 10, connect the other end to the target ISP connector. You need to ensure that the pin 1's match up.


Cable overview cable detail


Program with avrdude using


avrdude -P com7 -p t2313 -c avrisp -b 19200 -U flash:w:fred.hex


where

com7 - the com port that the Arduino based programmer is on
t2313 - the type of AVR you wish to program (m328 for ATMega328).
fred.hex - the name of the hex file you wish to progam into the target.

I have used this to program Tiny2313 with no problems.


Note: The cable will carry 5v to power the target - if the target is already powered then do not connect pin 2 of the cable.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...