- Tue Jun 18, 2013 4:45 am
#160646
I have a msp430f1611 develoment board. I am intend to use it control a switch. the algorithm is to read the voltage input.
While(1)
Read voltage on DC bus
If voltage > upper threshold{
Start PWM on buck converter
Read voltage on DC bus
While voltage > lower threshold {
Read voltage on DC bus
}
Stop PWM on buck converter
}
}
above is the pseudo code I think.
BUt im confused because it seems the comparator A can only compare voltage with reference built-in, like 0.25 V or 0.5 V. but I am intend to have two boundaries. Pleeeeeease! help me! I am in a super hurry.
While(1)
Read voltage on DC bus
If voltage > upper threshold{
Start PWM on buck converter
Read voltage on DC bus
While voltage > lower threshold {
Read voltage on DC bus
}
Stop PWM on buck converter
}
}
above is the pseudo code I think.
BUt im confused because it seems the comparator A can only compare voltage with reference built-in, like 0.25 V or 0.5 V. but I am intend to have two boundaries. Pleeeeeease! help me! I am in a super hurry.