SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By fayistnett
#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.
User avatar
By ds18s20
#160850
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...
You do not have the required permissions to view the files attached to this post.
User avatar
By ds18s20
#173076
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 :)