biza 0 Posted March 20, 2017 Share Posted March 20, 2017 Fellows, I'am trying to adquire a signal with ADC converter in the MSP432, but some problems appeard. I try to read lm35 sensor temperature and before conect the lm35 output signal to input pin of MSP432, i made a mesurement with multimeter and i see the pin has 1.10 +/- 1.15v. It's this normal? The code was made in ccs, and with classic programation (registers), this is the code: #include "adc.h" #include "lcd.h" #include "stdio.h" extern char Mensaje[]; /**/ void adc(void){ volatile unsigned int i; /*ADC CONFIGURATION*/ P5->SEL1 |= BIT4; P5->SEL0 |= BIT4; /*ENABLE GLOBAL INTERRUPTS*/ __enable_irq(); /*ENABLE ADC INTERRUPT IN NVIC MODULE*/ NVIC->ISER[0] = 1 << ((ADC14_IRQn) & 31); /*Sampling time, S&H=16, ADC14 on*/ ADC14->CTL0 = ADC14_CTL0_SHT0_2 | ADC14_CTL0_SHP | ADC14_CTL0_ON; ADC14->CTL1 = ADC14_CTL1_RES_2; ADC14->MCTL[0] |= ADC14_MCTLN_INCH_1; ADC14->IER0 |= ADC14_IER0_IE0; SCB->SCR &= ~SCB_SCR_SLEEPONEXIT_Msk; while (1) { for (i = 20000; i > 0; i--); // Start sampling/conversion ADC14->CTL0 |= ADC14_CTL0_ENC | ADC14_CTL0_SC; __sleep(); __no_operation(); } } void ADC14_IRQHandler(void) { int value_adc=ADC14->MEM[0]; float value_vol= value_adc * (3.3/4096); //sprintf(Mensaje,"%d",value_adc); sprintf(Mensaje,"%1.2f",value_vol); LCD_SetText(Mensaje,5 ,0); } Quote Link to post Share on other sites
NurseBob 111 Posted March 20, 2017 Share Posted March 20, 2017 A few questions: What is your power supply? What was the temperature of the environment? The lm35 needs at least a 4V supply. Its output is 10mV/degree C, so at 20 degrees C, the output should be 200 mV. enl 1 Quote Link to post Share on other sites
biza 0 Posted March 20, 2017 Author Share Posted March 20, 2017 Thank you Nurse Bob, for answer my question, I have 5V power supply to LM35. but my problem has in P5.4 without connect to the output pin of LM35, in the multimeter I measure 1.10 to 1.15V , why? All that calcules are in LM35 data sheet. Quote Link to post Share on other sites
NurseBob 111 Posted March 20, 2017 Share Posted March 20, 2017 Do you have another device? I have some lm34s -T092 devices (read F instead of C) and in my home office I'm seeing .70V - or 70 degrees F when attached to the LP 5V tap. My recollection is that it's easy to damage the devices with ESD or if wired wrong... Other than that, I don't have more to offer. Bob Quote Link to post Share on other sites
biza 0 Posted March 21, 2017 Author Share Posted March 21, 2017 No, I don't have another device. But forget the LM35 sensor, you configure the P5.4 to receive a analog signal and convert him, why this pin have oscillation voltage, I have used a multimeter and I measure this pin and I get between 1.10 and 1.15V. Quote Link to post Share on other sites
NurseBob 111 Posted March 22, 2017 Share Posted March 22, 2017 > I have used a multimeter and I measure this pin and I get between 1.10 and 1.15V. Is this in reference to the msp432 pin? I thought you were measuring the lm35... So, if you're testing the P5.4 pin, and you have CCS, I'd look in the debugger at the port registers to see if your statements to set P5.4 SEL1 and SEL0 are actually working as intended. Where is the sample code from? Aside from that, I don't have a suggestion. Quote Link to post Share on other sites
enl 227 Posted March 22, 2017 Share Posted March 22, 2017 On 3/20/2017 at 5:34 PM, biza said: Thank you Nurse Bob, for answer my question, I have 5V power supply to LM35. but my problem has in P5.4 without connect to the output pin of LM35, in the multimeter I measure 1.10 to 1.15V , why? All that calcules are in LM35 data sheet. Am I reading correctly that this is with the LM35 not connected to the input pin? In other words, there is nothing connected to the input pin? If this is the case, then the potential on the pin will float, generally to about half of the power supply, give or take (depends on the device) and, being configured as an input, it will have very high impedance, so it will pick up noise. You would be measuring more the properties of the multimeter and its interaction with the floating input than a real potential. NurseBob 1 Quote Link to post Share on other sites
biza 0 Posted March 24, 2017 Author Share Posted March 24, 2017 Enl, thank you for your answer So I understand your explanation, but how can I proced to read temperature with that sensor. Since I dont obtain a consistent temperature I remove the pin P5.4 from MSP432 and measure the output pin voltage, where I see a float voltage between 1.10 to 1.15 volts. Thank's in advance Quote Link to post Share on other sites
Horence 0 Posted May 17, 2017 Share Posted May 17, 2017 After reading the whole post, I have learned more about this topic. Thank you so much. Quote Link to post Share on other sites
NealXu 0 Posted January 3, 2018 Share Posted January 3, 2018 Hi...as i can observe here nothing connected to the input pin. In this case the potential on the pin will float, generally to about half of the power supply, give or take (depends on the device) and, being configured as an input, it will have very high impedance, so it will pick up noise. turnkey pcb Quote Link to post Share on other sites
biza 0 Posted February 4, 2018 Author Share Posted February 4, 2018 solved Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.