Programming ICSP modules
Older modules use the ICSP programming header, here's some info:
Hardware
The programming header for these can generally be found on the underside of the PCB (some very early versions had the header on the top side, but that changed quite early on). These modules use a programming standard known as In Circuit Serial Programming (ICSP) and uses a standard 2x3 pin connector layout. If you look at the underside of the PCB you will see this header, looking something like this:
As can be seen, only two pins are labelled, however this is sufficient to orient the programmer with the header. Speaking of the programmer, I use the low-cost USBAsp programmer, readily available from many online retailers (other ICSP programmers are available, and you can even program an Arduino to perform the programming). Here's the USBAsp programmer that I use:
Also shown is a 2x3 pin header which I simply plug into the non-USB end of the programmer — so when programming this is what I see (there's no need to solder the header, just a small amount of lateral pressure whilst programming is enough to make contact:
The most important thing, of course, is to ensure the Vcc and GND pins are aligned!
Programming
The program used for uploading the firmware is called avrdude and is supplied when you download the Arduino programming environment. Alternatively it can be downloaded on its own from GitHub here: avrdude GitHub
Because I use a Mac, I have a little shell-script to program things, which should translate directly to Linux or WSL. It's also possible to do it in a CMD prompt on Windows… but I'll need to get access to a Windows machine first. I'll update this page later (sorry)
#!/bin/sh DEVICE="attiny85" CLOCK="8000000" AVRDUDE="/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude" AVRDUDECONF="/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf" $AVRDUDE -B 10 -P usb -c usbasp -p $DEVICE -C $AVRDUDECONF -v -U lfuse:w:0xC2:m -U hfuse:w:0xD7:m -U efuse:w:0xFF:m -U flash:w:$1
The script defines the processor (in this case attiny85, but this will be specified in the firmware name - either attiny25 or attiny85), the clock speed and the paths to avrdude and its configuration file. The command-line option to avrdude also selects the USBAsp programmer. If you save this file as prog.sh then programming is a simple case of typing:
prog.sh <firmware name>
Avrdude will then communicate with the chip on the module and produce some output, hopefully ending with the message "avrdude done. Thank you".



