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.

MSP430FR5739: Comparator not working

Part Number: MSP430FR5739
Other Parts Discussed in Thread: MSP430F2132

I am having problems getting the Comparator working. I have the + terminal connected to P1.3 (pin 8) of the MSP430FR5739. I have selected the pin as an input and have SEL0/1 set to 0x08 to select comparator operation. In the comparator I have the registers set to 

CDCTL0: 0x0083

CDCTL1: 0x1c85

CDCTL2: 0x0767

CDCTL3: 0xFFF7

I have an input on the + terminal that will vary from ~0Volts when passive and up to about 2volts when activated. In a previous design using a MSP430F2132 I used 0.25Vcc on the negative terminal. I wish to do a similar thing with this MCU. Are there any code examples I can look at (IAR Assembler)? If not can anyone suggest what I am doing wrong?

Thanks

Peter 

  • I found that my technician had made a mistake on the input. It is now OK.
  • Thanks for providing an update that the issue has been solved!

    Ryan
  • I did find another issue about the documentation. (SLAU272C-May 2011. On page 473 it says to enable a channel by setting it to 0. I am using CDPD3 so I set it to 0xFFF7. This caused some very weird effects in my program that I found difficult to fix. When I enabled a channel by setting it to a 1 these weird effects disappeared and it worked. This message is just to let people know.

    Thanks

    Peter
  • Please refer to the Table notes from Section 6.11 of the Datasheet as well as Section 17.2.7 of the Users Guide, setting these bits disables the Px.y input buffer for maximum current consumption savings. Are you using the associated CDx-capable pins for any other purposes and what weird effects did you observe?

    Regards,
    Ryan
  • I have shown my register values above. On this product I have an accelerometer and a duress button (PJ.3). The accelerometer is connected to PJ.0,1,2, P1.4,5. When I have the above values in CDCTL3 the duress button does not function. It is simply a 47K resistor to 3.3V. With the accelerometer it does not function correctly. When I changed the CDCTL3 to 0x00008 all worked ok. For the SEL lines I only have P1SEL0/1 set to 0x09 in both.
  • P1.4, P1.5, PJ.0, PJ.1, and PJ.2 pins are multiplexed with CD4, CD5, CD6, CD7, and CD8 functions, respectively. You should therefore not set the corresponding CDCTL3 bits of those respective assignments, try FE0F or FE07. CDPD3's state doesn't matter since selecting an input pin to the comparator multiplexer with the CDIPSEL or CDIMSEL bits automatically disables the input buffer for that pin, regardless of the state of the associated CDPDx bit.

    Regards,
    Ryan
  • Thanks for the time you have spent with this. Unfortunately I need to carry on with other projects which have to be completed. I still wish to clarify what is going on here so will come back to this in a week or two.

    Peter

**Attention** This is a public forum