0
\$\begingroup\$

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.
\$\endgroup\$
  • \$\begingroup\$ Is that the voltage as measured by the ADC or as measured by probing the circuit with a multimeter? What are the observed voltages on all 4 resistor ends? \$\endgroup\$ – pjc50 Jan 7 '13 at 15:52
  • \$\begingroup\$ Measured by scope and multimeter (not simultaneously). I'll have to double check the resistors, I just realized after getting home that I forgot to measure across R2. 2.5V across R1, consistent with the 800mV reading. I had measured VCC-GND elsewhere, I could check again at the resistor terminals directly. \$\endgroup\$ – Joe Baker Jan 7 '13 at 16:00
  • \$\begingroup\$ It does sound like an extra 100k pulldown has snuck in somewhere, configured on that pin. \$\endgroup\$ – pjc50 Jan 7 '13 at 16:06
  • \$\begingroup\$ The thought had occurred to me, but the min/typ/max values for the GPIO internal pullup/pulldown resistors in the datasheet are 20k/35k/50k respectively. \$\endgroup\$ – Joe Baker Jan 7 '13 at 16:14
  • 1
    \$\begingroup\$ Which pin are you connecting to "audio"? And have you connected the audio ground to the board ground? \$\endgroup\$ – Passerby Jan 7 '13 at 17:39
1
\$\begingroup\$

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."

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.