3 ms·
Personally C for Arduino programming drives me up the wall. With 32 general purpose registers in assembly language you can often keep all the variables in your
by PaulHoule 4y ago
Personally C for Arduino programming drives me up the wall. With 32 general purpose registers in assembly language you can often keep all the variables in your inner loop in registers and still have a few left over for the interrupt handler. In C on the other hand you know it is moving the stack pointer around meaninglessly just so it can support recursive functions which aren’t really appropriate for embedded systems.
I still write C for it because as beautiful as AVR-8 is, it is a dead end and if I need more capability I can take my C program to an ARM and maybe someday a RISC-V board. (I dream of embedding a soft AVR-8 on an FPGA with some special logic but the engineering students I know tell me that the Verilog class was like getting mauled by a bear.). At least gcc meets me halfway and has 24 bit ints in AVR-8.
For that matter I just got a VisionFive 2 board that I need to put in a case and bring up with Linux. It has been a long time since I had to mess with other peoples C programs and bring them up on a new architecture but I think I’ll be doing it again.