2009-03-30 01:52 PM
2011-05-17 12:58 AM
Hello, I'm using a STR912FAW44, and I'm trying to set the DISEST bit in the MC_PCR1 register, to disable emergency stop of the PWM, since I'm just using the PWM to trigger ADC conversions. However, I cannot get the DISEST bit set - either programmatically, or even just using the IAR debugger. I am not accessing the MC_LOK bits either. I tried calling MC_EmergencyCmd(DISABLE) right after the clock inits in main(), but no luck. I did find and fix a bug in MC_EmergencyCmd() - the original code was:
void MC_EmergencyCmd(FunctionalState NewState) { if(NewState == ENABLE) { /* Reset the DISEST Bit in the PCR1 Register to enable the emergency stop input */ MC->PCR1 &= MC_DISEST_Reset; } else { /* Set the DISEST Bit in the PCR1 Register to disable the emergency stop input */ MC->PCR1 |= MC_DISEST_Reset; } } I changed the disable case to: MC->PCR1 |= MC_DISEST_Set; Any ideas why I cannot disable the emergency stop? Thanks in advance Chuck Smith