Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Minor nitpick, but the C language can handle AVR and Harvard architecture just fine. Rather, the gcc compiler was not designed to handle Harvard architecture. When the AVR instruction set was created, the hardware designer consulted a prominent compiler vendor: web.archive.org/web/20060529115932/https://… Commented Sep 28, 2021 at 8:53
  • 1
    I honestly haven't kept up with the details of the latest C standards, but my understanding was that C99 specified a single address space for data, so putting constants in program memory on a Harvard architecture would require something non-standard. The "Embedded C" extension to the standard does provide a mechanism for dealing with data in multiple distinct address spaces. open-std.org/JTC1/SC22/WG14/www/docs/n1169.pdf (page 37) Commented Sep 28, 2021 at 20:30
  • 1
    I didn't tested it but I would expect the goto approach to have bigger memory footprint than a lookup table and additionally it cannot be moved to an external ROM because it's all executable code. On the other hand, I admit it would be really fast which may be very important on an embedded system. Commented Jul 6, 2023 at 22:23