Progrock Update

Also for all other QRP Labs projects

The Progrock may also be programmed this way. But in a socket, not in-circuit.

ISP CLK Speed or Bit Clock (B) Recently I found both Averdudess and Khazama would not read a new Atmega328. I reduced the clock speed and all worked. Presumably the internal oscillator is too slow for maximum speed. Averdudess maximum speed 187.5KHz.

What I did following Hans instructions for updating the QRP Labs Progrock.

The U3, VFO, Clock and CQX may be updated using the same method preferably 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. Group posts get the methods all mixed up, beginners get confused because of this. I think the method below is relatively simple for the absolute beginner.

A source of the USBasp AVR programmer is http://www.fischl.de/usbasp/ This is the updated version, no warnings as I describe below should be shown.

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

Note:- many of these use old firmware and repeatedly give warning messages with programming software.

Only a little more costly than China, several Ebay dealers in the UK sell them with the with later firmware.

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 other QRP Labs devices in situ.

There are several software programs to load the firmware, I show AVRDUDESS below. https://github.com/zkemble/AVRDUDESS This page in GroupsIO Files shows Averdude basics

My notes below elaborate some points.

Also Khazama, a simple program specifically for a USBasp.

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

[Arduino - Averdude - Windows 10 Pro:- Requires Libusb see here.]

For all QRPLabs devices, U3S for example the instructions are the same, just connect the 6 pin header the correct way.

Installing the USBasp

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.

Note the USB ID is shared by some other hobby USB devices, for example SDRs like the Softrock. Sometimes the USBasp may be identified wrongly. If this should happen then as a check remove all USB devices then the USBasp should be the only device with the 16C0 05DC address. If identified as another device it will probably have the libusb-win32 driver assigned and will work correctly.

Device Manager shows the USBasp as below.

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.

The U3S header, silk screen markings show connections. My method would be to follow the wires to the USBasp 6 pin plug to identify them. Five connections are used, block off the unused one. Remove this unused pin on the U3S (Top left here.) then in future it will only fit one way.

This shows a plug, (lifted from http://www.avrfreaks.net/) The one labelled (8) is the unused VCC and is the one I suggest blocking. But note the Progrock below, I DO use the 5V if you only have the one connector and might want to program something else you might leave it and just be careful.

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.

The Progrock does not have an ISP programming facility. I removed the chip and put it in my makeshift socket, actually a 16 pin but only 14 are required.

Make up something to connect the necessary pins to the USBasp. The 5V from the USBasp may be used to power the chip.

AVRDUDE A command line tool for Windows and Linux etc. [More on Avrdude]

Hans:- Avrdude command line commands in Linux are the same as in Windows except for changing COMn to suit. For me:

avrdude -c avrisp -P COM7 -b 19200 -p m328p -U flash:w:T1.00g.hex -U eeprom:w:T1.00g.eep -U efuse:w:0xFC:m -U hfuse:w:0xD1:m -U lfuse:w:0xF7:m -F (Programs the entire program to a QCX chip in one go using an Arduino. Note the QCX .eep is not publicly available.)

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 Avrdude is seeing the chip, click "Detect". You may then click "Read" under "Fuse and lockbits" the High fuse must be D1 for a QCX. See picture further down.

Locate the latest .hex for "Flash" (and, only if required .eep) The "Bit clock" may need changing. I found 187.5KHz to be the fastest without errors.

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. The Fuses & lock bits should normally be left alone unless you are using a new chip.

Only an early .hex on this computer!

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.

After I'd disabled my USBasp (First attempt to update firmware, eventually I got it right, no damage!) I used my serial adaptor like here and Averdudess to update again. Note my ATTiny84 was not recognised, option "F" had to be used. Then it said "Probably t84" and worked.

(If you have a new Atmel328 the fuses are set L 0xF7, H 0xD1, E 0xFC)

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.

NOTE! A QCX MUST have the High fuse set at D1. Some supplied to America do not. This MUST be set BEFORE updating.

KHAZAMA

My suggestion to load the HEX file:- Use KHAZAMA http://khazama.com/project/programmer/ comes in RAR package . http://www.unziprar.com/ basic utility to unpack.)

I think KHAZAMA is simpler, just made for the USBasp, It is a GUI that works using Averdude "behind the scenes." Note the link to the USBasp, you may prefer to get it from there. Other extraction programs are Winrar or www.7zip.org a program that will be useful at other times.

Unrar install and start KHAZAMA.

There are ways of updating firmware but it is perfectly safe to ignore this warning, just tick "OK" I have programmed several different chips and all have worked correctly. Updating USBasp:- My note near the bottom of this page.

An updated USBasp may give a message that looks like a "Libusb0" error. This requires the ISP speed to be set to "Auto" in Khazama, probably something similar in other software.

KHAZAMA

Select the chip.

Command - Read Chip Signature will show an error if you select the wrong one.

BUT November 2018 When updating a VFO I definitely had an ATMEGA328P but I got this. I ignored it and the chip was updated successfully.

Load the .hex file. Ignore warnings from non-updated USBasps.

March 29 2017 Note progrock v 1.01 has a bug, 1.01a released.

Select the hex file you have downloaded (in this case pr1.01.hex) then write:-

[With not-updated ASPs ignore all Khazama's warnings and there are a lot!]

If you are using a new chip at the bottom of this page I show the Fuse setting tab.

Firmware v 1.01a required.

The Progrock must be connected to a serial port but ensure it is 5V TTL like almost all of the USB adaptors. A cheap USB UART from Ebay search for "TTL-UART-Module-Converter-CP2102" like this. Do not use a computer with built-in 9 pin socket unless you know how.

The USB UART, Pins are connected directly.

COM port pin 2 RXD to ATTiny pin 13 (TX) S1-1. COM port pin 3 TXD to ATTiny pin 12 (RX) S1-2. ATTiny pin 11 to ground enables COM port mode at startup. (S1-3 ON)

I think most commercial USB/Serial adaptors are 5V TTL but maybe not all... Check! Shown is a Silicon Labs CP2102 USB to UART Bridge, very cheap on Ebay.

Then use a suitable terminal program, I'm not sure what is best, Windows Hyper Terminal is one but I'm sure there is something more friendly... Like Termite below, But maybe not for Windows 10 although it does work on my 32 bit version.

Configuration, 1 Stop Bit Tick "Append CR"

? Lists all - 2=27.000.000 Xtal freq. - 3=1 GPS Range Hz. - 4=10.000.000 Load register 4 10MHz (Default Startup). - see Manual Section 4.2-4.6

December 2019:- To load a register without saving in the EEPROM. The syntax works on all registers:

N? To read the value of register N

N=X To write value X to register N and store it permanently in EEPROM (persists through power down cycle, ready for next power up).

N:X To write value X to register N and do NOT store it in EEPROM (valid only while the module is powered, on switch-off this value will be forgotten)... useful for preserving EEPROM lifetime (limited write cycles) if all you want to do is sweep the frequency or operate QRSS FSKCW with it).

If your computer has a 9 pin socket DO NOT USE IT! The progrock requires 5V TTL, not +/-12V from a real port. But a simple resistor/zener may be used to convert the RS 232 TXD to 5V TTL as shown below.

A COMPUTER RS232 SERIAL (COM) PORT TXD (Pin 3) MUST HAVE A RESISTOR/ZENER TO CONVERT IT TO TTL. THE PROGROCK RXD INPUT IS NOT COMPATIBLE WITH COM PORT SIGNALS AND WILL BE DAMAGED.

The simple way to convert. A computer RS232 serial port RXD, pin 2, will receive TTL data. All I've ever used have been compatible.

Fuses.

Any pre-programmed chip does not require these to be set. They are not changed when the flash is erased.

I include this only to show the feature. You need to determine the correct settings if using a new chip. Note the QCX fuses must never be touched. BUT those supplied to America should be checked and reset if the High fuse is not D1. The chip is copy protected you may update but not duplicate.

The way to set fuses with Avrdudess in the Avrdudess section above.

Khazama:- , Command - Fuses and....

First set the fuses as required. They may be set by the mouse in the boxes at the bottom, the drop-downs show what is actually selected.

"Write All"

This is where you may "brick" the chip, make sure your settings are correct! http://eleccelerator.com/fusecalc/ is a guide.

The picture above was read from the Progrock ATT84 chip so should be correct but I must say check!

The values in the tick boxes above are hex.

ATT84

H fuse is DC

L fuse E2

E fuse 01

Lock fuse 03

Someone else read the chip and got a slightly different result, using AVRDudess saying "set fuses to L=E2, H = DC, E=FF, LB = 03. Tried E=01 but when I read the fuses, it came back as FF. All now working." Different programs display the fuse settings differently, see Hans' message linked below.

All Atmel 328s:-

L=F7, H=D1, E=FC. (Note H=D9 erases EEPROM contents. For the QCX it MUST be D1.)

Read here https://groups.io/g/QRPLabs/message/24845 for Hans' definitive explanation of QRP Labs ATmega328 fuse settings. Note that different programs may read back the unused bits differently.

Misc:-

Not for beginners:- IF you use an Arduino Uno then http://qrp-labs.com/images/qcx/HowToUpdateTheFirmwareOnTheQCXusingAnArduinoUNOandAVRDUDESS.pdf

To reflash the QLG1 with a Rapberry Pi http://qrp-labs.com/qlg1/gps2018.html 1000 of them had no PPS.

Progrock frequency accuracy when used with GPS:-

Read Hans' post https://groups.io/g/QRPLabs/message/17866 and maybe other posts in the thread.

From what Hans says his method, if set as he suggests will be almost as good as those suggested below with the advantage that the reference is within SiLabs specification.

Si5351_lock_to_GPS

Using a GPS reference to stabilise the Si5351.

An external reference may be sent to the Si5351 pin 2 with the crystal removed.

One suggestion for a 27MHz reference near the bottom of this page https://sites.google.com/site/g4zfqradio/incircuitprogramatmel168

The Si5351 may be used with reference frequencies outside the SiLabs specification. The QRPLabs VFO (U3S?) and Progrock may be setup for a 10MHz LO from a GPS standard.

Note there is no guarantee for signal purity, my tests seem to show reasonable results, but check! As the QRP Labs tuning algorithm is optimised for signal purity the actual frequency may differ from that set by as much as 0.2Hz but it will be super-stable.

Using a OCXO reference to stabilise the Si5351.

Modern OCXOs are very stable, my 10MHz Isotemp hardly varies 0.1Hz over years. Standard frequency OCXOs tend to be expensive but note the QRP Labs generators may be set for any frequency from around 10-27MHz. Current consumption will be higher but no GPS signal is required.