Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think Arduino hardware is a great place to start with embedded, specifically AVRs and avr-gcc. For one, there is a huge amount of daughterboards/shields because of the size of the userbase and common pinouts. Most importantly, devices like the ATMEGA328 (probably the most common arduino chip) are much simpler/smaller than just about any ARM device. There are less than 100 peripheral registers in an ATMEGA328. The peripherals have far less options, and are simpler to configure.

You can also do real debugging on AVRs. I believe its not actually JTAG, but you can still use breakpoints, watch variables, inspect memory, and step through code.



It's called the Program and Debug interface and uses two wires (PDI/O). That's for xMega though. There's also debugWire (one wire). But many chips also support JTAG as well (for both programming and debugging as opposed to using the ISP).

https://microchipsupport.force.com/s/article/On-chip-debuggi...

The official 328 breakout board uses debugWire I think, but you get a nice USB interface. I recommend the dev boards, they're very cheap and quite capable (all pins broken out, prototyping areas, usually a few LEDs and you can use the debugger). They also have a footprint for arduino Shields!

https://www.microchip.com/en-us/development-tool/ATMEGA328P-...

Watching variables is flaky in my experience, but hardware breakpoints and memory inspection work fine.


As a relative beginner with the Arduino API, I never have a reason to poke at registers directly and use print-based debugging over the serial port.

It seems like getting to "blink an LED" early is important for a reasonable "getting started" experience? I'd like to have a real debugger, but it looks awkward to set up compared to just plugging a microcontroller into a USB port.


The "curse" of the Arduino software is that the libraries abstract away the registers. So you get the quick satisfaction of blinking an LED, but you're never forced to dig in to what those libraries are actually doing to make the LED blink. In my opinion, this model leaves you dependent on other people providing libraries. If you eventually want to move on to other microcontrollers, you'll have to be able to read and understand the data sheets, and understand how the registers configure and operate the peripherals.

While a debugger is helpful, you can still work at the register level without one. You can simply print the register values to the serial port. In fact, if you wanted to, you could create a serial console that would allow you to set the registers over the serial port.


Stm32 dev boards. They have on board debuggers. Just plug em in and debug. Bring up is painles with cubemx. Very powerful and fast. My go to for fast prototyping.


You can do debugging on AVRs, it's just not generally exposed in arduino products (neither the hardware nor the software).




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: