Hi, I am using comparator module to monitor the supply voltage and have configured the comparator as follows; #include #include " msp430f5528 .h" #include "math.h" /* * main.c */ int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P6DIR |= BIT0; //selecting CB0 as the V- terminal(3.3V input to be compared with refrence) P6OUT |= BIT0; REFCTL0 |= REFOUT; // Enable REFOUT CBCTL0 = CBIPSEL_0|CBIPEN; // CB0 is set to V+ terminal CBCTL1 = CBPWRMD_1|CBFDLY_2|CBF; CBCTL2 = CBRS_0|CBREFL_2|CBRSEL; // selecting refrence of 2volts and applying at V- terminal int checkVoltage(); { CBCTL1 |= CBON; // Enable COMPE_B __delay_cycles(1000); // Wait for filter circuit to be stable int cbout = CBCTL1 & CBOUT; // Get result CBCTL1 &= ~CBON; // Disable COMP_B return cbout; } } BUT THERE IS NO OUTPUT SHOWN AND IT IS ENABLE TO READ THE REGISTER CONTENTS HOW DO I RECTIFY THIS ?? THANK YOU PRATIKSHA BHUTA
↧