QRPLabs Program Chip With USBasp

What I did following Hans instructions for updating QRP Labs Projects

The U3 and VFO and CQX may be updated using the this method using the ISP header. The notes here should be read, http://www.qrp-labs.com/qcx/qcxfirmware.html my method is just one of many. I think the method below is relatively simple for the absolute beginner. (The Progrock requires the chip to be removed and put in a suitably connected socket.)

No longer selling, make your own USBasp AVR programmer is http://www.fischl.de/usbasp/ 

In fact I use a USBasp like this from Ebay I have since realised this is a Chinese copy of the genuine one at fischl.de Search Ebay for USBASP.

Several Ebay dealers in the UK sell them.

NOTE:- Another similar device like this https://www.dipmicro.com/store/USBASP2 is available. "Atmel AVR Programmer USBISP/USBASP" This ONLY works with ProgISP software unless you specify when purchasing.

Get one with a 6 pin header if you wish to program QRP Labs devices in situ.

There are several software programs to load the firmware, I show AVRDUDESS below, used by many, all platforms.

Note:- There are many settings in programming software, do not change anything except when necessary. Other default settings are usually best left alone.

Installing the USBasp

For Windows the USBasp requires a driver:- (Driver:- Use Zadig:- choose libusb-win32) Note there are instructions on the Zadig site.

Insert your USBasp.

Download, extract and run Zadig as Administrator.

On Zadig:- Tick Options - List All Devices. Select the USBasp in the drop-down box. "Driver" will be blank, select "libusb-win32" using the arrows.

Only if you are certain all is correct click "Install WCID Driver" (Below it says "Reinstall" because I have already used Zadig.)

Be careful, Zadig does not have an "Undo" function, setting a Restore Point before installing might rescue you if you make a mistake in the Device selection.

Device Manager shows the USBasp as below.

The USB asp will not power QRP Labs kits. Note other programmers may be able to power QRP Labs units from their 5V output. The USBasp I have reports 50mA to the computer which should then limit the available current. When using the USBasp power the rigs in the normal manner.

While it is unlikely to damage anything I recommend that the 5 volt from the USBasp is not connected to the QRP Labs device. I suggest a small modification to prevent this and ensure the plug is not inserted wrongly in the future.

The U3S header, others similar, check orientation. Silk screen markings show connections. The QCX is not marked but lies along the edge the same as the U3S. My method would be to follow the wires to the USBasp 6 pin plug to identify them. Five connections are used, disconnect the 5 volt wire from the USBasp. Or block off the 5 volt position of the connector plug. If you remove the 5 volt supply pin on the U3S/VFO/QCX (Top left here.) then in future it will only fit one way.

Connect the USBasp and apply power to your circuit board. The later U3, VFO and QCX have 6 pin headers into which the 6 pin plug of the USBasp is inserted. Refer to the QRPLabs documents to ensure it is the correct orientation.

 

This shows a plug, (lifted from http://www.avrfreaks.net/ Note the pin numbers do not conform to convention) The one labelled (8) is the unused VCC and is the one I suggest blocking. But note you may want to use the 5V if you only have the one connector and need to program something else. You might leave it and just be careful.

AVRDUDESS Simply a GUI for Avrdude. The Avrdude commands sent are shown at the bottom of the Avrdudess panel.

http://blog.zakkemble.net/avrdudess-a-gui-for-avrdude/

Downloading the zip and copying into a program folder can avoid false anti-virus warnings.

Select programmer and processor.

Check Avrdudess is seeing the chip, click "Detect".

There are two versions of ATmega328: ATmega328 ATmega328P (there is also an ATmega328A but it is not compatible).

The P suffix indicates some low power features. Then there is a hyphen then some more letters, which indicate the packaging. PU for 28-pin DIP.  QRP Labs kits are supplied with either ATmega328 or ATmega328P

The signature is different. Normally if you see the error about signature, just change the MCU type. (Avrdude -p specification in the command line from m328 to m328p)

You may then click "Read" under "Fuse and lockbits" the High fuse must be D1 for a QCX. See picture below.

NOTE! It seems that somehow some of the QCX chips were supplied with wrong fuse settings. 27 May 2020:- See https://groups.io/g/QRPLabs/message/47789 It appears that up to this date a QCX supplied by the American dealer may have the wrong setting. Check the fuses first! The H (High) fuse MUST be D1 otherwise flashing an update will disable the chip. You would then have to contact Hans for him to help.

 The Fuses & lock bits should normally be left alone unless you are using a new chip. IF the fuses are not read as shown below do nothing until they have been written correctly. Instructions at the bottom of this page. Note the picture shows a slightly different fuse setup, look at the notes below for explanation. Maybe ask in the QRP Labs group.

Locate the latest .hex for "Flash" (and, only if required .eep)

The "Bit clock" may need changing from default. On one PCI I found 187.5KHz to be the fastest without errors but other computers worked at the full speed. Reduce this if errors are reported in the black box at the bottom.

I suggest that you only use the "Go" button in the "Flash" section. This will ensure that just the .hex is installed and will ignore any other settings that may be present in the other sections. Similarly the "Go" in the EEPROM section will only load the .eep file if required.

It is safest NOT to use the "Program!" button, this starts ALL set procedures going.

This shows Avrdudess, current version with Bit clock selection September 2019, setup for a USBasp to update a QCX.

The fuse state may be checked by clicking "Read". The fuses should read as above and should not be written when updating. (Atmel328 the fuses are set L 0xF7, H 0xD1, E 0xFC)

3 December 2019 A slight change, Hans:- "from now one we will supply new chips with low fuse setting 0xD7 not 0xF7. F7 has a 65ms start-up delay which is NOT needed when you are using brownout detection." This is just Hans making the code as close to perfection as possible. It is not necessary to change this fuse but if you program a 328 then set L 0xD7, H 0xD1, E 0xFC.

Writing the Fuses:-

Make absolutely sure you have the values correct. All QRP Labs Atmel328s L 0xD7, H 0xD1, E 0xFC. In the "Fuses lock bits" section "Write" will set them. "Set Fuses" does not need to be ticked, this enables write if the "Program!" button is clicked.

Note:- For diagnosis discussion the contents of the black bottom pane can be important. A way of copying it all is to right click in the pane "Select all" right click again "Copy" then paste into a text file or email.

Here https://groups.io/g/QRPLabs/message/46807 is a list of Avrdude and Avrdudess commands and messages when checking and updating a QCX.

Saving the EEPROM:-

The EEPROM data may be saved. Set Avrdudess like this, enter file name, "Intel Hex" in drop-down, click "Go". NOTE the file will be saved with the name entered into the box. It will overwrite any file with that name without asking for verification. Be sure to give it a unique name unless you really want a file overwritten.

This is useful in case the EEPROM data gets lost. For the U3 it can save different configurations.

November 2019