Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
Firmware update with USBasp
I was looking to this too. When studying the schematics, it appears that the 5 V bus only supplies IC2, 3, and 4. The rest of the circuit is powered via the 12 V rail which is taken from the input of the 7805. My assumption would be that with an average USB port from a desktop (typ. 500mA capability) this should not cause any problem (provided that putting 5V on the output of an unpowered 7805 will not cause any additional current drain).
-- Regards/73, Enno, PF5X |
I was looking to this too. When studying the schematics, it appears that the 5 V bus only supplies IC2, 3, and 4. The rest of the circuit is powered via the 12 V rail which is taken from the input of the 7805. My assumption would be that with an average USB port from a desktop (typ. 500mA capability) this should not cause any problem (provided that putting 5V on the output of an unpowered 7805 will not cause any additional current drain).Enno, Somebody did try this recently and said it did not work. But later said it did when powered independently. I also tried on something, I could not see why, as you say the USBasp's 5V is connected directly to the USB 5V. But I did not check the voltage, just powered it normally. I believe a USB device reports the current it takes and the computer then might current-limits the output. I am unsure if it is a good thing to feed 5V to the output of an unpowered regulator. 73 Alan G4ZFQ |
On the same topic. Would it be possible to (re-)program the chip in a?stand-alone?programming circuit?according to this schematic:
I am not sure, because the chip might be programmed to expect an xtal oscillator. What I understand from the ATMEL datasheet is that during programming there need to be?some type of clock (either internal, external or xtal) running apart from the serial CLK signal provided by the SPI. (Clock choice is set with fuses I believe ...) Anyone having experience with this? -- Regards/73, Enno, PF5X |
Just to let you know that I have successfully reprogrammed my QCX a couple of times with a USBTiny ISP with the power for both the programmer and QCX both coming from the USB port of my laptop. My programmer has a configuration jumper to allow separating the power but I left it on.Warren, I just checked, my USBasp tells the PC 50mA (USB View) so if the PC really limits power on the USB outlets then that's why mine does not work. I guess they are not all equal. 73 Alan G4ZFQ |
Hi Enno Yes, you can use a standalone programmer like that to upgrade the firmware in a QCX chip. Yes, it will only work with a crystal - the fuses are programmed for the QCX chip to use the external crystal (20MHz in this case). You cannot program the chip with no clock signal. That circuit will work, just connect a crystal across xtal1 and xtal2 pins. Just for programming purposes, any crystal should be fine e.g. 8MHz, 10MHz, 16MHz. Not more than 20. Theoretically xtal1 and xtal2 should also have a small capacitor to ground e.g. 10pF, 15pF, 22pF etc., but I have not found it to be necessary. 73 Hans G0UPL? ? On Nov 20, 2017 5:57 PM, "Enno Korma" <enno.pf5x@...> wrote: On the same topic. Would it be possible to (re-)program the chip in a?stand-alone?programming circuit?according to this schematic: |
Thanks for all the comments. I took the plunge (always afraid of bricking my processor ...) and used my €2 USBasp (bought on e-Bay by some French electronics outlet, which happens to have fast delivery with the lowest shipping cost) onto my QCX. My programmer had a 3.3/5V voltage jumper, so by taking it off there was no supply voltage available from programmer side.
I downloaded Extreme Burner AVR (). This is a brilliant, ultra simple program which co-installs THE USBlLIB0 DRIVERS !!! (in Win7 just tell Windows to install these despite them being unsigned, In Win8 and up you have to go the extra mile to get this done, see other posts and Google). Fired up the program, fired up QCX, put the programmer in the USB slot of the PC and finally connected it to the QCX. Then, for testing, I started to read the Flash memory to check whether the communication was OK. Then loaded the 1.00d hex file, and chose 'write flash'. BE CAREFUL HERE AND DO NOT PUSH THE 'WRITE ALL' BUTTON as you will write the EEPROM as well and maybe even the fuses with the default values of the program. In particular that last one you will not want ... Loosing the EEPROM content is just unhandy. I guess you have to re-program all settings. But better to prevent this ... The write process takes only 30 sec or so. Checked the CW-R (LSB) setting and yes it works now ! Thanks Hans for this fix. -- Regards/73, Enno, PF5X |
I ordered one from eBay, from seller effortagain (shipped from USA) and used it successfully last night to update the firmware in my QCX.
Delivery was quick. $6.88 total cost. Had to download drivers found via Google search and used software previously mentioned. One thing to keep in mind- in the programming software, select ATmega328P, not ATmega328 as the target processor type. GL, Bruce N1RX |
Hi Bruce, all NOTE: The chip will not always be ATmega328P. QRP Labs chips can sometimes be ATmega328P, sometimes ATmega328. Functionally, for our purposes, they are equivalent. We use both types, depending on availability and cost. To know which one you have, you could peel off the paper label with the version ID on it (anyway you are going to update the version ID so the label will become out of date!). Or, just try ATmega328P; then if AVRdude (etc) gives you an error message about the device signature being incorrect, change it to ATmega328 and try again.? 73 Hans G0UPL On Wed, Nov 22, 2017 at 2:29 AM, Bruce Beford N1RX <n1rx@...> wrote: I ordered one from eBay, from seller effortagain (shipped from USA) and used it successfully last night to update the firmware in my QCX. |
¿ªÔÆÌåÓý? Thanks for the tip on the QCX using one of two possible processors, Hans, As mine had a 328P, and the parts list in the current manual gave that number, I assumed they all were. As you indicated, the programming software spewed out an error when I had 328 in there (per other published instructions on the qrp-labs webpage). 73, Bruce N1RX ? |
Is Extreme Burner AVR downloadable through anywhere but fishy third-party sites?? I can't find one so far.The home site sends you to a site that asks you to accept emails in return for the program. It's your choice. You do not have to use it. Have you tried the USBasp on another computer in case there is some incompatibility with the first? 73 Alan G4ZFQ |
On Wed, Dec 27, 2017 at 01:49 pm, Alan G4ZFQ wrote:
Have you tried the USBasp on another computer in case there is some incompatibility with the first?I spent all day on this, using three computers and two different OSs.? None recognize it.? Zadig doesn't find it in "all devices.". I'm stuck in the gate. I even tried several distributions of live Linux to see if it was detected under lsusb in terminal.? Typically, even a non-working (or even fake) USB device will at least show up, but it didn't.? I understand that the ATmega8 chip is supported in some kernels.? Apparently not.? This was a static-bagged, sealed unit, and normally those have been QCed, but who knows? Assuming that the ATmega8A chip doesn't require some absent bootloader, this unit seems to be DOA.? All I get is the red LED showing steady.? I wouldn't think a common USBasp could be this difficult to bring up, as it's a very simple device.. |
John Backo
Enno:
Programming a microprocessor involves lots of different programs and each does a particular job. You, the "programmer" see only the interface with more or less language-based information. You tell the rest of the programs what you want the microprocessor to do. That language-based program is interpreted and put together by the compiler and its associates. Remember that the microprocessor understands only binary information; it has no idea what any other language is. The compiler produces a binary file which is the "program" for the processor. Then it hands it off to another program. In the case of AVR and ATmel microprocessors, the compiler which translates your language file into binary is the gnu compiler. The compiler translates the language file to the binary file and hands it off to AVRdude. It is the responsibility of AVRdude to get the program into the processor. AVRdude knows that there are 3 program areas in every 8-bit ATmel chip. One is the main flash memory. Another is the EEPROM memory. And the third is the fuse memory. It looks at the binary file and arranges it so that each area is covered according to what the compiler has told it. It then connect to the programmer, which is the actual physical connection to the processor, and uses a protocol to communicate. That involves using a serial clock signal for getting bits of information into the processor and the miso and mosi signal ports to get and receive the actual binary information. It also knows something else. It has to identify the processor. So, the first thing that AVRdude does is to ask the processor (via scl, miso, and mosi) "Who are you?" There is a special area in every ATmel chip which is programmed at the factory with a number. That number is the ID of the chip. AVRdude knows, because it has been told, what to expect,i.e., what chip is out there and what the number should be. The chip responds with its ID number and then all is well. If it doesn't, AVRdude tries up to 10 times to find out what it is. If it doesn't find out, or the answer it gets is "000000", then it gives up and tells us that it didn't find anything or that it is not what it wanted and it can't go on. Unfortunately, the information AVRdude gives us is pretty cryptic and useless for the average user...but at least we know something is wrong. If all is well, AVRdude has identified what chip is out there, and then prepares the physical programmer to transfer its binary information. It writes flash memory. Then it writes EEPROM memory if it has been instructed to do so. And then it writes to the fuses. Almost all the information for the operation of the program is contained in the fuse bits. The most important for AVR users is perhaps what oscillator to use. ATmel chips are capable of operating on an internal oscillator. Usually it is limited to about 8 MHz. It can also operate on an external oscillator, which can go to 20MHz or so. It knows which to use according to the information in the fuse area. Now suppose, the program is flashed into memory ok, but the fuse information says "Look for an external oscillator". The processor looks for that oscillator and if it isn't there...it stops operation. Almost all AVR programs use an external oscillator. That is why one should be present on the ad-hoc or pc programming board. All Arduinos have one, for instance.. Now as to scl, mosi, and miso, they are used only during the programming of the chip; they disappear (under the supervision of AVRdude) when programming is finished and verified. The fuses determine which oscillator to use from that point on, and the processor must have some oscillator to operate. Once programming is finished, the need for the physical apparatus that connects the serial or USB port to the processor is also finished. You can leave it connected, but it is not doing anything. There is one exception. That port is used for special serial communication between the processor and the computer. But neither the editor, the compiler, nor AVRdude is involved anymore. That is controlled by yet another program in the whole suite, the serial communications program is the controller, and the pins Do and D1 (Tx and RX) are the serial port on the processor. So programming a microcontroller is not exactly a simple process. But most of it is not the responsibility of the user, the programmer. He or she is responsible only to see that the environment is ok for the other programs to do their job, and to enter the program in a human-readable form. The rest is handled internally and pretty much invisibly to humans. We can request informational messages to chart progress. And, of course, error messages are automatically given out to the human user. We see the result of those in all kinds of threads in this list. There is usually a lot of other things involved, but the main thing for the human user is getting the language part right, and realizing that there are both physical and binary parts to the program. They do most of the work automatically if they are configured right. Hope this helps. john AD5YE |
to navigate to use esc to dismiss