B4R Question How to upload code to a bare bones AtMega328 chip

Jakes72

Active Member
Licensed User
Longtime User
Hi Experts,

I hope someone can help me here. I have a AtMega328 chip which I made a circuit for myself (poor man's Arduino UNO). Now my question is, how can I send a program to this chip directly using B4R, as it only allows uploading of code to commercially made boards such as the UNO, Mega etc?

I know that I can get the .hex file it compiles and upload that then to my chip using AvrDude (or similar), but I was hoping there would be a direct way of doing it. In other words, B4R would need an option to upload the .hex file via something like a UsbAsp or similar programmer.

Problem is that it burns unnecessarily to the expensive commercial board and obviously these chips have a limited amount of times they can be burned too, which is why i just want to use my 'cheap' chip for testing.

Any thoughts?

Thanks in advance.
 

positrom2

Active Member
Licensed User
Longtime User
I guess you won't get it cheaper all in all since you would need at least an ISP programmer and an serialtousb converter. There are cheap Uno clones around. The Arduinos are programmed directly via their incorporated bootloader.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
As saídas above, you will need at least to burn the Arduino bootloader, unless you are pro-efficient in machine code (assembler I think)
 
Upvote 0

Jakes72

Active Member
Licensed User
Longtime User
Thanks for the replies guys, but I have found a work around solution for now.

What I simply do is too plug in my CP2102 (USB To serial adapter) into the USB, then I select it's COM Port in B4R.
This 'fools' B4R into thinking a board is connected and it happily now compiles the .hex file to C:\Arduino\Objects\bin\src.ino.hex (Replace C:\Arduino with your own install path for the standard Arduino IDE), so this way I get my file and I am also not unnecessarily burning to a commercial board! The CP2102 of course does nothing, but create a 'dummy' COM Port.

Hope this can help someone else!

Erel would be awesome though if you could add a feature to say remote control AvrDude to upload the code straight via a USBAsp to the bare bones 328 chip with this AVRDude command:
-c usbasp -p m328p -b 19200 -B 1 -P USB -U flash:w:C:\Arduino\Objects\bin\src.ino.hex:a
 
Upvote 0
Top