Page 1 of 1

msp430f1611, create a vpoltage comparator

Posted: Tue Jun 18, 2013 4:45 am
by fayistnett
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.

Re: msp430f1611, create a vpoltage comparator

Posted: Sun Jun 23, 2013 2:44 pm
by ds18s20
Take a look at CCS' example projects; you just need an external voltage divider if you need to exceed the internal limits; easily done with few external resistors

You can literally copy and paste the "low battery detection" CCS sample project and just change the values to match whatever the external resistor network would read...

Re: msp430f1611, create a vpoltage comparator

Posted: Fri Jul 25, 2014 3:56 am
by Theicaruseffect
Couldn't you read in the voltage using the ADC converter?

Re: msp430f1611, create a vpoltage comparator

Posted: Sat Jul 26, 2014 8:18 am
by ds18s20
oh sure you could but the MSP isn't as popular as Arduino so a good working example code out there is scarce.. so if it doesn't work you are left at your own devices. Using the examples removes the frustration because those actually work... amazing :)