-1
\$\begingroup\$

In the circuit below, I want to measure the voltage going to the ADC (output from the voltage divider consisting of a fixed resistor and photoresistor) using an MSP-EXP432; however, the MSP-EXP432 "Analog In" pin is lowering the output voltage (i.e. the voltage going into the ADC from the voltage divider drops when the "Analog In" pin is connected).

I set the analog pin as an input in the code shown below in Energia.

Is there any way to fix this?

enter image description here

const int bitsOfADC = 14; // 14-bit ADC Launchpad
//int maxVal = 2^N -1; 
// 2^14-1
int maxVal = 16383;
float FSV = 5.0; // Supply to 0804ADC
float LaunchPadResolution = FSV/maxVal;
int D7 = A13;
int D6 = A14;
int ADCInput = A6;
boolean D7_State = LOW;
boolean D6_State = LOW;
void setup()
{
  delay(1000);
  Serial.begin(9600);
  pinMode(D7, INPUT);
  pinMode(D6, INPUT);
  analogReadResolution(bitsOfADC);
  pinMode(ADCInput, INPUT);
}
\$\endgroup\$
  • 1
    \$\begingroup\$ What does Table 5-27 on page 64 of the datasheet suggest to you? \$\endgroup\$ – jonk Mar 9 '19 at 23:12
  • 1
    \$\begingroup\$ You should read the launchpad datasheet to get the processor it uses (see on 1st page.) Then go to the processor page where you find the actual datasheet for the MCU. (This is a very normal process.) It's here: MSP432P401R. Once you have that, you go back to the launchpad datasheet and examine the schematics to make sure that there isn't an opamp being used as a helpful buffer. But since you already identified the MCU pin number, I think the MCU datasheet and the table I mentioned is where to look (unless new information arises.) \$\endgroup\$ – jonk Mar 9 '19 at 23:25
  • 2
    \$\begingroup\$ That worked, the issue was the 5V power was too high; I used 3.3V instead. Thank you \$\endgroup\$ – J D Mar 10 '19 at 0:55
  • 1
    \$\begingroup\$ Possible duplicate of MSP-EXP432 "Analog In" pin taking voltage from circuit \$\endgroup\$ – Elliot Alderson Mar 10 '19 at 0:59
  • 1
    \$\begingroup\$ @JD Glad to hear that it helped to look over that table. Often, that's where you find the issues. So just keep in mind the idea of going to the datasheet, finding the specifications areas related to the question, and reading. You'll frequently find the problem that way, just skimming. Sometimes, it's more than that. But that's usually the best step in the right direction. Anyway, best wishes! \$\endgroup\$ – jonk Mar 10 '19 at 3:51
0
\$\begingroup\$

Thanks to jonk, I found the solution to be setting the positive voltage (going into the ADC and to the photoresistor voltage divider) to +3.3V instead of +5V.

| improve this answer | |
\$\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.