Arduino development boards are just splendid tool for learning programming Avr microcontrollers in C language, flashing, burning bootloaders etc.
Arduino IDE is also just splendid piece of software, improving and expanding with each new versions; new options and new abilities.
Almost all jobs can be done with Arduino dev. board and IDE.
But sometimes you'll just want to do things fast, simple and direct. Sometimes you'll want to skip some options.
Sometimes you'll wish to do things on lower level with more direct control over processes.
Usual question asked by novices is how to burn raw HEX file into Atmega, simple as that and directly.
Although it can be done with Arduino&IDE; usual answer yet would be: use USBasp (or similar) programmer.
There are plenty USBasp programmer versions on market, cheap and easy to obtain.
And usually when you buy it; it come as it is with ICSP socket and appropriate 10pin or 6 pin cable.
To burn raw HEX into your Atmega, additionally you'll have to properly connect it to USBasp.
Either you'll have to diy proper board for that, either you'll connect it directly with wires, which is not comfortable for repeatable attempts and may present certain risk.
Recently i came across pretty cheap, made in China, "Baite" USBasp, "dongle" look-a-like programmer.
At first several attempts to flash Atmega i faced random time out errors, reported by AVRDUDESS (GUI for Avrdude).
Randomly i succeed and randomly i got time out?
So i searched informations on Internet and founded out several similar reports by others.
Also i founded out a solution. "Baite" USBasp is coming with old firmware, slow SCK line and is not fully compatible.
I don't know why is that. But i realized that it has to be re-flashed with compatible firmware.
So i searched around and founded out the right place where all the infos are available:
http://www.fischl.de/usbasp/
So i picked latest firmware from there.
But! "Baite" USBasp must be put in "self-programming" mode to allow flashing new firmware.
Some "Baite" models coming with easy visible jumpers on the board and some don't.
I had bad luck, because my model came with no jumpers nor marked visible pins for that.
So i had to perform small "investigation" and to find out how to put it in "self-programming" mode.
Actually it turned much easier than i expected! They left place for jumpers on the board!

So i soldered there plain wire jumpers. SCK is not important, i only tested it in "slow" mode and than
returned it in previous state (no jumper).
Than i used Arduino UNO to flash new compatible firmware to "Baite" USBasp.
Arduino boards do have own ICSP connector, so it is really easy thing to connect it with USBasp.
Or any other USBasp may be also used to flash another USBasp, through the same ICSP connection.
Flashing new compatible firmware was easy and fast, piece of cake.
Than i removed "self-programming" jumper.
And than i tried it again with AVRDUDESS. Works like a charm! Splendid!
No more time outs!
...
Further... i don't like to see bulky wires around USBasp and my laptop, it is too risky.
So i realized; i will have to make my own board as addon to "Baite" USBasp.
Because i will need this tool frequently.
So i was thinking... since i am pushed to make a board; why not making it for more different tasks and not just for simple thing like plain connecting with USBasp?
Why not making it as a debugging tool too?
And i did it. I end up with very useful debugging tool&programmer for Atmega328p (though i plan to make more adapters for other Avr types too).
Board is supplied with +5V from USB. No need for external power supply.
But i also added external 9V input, to be able to run and test Atmega and code in it without USB.
So; no need for external supply when flashing HEX into Atmega.
Later when flashed; i disconnect it from USB and "Baite" USBasp dongle and i am supplying it from external 9V (battery or bench supply) in "running" & debugging mode.
Sweet and easy!
This board is made and tested, no errors and no problems.
And actually (in conjunction with any USBasp) it presents sort of "Arduino" of it's kind... an "ICDUINO" !
Enjoy!
Arduino IDE is also just splendid piece of software, improving and expanding with each new versions; new options and new abilities.
Almost all jobs can be done with Arduino dev. board and IDE.
But sometimes you'll just want to do things fast, simple and direct. Sometimes you'll want to skip some options.
Sometimes you'll wish to do things on lower level with more direct control over processes.
Usual question asked by novices is how to burn raw HEX file into Atmega, simple as that and directly.
Although it can be done with Arduino&IDE; usual answer yet would be: use USBasp (or similar) programmer.
There are plenty USBasp programmer versions on market, cheap and easy to obtain.
And usually when you buy it; it come as it is with ICSP socket and appropriate 10pin or 6 pin cable.
To burn raw HEX into your Atmega, additionally you'll have to properly connect it to USBasp.
Either you'll have to diy proper board for that, either you'll connect it directly with wires, which is not comfortable for repeatable attempts and may present certain risk.
Recently i came across pretty cheap, made in China, "Baite" USBasp, "dongle" look-a-like programmer.
At first several attempts to flash Atmega i faced random time out errors, reported by AVRDUDESS (GUI for Avrdude).
Randomly i succeed and randomly i got time out?
So i searched informations on Internet and founded out several similar reports by others.
Also i founded out a solution. "Baite" USBasp is coming with old firmware, slow SCK line and is not fully compatible.
I don't know why is that. But i realized that it has to be re-flashed with compatible firmware.
So i searched around and founded out the right place where all the infos are available:
http://www.fischl.de/usbasp/
So i picked latest firmware from there.
But! "Baite" USBasp must be put in "self-programming" mode to allow flashing new firmware.
Some "Baite" models coming with easy visible jumpers on the board and some don't.
I had bad luck, because my model came with no jumpers nor marked visible pins for that.
So i had to perform small "investigation" and to find out how to put it in "self-programming" mode.
Actually it turned much easier than i expected! They left place for jumpers on the board!
So i soldered there plain wire jumpers. SCK is not important, i only tested it in "slow" mode and than
returned it in previous state (no jumper).
Than i used Arduino UNO to flash new compatible firmware to "Baite" USBasp.
Arduino boards do have own ICSP connector, so it is really easy thing to connect it with USBasp.
Or any other USBasp may be also used to flash another USBasp, through the same ICSP connection.
Flashing new compatible firmware was easy and fast, piece of cake.
Than i removed "self-programming" jumper.
And than i tried it again with AVRDUDESS. Works like a charm! Splendid!
No more time outs!
...
Further... i don't like to see bulky wires around USBasp and my laptop, it is too risky.
So i realized; i will have to make my own board as addon to "Baite" USBasp.
Because i will need this tool frequently.
So i was thinking... since i am pushed to make a board; why not making it for more different tasks and not just for simple thing like plain connecting with USBasp?
Why not making it as a debugging tool too?
And i did it. I end up with very useful debugging tool&programmer for Atmega328p (though i plan to make more adapters for other Avr types too).
Board is supplied with +5V from USB. No need for external power supply.
But i also added external 9V input, to be able to run and test Atmega and code in it without USB.
So; no need for external supply when flashing HEX into Atmega.
Later when flashed; i disconnect it from USB and "Baite" USBasp dongle and i am supplying it from external 9V (battery or bench supply) in "running" & debugging mode.
Sweet and easy!
This board is made and tested, no errors and no problems.
And actually (in conjunction with any USBasp) it presents sort of "Arduino" of it's kind... an "ICDUINO" !

Enjoy!
Comment