tarun0xe
Member level 2
- Joined
- Jul 25, 2011
- Messages
- 47
- Helped
- 8
- Reputation
- 16
- Reaction score
- 8
- Trophy points
- 1,298
- Location
- India
- Activity points
- 1,812
Hello friends, I am writing the code for Texas Instrument's MSP430F5438 on Code Composer Studio V 5.5. I have multiple channels that I have to connect to single ADC input pin,one by one in sequence, to read the voltage across resistors connected at those channels. If no resistor is connected at any channel, I get the fixed voltage across protection zeners(around 2.36V). The ADC is programmed in 'single-channel single conversion' mode, i.e it reads only single pin and provides the data at only single memory location from where I am copying it into array. The flow is like this :
1.A timer interrupt(50ms) starts the process,select sample index.
2.Select the channel to be connected to ADC input pin.
3.Wait for some time to get channel selection MOSFET settled.
4.Start ADC conversion.
5.In ADC ISR, read the conversion data from memory location into array.
6.Select next channel to be connected to ADC input pin.
7.Follow same procedure for single sample index for 16 channels and after that wait for next timer interrupt(50ms) to select next sample index of channels and so on.
When I single-step through the code during debugging everything works alright, the array has relevant counts. But soon I run the code by putting breakpoints, lets say till sample=10, I get the counts corresponding to 'No resistor present' condition i.e corresponding to 2.36V:-(
I was suspecting that the code is trying to read pin before channel MOSFETs are settled,so all it is getting is voltage across protection zeners each time. But I increased the delay(now it is around 10usecs) after selecting channel, even then the same problem persists. please help me friends. thanks in advance .:thumbsup:
1.A timer interrupt(50ms) starts the process,select sample index.
2.Select the channel to be connected to ADC input pin.
3.Wait for some time to get channel selection MOSFET settled.
4.Start ADC conversion.
5.In ADC ISR, read the conversion data from memory location into array.
6.Select next channel to be connected to ADC input pin.
7.Follow same procedure for single sample index for 16 channels and after that wait for next timer interrupt(50ms) to select next sample index of channels and so on.
When I single-step through the code during debugging everything works alright, the array has relevant counts. But soon I run the code by putting breakpoints, lets say till sample=10, I get the counts corresponding to 'No resistor present' condition i.e corresponding to 2.36V:-(
I was suspecting that the code is trying to read pin before channel MOSFETs are settled,so all it is getting is voltage across protection zeners each time. But I increased the delay(now it is around 10usecs) after selecting channel, even then the same problem persists. please help me friends. thanks in advance .:thumbsup: