Me: I'm not an avid C/C++/Arduino programmer, I'm an electronics engineer deep into analog signal processing, and low-level digital logic realms (CMOS, TTL etc).
My need: I'm trying to decide on a programming language and IDE 'path' for my existing hardware project's MCU needs. In particular I am working with the ATmega1284 AND the ATmega328 on my custom board.
What I have now: I already have the PCBs created with those two chips in place. Each chip has an ICSP header for programming via temporary connection from a Sparkfun Pocket AVR. These chips were previously programmed via an IDE that uses the Swift language. I need to switch away from Swift, to C/C++/Arduino or something more widely adopted. I do not need to program the system directly via USB, the Sparkfun>ICSP path is fine for me.
What I've gandered thus far: I've done a little prelim digging and it looks like folks have mixed success with the Arduino IDE + 1284, and somewhat mixed paths/techniques too.
My questions (looking for confirmation and opinions):
If I am using ICSP on my own PCB, can I skip dealing with an Arduino bootloader yet still use the Arduino IDE app for the bulk of the dev work?
What would be the benefit, if any, to trying to get the Arduno bootloader onto the 1284 and 328 on my existing PCB which already has ICSP?
Is it possible to have low-level Assembly code "mixed in" with Arduino code? (My previous developer tells me they had to intermix low level Assembly code with Swift code to achieve some project goals, particularly where dead-accurate signal timing is critical) So can this be done in Arduino IDE?
If not going with Arduino, what would be some runner-up IDEs which can run natively on MacOS, (and which associated programming languages), to make good use of the 1284 and 328 in timing-critical applications, which are interfaced with a slew of external high speed ADCs, DACs, multiplexers and demultiplexers? (ISP, I2C, and UART are in use)
Insightful answers will help inform where I direct my learning-energy next (or what kind of programmer I end up hiring if I can't do it). Don't want to start investing time and energy down the 'wrong' path.
I have quite a bit of experience with this, and nothing other than success. There is a long proud tradition of community support for the excellent ATmega1284P microcontroller in the Arduino community. I think that any reports you saw of people not having success were caused by user error, or perhaps very outdated.
Use the excellent 3rd party MightyCore boards platform to add support for the ATmega1284P microcontroller to Arduino IDE and you'll be happy:
Yes, no problem at all.
The benefit is convenience. During project development, you will probably want to have a USB to serial adapter connected to the board anyway in order to get debug output from your program. So it is convenient to be able to use that same interface for uploading the program to the chips.
Yes. You can use inline assembly in the Arduino code. You can also add dedicated assembly code files (.S) to your sketches and libraries and these will also be compiled.
I thought I would add this detail: In Arduino when using a core such as MightyCore the way to set clock and other essential settings is to Burn Bootloader, and this also sets the fuses to the required settings for the core. If you or your programmer don’t want to use the bootloader and serial uploading for convenience after that, the next time you upload a sketch to the MCU using the programmer (Upload Using Programmer in IDE menu), the bootloader will be erased. So, burning bootloader gives you the baseline fuse settings. You can then further change fuse settings at will using the programmer if necessary (and if you know what you’re doing).
Also I prefer the Arduino IDE version 1.8.19 because 2.x has quirks (hey it’s either the IDE or me having the quirks, not sure which but I’m thinking it’s the IDE) and 1.x IDE has a portable installation mode which I rely on and 2.x does not have that.
For stand-alone MCU application, there is no need to store bootloader program. Bootloader Program allows the MCU to receive codes/data via its UART Port from a host and get them fused into the Application Section.
Microchip MPLAB, after all Microchip makes both of those IC.
Learning curve is steeper but you will have full control of all the ICs functions, without the bloat that the Arduino IDE adds. Programming is in C https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide
If you do not want to use a bootloader, it is better to do the "Burn Bootloader" operation with Tools > Bootloader set to "No Bootloader". That frees up the flash memory reservation for the bootloader, so that user code can use the full flash memory.
Something to consider when using the bootloader is that there needs to be a way to trigger a reset when uploading code, either via the USB connection, or with a manual reset button.