Try to just use
avrdude so that things can be automated with Python scripts.
- Flash Bootloader
- Put a fresh AVR chip (such as an Atmega328) into the Arduino in the correct orientation
- Remove the jumper from the USBtinyISP
- Plug in the USBtiny to USB
- Plug the Arduino into DC or USB so it is powered
- Plug the 6 pin cable from the USBtinyISP into the Arduino so that pin 1 mark is lined up with the red wire on the cable
- Start up Arduino IDE
- Select the chip/Arduino you are using in the Tools->Board menu
- Do not select a COM/Serial port
- Select Tools->Burn Bootloader->w/USBtinyISP
- The USBtinyISP red LED should light up. It will take a minute or two to program the chip
- When it is done, the IDE will tell you it has completed and the red LED will be off.
########################
The above method needs to be updated with pure avrdude so the process could be automated. Or, maybe no bootloader is needed if we are using USBTinyISP.
More tests coming...
- Flash arduino sketch
(1) Put the jumper back on the USBTinyISP, unplug power supply (USB cable) connected to Arduino.
(2) Plug the 6 pin cable from the USBtinyISP into the Arduino so that
pin 1 mark is lined up with the
red wire on the cable
Arduino should now be powered from USBTinyISP.
(3) avrdude -c usbtiny -p atmega328p -U flash:w:blink.hex
Probably need sudo
OR, install the udev rule. Check:
https://learn.adafruit.com/usbtinyisp/avrdude
###################################################################
ref:
https://learn.sparkfun.com/tutorials/pocket-avr-programmer-hookup-guide/using-avrdude
https://learn.adafruit.com/usbtinyisp/user-manual
https://learn.adafruit.com/usbtinyisp/avrdude
https://www.arduino.cc/en/Hacking/Programmer