msp430f1611, create a vpoltage comparator

Discussions on how to get your MSP JTAG programmer up and running.

Moderator: phalanx

Post Reply
fayistnett
Posts: 1
Joined: Tue Jun 18, 2013 4:40 am

msp430f1611, create a vpoltage comparator

Post by fayistnett » Tue Jun 18, 2013 4:45 am

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
ds18s20
Posts: 104
Joined: Wed Jun 28, 2006 12:17 am
Location: San Francisco
Contact:

Re: msp430f1611, create a vpoltage comparator

Post by ds18s20 » Sun Jun 23, 2013 2:44 pm

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...
Attachments
msp-exp430G2.png
MSP examples from CCS

Theicaruseffect
Posts: 5
Joined: Wed Jul 23, 2014 12:48 pm

Re: msp430f1611, create a vpoltage comparator

Post by Theicaruseffect » Fri Jul 25, 2014 3:56 am

Couldn't you read in the voltage using the ADC converter?

User avatar
ds18s20
Posts: 104
Joined: Wed Jun 28, 2006 12:17 am
Location: San Francisco
Contact:

Re: msp430f1611, create a vpoltage comparator

Post by ds18s20 » Sat Jul 26, 2014 8:18 am

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 :)

Post Reply