I'm seeing something odd. The project is a dot matrix clock using the Pixelmatix SmartMatrix adapter to a 64x64 LED display. It's working great but I added an option to set the default matrix brightness. It's saved in byte 0 of the EEPROM, read in the setup() section.
What I'm seeing is a large change in frame rate after writing a new default brightness value to EEPROM. I added some counters and it drops from 120 FPS to 49 FPS with noticeable flicker. I read a post here that says Teensy lowers the clock rate while writing to EEPROM. Apparently, it doesn't set the rate back when it's done.
If I change the compile clock time down to 120 Mhz it will write without a frame rate hit. Here is a table of what I observed:
CPU Clock, FPS before write, FPS after write
180, 120, 49
168, 120, 44
144, 119 , 37
120, 77, 77
The offending statement is:
The problem is definitely here, frame rate does not change if I comment that out. I'm going to leave the compile at 120 Mhz as it looks OK at 77 FPS but I think there's a bug.
What I'm seeing is a large change in frame rate after writing a new default brightness value to EEPROM. I added some counters and it drops from 120 FPS to 49 FPS with noticeable flicker. I read a post here that says Teensy lowers the clock rate while writing to EEPROM. Apparently, it doesn't set the rate back when it's done.
If I change the compile clock time down to 120 Mhz it will write without a frame rate hit. Here is a table of what I observed:
CPU Clock, FPS before write, FPS after write
180, 120, 49
168, 120, 44
144, 119 , 37
120, 77, 77
The offending statement is:
Code:
EEPROM.update(0, (uint8_t)defaultBrightness);