This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 Timer_A and Comparator

Other Parts Discussed in Thread: MSP430F5342, LM311

I'm using an MSP430F5342 to generate a square wave using Timer-A. I would like to monitor a DC voltage and shut off the square wave from the timer when the voltage exceeds a certain level. It seems as if this could be done using Comparator_B since it is tied into the Timer_A system. However, I've been yet unable to determine if this can be done by going through the datasheet and user's guide.

Note: I need this to happen in hardware because the system can't handle a software delay between detecting the DC voltage level, and shutting off the square wave. For example, I can not monitor the DC voltage by reading an ADC, then turn off the timer using software. This is too slow. Another example would be generating an interrupt from the comparator that shuts down the timer. I believe this is still too slow. I am currently performing this function in hardware with external components (comparator and AND gate) and would like to eliminate these parts and pull the function into the MSP430.

Does anyone know if this can be done, and perhaps can provide an outline of how? Thanks.

  • Hi Jim,

    Did you ever get this solved? And yes how did you solve this? Now I am busy/trying with an LM311. But I really would love to do this without that external chip.

    Thanks you very much..

  • Comparator_B can trigger a capture interrupt for CCR1 of all three tiemrs, Hpwever, this doesn't influence and other CCR units operation. It is only useful to determine at which timer coutn the comparator triggered.

    For diabling the wave output, you can set up the comparator to trigger an interrupt (same as if you were triggering the capture interrupt of TxCCR1) and manually switch off the wave output.

    A plain hardware solution is possible if you use an external AND gate and gate the square wave output by the comparator output. But without external hardware this is not possible.

  • Thank you for your reply, even if it is an answer more to Jim's question direction.

    I understand now that I am in the wrong direction with my question. I notice that I have to redesign my idea on paper and text because I understands my need it different then here mentioned. I will open a new topic closer to mu needs.

    Greetings

  • Rene Amerongen van said:
    Thank you for your reply, even if it is an answer more to Jim's question direction.

    Well, since you said you're having the same problem, I thought the answer would fit both. :)
    But if my answer revealed that you actually don't have the same problem, but a different one, then I think it was helpful still :)

    Jim: Einstein was right (in very many, but not all things): Today, everyone (well, almost everyone) can get all required information through google. Still people are coming here, searching for knowledge - and some rather need wisdom :)

**Attention** This is a public forum