ADC Pins not Giving Desired Reading.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC Pins not Giving Desired Reading.

1,160 Views
SidMishra
Contributor II

Hi All, 

We are using a KS20/22 Family MicroController and we have to measure the ADC levels for Validation Purpose. We have two pins in consideration as ADC0_DM1 and ADC0_DP1. 

For ADC0_DM1 which is at 15V, then when we assert it, it should give out value as 2.83, but it is always giving a value reading of  approximately 1.8V ~ . No matter what changes we make the value on that pin remains the same. 

Similarly for ADC0_DP1 ,  we have to read the Pin and when we vary the voltage levels between 0 to 2.5V the reading should vary the same way but here also we are getting the same value constantly near to 1.8V whether we vary the voltage or not.  And when it runs in loop, the voltage value fluctuates a bit but stays around 1.8V. 

Help and Suggestions are much Appreciated. 

0 Kudos
Reply
4 Replies

1,141 Views
SidMishra
Contributor II

@myke_predko 

Thanks for the Clarification over ADC0_DM1 but we aren't using Differential Signal for ADC and it is single-ended. Will it be possible to use ADC channel for a Single-Ended? Like the one we are using. 

We are using ADC_DP1 & ADC_DM1 as a seperate channel.

For ADC_DP1, we have attached a Analog Sensor which gives an output voltage varying from 0 to 2.5 V, taking that as a input we have interfaced that signal with our ADC_DP1 pin(pin no.14). Here we expect the output in step of 0.15V when measured with ADC channel. 

I hope this information helps you to understand my problem.

0 Kudos
Reply

1,132 Views
myke_predko
Senior Contributor III

@SidMishra 

No you cannot use ADC0_DP1 and ADC0_DM1 as two inputs on the same channel.  The two pins can only be used for one channel - either a single ended (with ADC0_DP1 as the only input) or differential (with ADC0_DP1 & ADC0_DM1 as inputs).  

I typically use the ADC#_DP# as a single ended input and tie ADC#_DM# to GND when I use the pins as a single-ended input.  

You are going to have to connect one input to ADC0_DP1 and the other input to another channel.  

As to your problems, can you share a snippet of your code showing your ADC & channel initialization as well as your read trigger and return value?  

1,077 Views
SidMishra
Contributor II

@myke_predko Thanks for the Help ! 

 We are now able to read the pins properly! The Channel Assignment was a bit faulty, just changing a single digit helped ! 

1,154 Views
myke_predko
Senior Contributor III

@SidMishra 

Are you trying to use the ADC0_DP1 & ADC0_DM1 as separate pins?  If so, ADC0_DM1 cannot be used separately - it is either used with ADC0_DP1 when the ADC input is set up as a differential input or can't be used.  Take a look for "ADC0 Channel Assignment for" in the Reference Manual for your part and that will give you pin operation for the ADC and which ADC inputs are used for the channel and "SC1n(DIFF)" values.  

So, I'm not surprised at your results for ADC0_DM1 and you don't give enouigh information for me to understand your results for ADC0_DP1.  

Can you share your code with what you are trying to do?