Max II Config Complete Detection
I currently have an issue where I am trying to separate a power-on reset from a "software reset". Basically, in our system we have a DSP that accesses several registers in a MAX II CPLD via SPI. The DSP is also responsible for powering up the CPLD. When the DSP asserts the supply enable to the CPLD, it also asserts a RESET line to the CPLD. When a power-up occurs, and the reset is asserted, I want the CPLD to set all registers to their default values. This is considered a "power on reset". However, the DSP can also assert the RESET line at any time during normal operation, which is a "software reset". This Reset should cause the CPLD to clear only certain registers, while others retain their value. Only when the RESET is accompanied by a device configuration should everything be set to defaults.
Now, the MAXII datasheet claims that all registers are set to 0's when configuration completes and the device is released to user mode. So what I do, is create two signals - config_complete and config_complete_d. At my first positive clock edge after configuration, I set config_complete to a 1. At the next edge, config complete_d follows. In my code that is responsible for resetting the registers, I say: if(config_complete && ~config_complete_d) "reset registers to all 1's". For some reason though, this code is not executing, and the registers are starting with all 0's, instead of the intended all 1's. I think it may be getting optimized away. I know it is a bit of a weird scenario, and the real solution would be to have a power_on_reset chip asserting a GPIO to do this. However, it is too late in the game for that, and I need to try to figure out a way to discriminate between this power-on reset, and the "software reset". Anyone done something similar, or have an idea how to create a "config_complete" detector for the MaxII? Any help is greatly appreciated.