Simple, reliable alternative to USBASP programmer - Arduino as ISP
Posted: 17 Nov 2024, 12:14
Phil: This is Mikes post from a recent discussion in Jeff's thread but I think its worthy of its own topic.
For anyone struggling with usbasps and zadig, this is an easy alternative - a cheap, reliable 'programmer' that you use just like a USBASP to program almost any type of Atmel board such as the DIY-More and variants, Nanos, Pro-minis, RF-Nanos, Tobes PCBs, Mikes PCBs, basically any arduino-like board.
Unlike the USBASP, it doesnt need any additional drivers installing, no Zadig, just plug & go:
Mike: The FTDI chips have been amongst the most "cloned" chips in China, most adapters you buy from eBay or AliExpress have cloned FTDI and their reliability is not good.
I recommend abandoning programming Arduino with a serial adapter via the bootloader and using an ICSP - "in circuit serial programmer", they are often also called ISP (in-circuit being abbreviated to just "I"). I would have recommended a USBasp a few years back, but getting the drivers to work is so hit-and-miss that I wouldn't recommend them anymore. I now exclusively use an icsp made from an Arduino Nano called an "Arduino as ISP". It is so easy to make I'm surprised more don't use them. The details are on the Arduino site:
https://docs.arduino.cc/built-in-exampl ... rduinoISP/
Instead of using a Uno, I've made all of mine using a Nano with the "6-pin lead" made from two servo leads/plugs glued together with Cyano. You need a Nano with the header pins NOT soldered (they often get supplied with the headers already soldered).
I have not soldered the leads into the normal D11, D12, D13, 5V or GND pins, but used the Nano ISP header as it has duplicates of those connections. The only one not connected to the normal pins is the target RESET pin that is connected to D2 pin (the official instructions has it connected to D10, but I altered one line of the code to be D2 as the D2 pin is closer to the other connections I'm using to keep the wiring tidier). You can program the Nano either via its USB connector or if you already have an ICSP programmer, you can program it by temporarily using a 6-pin header in the icsp connections.
Note:
when building the programmer, you use 'Upload' to get the programmer sketch into the Nano.
when using the completed programmer, you use 'Upload Using Programmer' otherwise your new programmer itself will become an encoder!
Wiring (see optional 'colours' comment in following post)
Using one 'Futaba' black/red/white lead and for the other one a 'JR' brown/red/orange helps orient the assembled plug.
When glueing the plugs together you must get them the correct way around!
ie both Futaba blacks at the same end, or Futaba black and JR brown at one end:
Then I heat-shrink the Arduino Nano
Connecting the ISP to an Arduino Uno and Nano is easy via their 6-pin (3x2) ISP header. Unfortunately most Pro Mini don't have an ISP header, so you need to connect directly to D11, D12, D13, 5V, GND and RESET pins on the Pro Mini. If you are making your own ISP you can make one with custom leads, D11, D12 and D13 are next to each other so a servo plug will directly fit to them and Vcc, RESET and GND are together, so another servo plug can directly connect to them, just ensure you get the servo plug the correct way around as it is easy to reverse the plug and reverse the polarity on a Pro Mini (don't ask how I know). The two servo plugs for the Pro Mini obviously are not glued together, but mark them carefully so you know which way around to connect them.
For anyone struggling with usbasps and zadig, this is an easy alternative - a cheap, reliable 'programmer' that you use just like a USBASP to program almost any type of Atmel board such as the DIY-More and variants, Nanos, Pro-minis, RF-Nanos, Tobes PCBs, Mikes PCBs, basically any arduino-like board.
Unlike the USBASP, it doesnt need any additional drivers installing, no Zadig, just plug & go:
Mike: The FTDI chips have been amongst the most "cloned" chips in China, most adapters you buy from eBay or AliExpress have cloned FTDI and their reliability is not good.
I recommend abandoning programming Arduino with a serial adapter via the bootloader and using an ICSP - "in circuit serial programmer", they are often also called ISP (in-circuit being abbreviated to just "I"). I would have recommended a USBasp a few years back, but getting the drivers to work is so hit-and-miss that I wouldn't recommend them anymore. I now exclusively use an icsp made from an Arduino Nano called an "Arduino as ISP". It is so easy to make I'm surprised more don't use them. The details are on the Arduino site:
https://docs.arduino.cc/built-in-exampl ... rduinoISP/
Instead of using a Uno, I've made all of mine using a Nano with the "6-pin lead" made from two servo leads/plugs glued together with Cyano. You need a Nano with the header pins NOT soldered (they often get supplied with the headers already soldered).
I have not soldered the leads into the normal D11, D12, D13, 5V or GND pins, but used the Nano ISP header as it has duplicates of those connections. The only one not connected to the normal pins is the target RESET pin that is connected to D2 pin (the official instructions has it connected to D10, but I altered one line of the code to be D2 as the D2 pin is closer to the other connections I'm using to keep the wiring tidier). You can program the Nano either via its USB connector or if you already have an ICSP programmer, you can program it by temporarily using a 6-pin header in the icsp connections.
Note:
when building the programmer, you use 'Upload' to get the programmer sketch into the Nano.
when using the completed programmer, you use 'Upload Using Programmer' otherwise your new programmer itself will become an encoder!
Wiring (see optional 'colours' comment in following post)
Using one 'Futaba' black/red/white lead and for the other one a 'JR' brown/red/orange helps orient the assembled plug.
When glueing the plugs together you must get them the correct way around!
ie both Futaba blacks at the same end, or Futaba black and JR brown at one end:
Then I heat-shrink the Arduino Nano
Connecting the ISP to an Arduino Uno and Nano is easy via their 6-pin (3x2) ISP header. Unfortunately most Pro Mini don't have an ISP header, so you need to connect directly to D11, D12, D13, 5V, GND and RESET pins on the Pro Mini. If you are making your own ISP you can make one with custom leads, D11, D12 and D13 are next to each other so a servo plug will directly fit to them and Vcc, RESET and GND are together, so another servo plug can directly connect to them, just ensure you get the servo plug the correct way around as it is easy to reverse the plug and reverse the polarity on a Pro Mini (don't ask how I know). The two servo plugs for the Pro Mini obviously are not glued together, but mark them carefully so you know which way around to connect them.