Close

Nasty firmware bug fixed

A project log for PicoRAM Ultimate Rev. 2

SRAM Emulator and SD Card Interface for Vintage Single Board Computers (such as the Heathkit ET-3400, Lab-Volt 6502, and Microprofessor)

michael-wesselMichael Wessel 10/18/2025 at 14:060 Comments

I had a pretty nasty firmware bug encountered during my RetroChallenge 2025/10 contribution:

https://hackaday.io/project/204153-3d-graphics-on-the-microprofessor-mpf-1b

Basically, I was getting glitches and random CPU failures (crashes, SYS-REG, ...) At first I thought these were caused by my MPF-GRAFX card, but it turned out to be an issue with PicoRAM. 


This is fixed now:


An uncaught "glitch" in the SRAM emulation due to noisy ADC button decoding. I have pushed a firmware update to PicoRAM Ultimate and PicoRAM 6116. The problem was that due to bad and noisy ADC thresholds button presses were detected that weren't real. Now, each time a button press is registered, the SRAM emulation is temporarily halted... but it requires the Z80 WAIT line to be connected, which I had not. This caused the issues. Obviously, you can't just halt SRAM emulation and not halt the CPU and expect it to run properly. The problem was fixed by adjusting the ADC threshold levels in the ULTIMATE.INI (or, 6116.INI). But I added some UI Error Message now if such a "spurious" button press is detected caused by noisy ADC and inappropriate analog threshold levels in the init file. Hopefully, this will make the effect at least visible if it should happen again to someone. Because it really was a head scratcher, given that there was no visible indication for this error other than the CPU crashing or glitching. Now we at least see what's going on, and can the manually adjust the thresholds in the init files. Phew!

So, it wasn't really a "firmware bug", as it worked as intended. But, I wasted a lot of time chasing red herrings because the spurious button presses were happening without me becoming aware of them. This specific ADC button level fell through the button decoding "switch / case" in the UI thread running on the second core, and a default case was missing - this is where the error message is being raised on the display now to make the user aware that his ADC threshold levels in the init files are inadequate. 

Checkout the new firmware here: 

https://github.com/lambdamikel/picoram-ultimate


Discussions