Solved: Peek/ Poke?

I think people lose the fact that it is still executed line by line in order.

Until you throw in interrupts and callbacks. Then, it all goes to hell.

My project is only needing to store radio station presets. I don't think anyone is going to be changing those, thousands of times, in the lifespan of a radio! ;)

In another thread, I'm getting the impression that the addresses of the EEPROM (or the variables?) are handled by the compiler, so there's no way to REALLY know them to use a "PEEK(address)" and "POKE(address)" kind of syntax... but good grief, man, the EEPROM DOES occupy a fixed place in the memory map of the Arduino! Knowing THAT, and having a means to directly "PEEK" and "POKE" there, would solve my problem! :)

Willie—:

good grief, man, the EEPROM DOES occupy a fixed place in the memory map of the Arduino!

Arduino memory does not use monolithic Von Neumann style architecture.

If you put a value in say EEPROM location 123 then it will be there when you need it. Think of that as POKE then PEEK if you want to.

ChrisTenone: Arduino memory does not use monolithic Von Neumann style architecture.

MIND BLOWN :O

OK... guess what? I just learned something new! I'm reading up on it, now... I honestly had no idea! Here I am, so used to thinking about a CPU working purely in Von Neumann terms... NO STINKING WONDER I'm standing here, cross-eyed and drooling... I'm lost in Boston, holding a New York City street map!!! ;) LOL!

ChrisTenone: Arduino memory does not use monolithic Von Neumann style architecture.

Yes. And while roughly speaking, it is a Harvard architecture (as it has separate data and program memory), the EEPROM space doesn't fit neatly into either category.

In a way the EEPROM sits more like a peripheral device than a memory space. With the entire 1k (or whatever) EEPROM space essentially being accessed through a portal at 0x3F..0x42 in the data memory space.

YES! Which I have only JUST NOW discovered... which explains VERY CLEARLY to me, WHY I can't just "PEEK" and "POKE" it! It's not even "in the memory map"! So... put a little lightbulb icon here... DING! (*) The light has come on for me! I got some good advice in another thread, regarding using the EEPROM for my radio presets! Whew... :)

PS: WHY does the 5 minute rule affect an EDIT? :P

Willie—:
MIND BLOWN :open_mouth:

Yeah it’s definitely a quirky little architecture. And it gets even weirder the way that the data memory space overlays the IO memory space, but with a 0x20 offset, and that it even overlays the basic MPU registers (as in R0…R31) as well

So for example (in assembler) “LDS R16, 0x55” is just a slightly less efficient way of performing “IN R16, 0x35”, and similarly with “SDS” and “OUT”.

But even more obscure is that “LDS R16, 0x1F” is just an inefficient way of performing “MOV R16, R31” for example.

:smiley: