Hi,
I am new to Arduino and have been finding it a great tool to build prototypes for all kinds of use cases.
I have a general question - is there any way to build a version of the Arduino software for custom boards ? Like, I have a couple of boards built using Atmel Atmega 4820 and 8820. If I could develop code and program them with the Arduino IDE, it would be great.
Yes, sure, there is a way. There are many custom board for MCUs which are not in arduino.cc portfolio. I have also my own board for ATmega1284P - see my signature.
But, what did you mean ATmega4820? Is it ATmega48 and 88? In fact, they are already supported. They are just smaller versions of 328.
Do you mean the atmega48-20 and atmega88-20? (20 MHz capable atmega48 and atmega88 chips). If so, you’re in luck - they already have support via MCUdude’s “miniCore”
I think you will also need to upload bootloader on your Microcontroller.
I haven't worked on these microcontrollers but I have once bought ATmega328 and then used it in Arduino UNO board and I have to install boatloader on it.
sterretje is correct that the bootloader is not needed if you want to do use an ISP programmer to upload to your microcontrollers using the Arduino IDE's Sketch > Upload Using Programmer. However, Burn Bootloader actually does two things:
Set fuses on the target microcontroller according to the definition of the board you have currently selected from the Tools menu. In the case of MiniCore, they are determined by the Tools > Board, Tools > Bootloader, Tools > Clock, and Tools > BOD selections.
Flash the bootloader to the target microcontroller.
Although the second step is useless when you're doing Upload Using Programmer since that will erase the bootloader, the first step is essential. The exception would be if the fuses on the microcontroller happen to already be set according to your desired configuration (which is unlikely).
[attiny48/88 is NOT the same as the atmega48/88...]
But, but, but ... why would they do that !?
Oh, the prefixes are entirely different, so it's not that bad. In fact, the tiny48/88 is the same package as the mega48/88, and same memory, just with less other features. (tiny88 only has 64bytes of EEPROM, and doesn't have any uart, for example.) You wouldn't expect an 7414 and a 4014 to be similar, would you?
In any case, it's far from the worst of Atmel's naming gaffs. I think it's ridiculous that the mega328p and mega328 have different signatures with only one tiny little difference, while the ATmega644 and ATmega644A have the SAME signature, even though the A version has two uarts vs only one in the non-A version. And don't get be started on the new "PB" chips, or the xx7 and xxx9 chips!
Yeah, I hate Atmel's register mnemonics too. They read like Inuit language. (Not that I hate Inuit language - it just shouldn't be used for programming.)
@westfw, @budvar - yes, i did mean the tmega 48-20 AU and the 88-20 AU chips. I was rummaging through my old hardware box and found these two boards lying in there, unused for along time. Also, i have a couple of boards with the 644A, too. Glad to know that the IDE already has support for all these.
@pert - thanks for the links to Minicore and the 3rd party hardware specs.
I will take out some time and see if i can make use of these.