Are any registers available for faster user variables?
Posted: Tue May 10, 2022 3:32 pm
Hello,
I'm developing an ESP32 based DAC/driver for laser projectors. I'm getting pretty good performance in the main loop that runs via an interrupt (up to 70kHz). I'm also using direct register writes (instead of digitalWrite) to send data to the DACs.
But there are several user-settable variables that could change at any time (X/Y invert, scan speed, brightness, offsets, etc). Right now, I'm storing those in an NVRAM struct using Preferences (since I want the user-selected values to persist between sessions).
But is there a performance penalty in retrieving these NVRAM values to use when rendering the data in the main loop? Is there a better way to load these settings in spare register locations (they are mostly uint8/16/32) to cut down on the time to retrieve these values from NVRAM? Or is there essentially little or no difference?
Thank you.
I'm developing an ESP32 based DAC/driver for laser projectors. I'm getting pretty good performance in the main loop that runs via an interrupt (up to 70kHz). I'm also using direct register writes (instead of digitalWrite) to send data to the DACs.
But there are several user-settable variables that could change at any time (X/Y invert, scan speed, brightness, offsets, etc). Right now, I'm storing those in an NVRAM struct using Preferences (since I want the user-selected values to persist between sessions).
But is there a performance penalty in retrieving these NVRAM values to use when rendering the data in the main loop? Is there a better way to load these settings in spare register locations (they are mostly uint8/16/32) to cut down on the time to retrieve these values from NVRAM? Or is there essentially little or no difference?
Thank you.