USB ground on MSP430 Launchpad interfering with Comparator_A input voltage

analogaudiocomparatorgroundmsp430

I'm trying to read an audio signal from an Android phone as a serial input to an MSP430G2553, adapting this design to use the MSP430's onboard comparator module instead of an LM324. The Android code to make a square wave out of the audio jack is available here. The output is not pretty, but that's for another question.

In my case, the comparator's positive input is the internal precision voltage reference (0.5*VCC) instead of an external pot. I have applied a DC bias to the audio signal in order to center it around the 0.5*VCC mark before going to the comparator's negative input on P1.5 (CA5) like so (the AUDIO net is CA5):
DC bias circuit

Here's where things get weird. Now, if I plug in USB to the Launchpad to debug, the DC bias on the CA5 input cuts in half from 1.6V to about 800mV. What could possibly be causing this?

I've tried:

  • Confirmed that ground between the MSP430 Launchpad board and my perfboard are nicely connected together like they should be.
  • Set up all of my MSP430 peripheral config in the Grace GUI tools so there's no chance of a careless mistake in setting up a register.
  • Disconnecting the jumper that powers the MSP430 over USB and powering up the 3.3V regulator on my perfboard (there's a DIP socket on the perfboard waiting for the MSP430 once I'm done debugging code). Neither source solves the problem, and the measured VCC-GND voltage is exactly 3.3V in both cases.
  • If I run the MSP430 off external power with the USB cable disconnected (no debugging!), I get my 1.6V bias like normal.
  • Took my laptop out and verified that it wasn't something weird with my work computer, connecting USB to the laptop causes the same behavior.
  • The bad 800mV bias will temporarily go up to the desired 1.6V if I hold the MSP430 in reset with the pushbutton on the Launchpad. Releasing it from reset immediately restores 800mV.
  • Swapped in another MSP430G2553.

Best Answer

The answer from discussion above:

"it was actually the internal pulldown despite the value not making sense. When I configured P1.5 as a comparator input, Grace greyed out the column to configure the pulldown so I figured it was not available when using the comparator alternate pin function. Turns out, if you go into the other tab to set up the registers manually (via checkboxes), the pulldown was still enabled in the register."