In adc lcd, potentiometer values fluctuating

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I am doing handson on single ended adc. For that purpose i have used the code from psoc creator code examples which is for 16 bit resolution. But i want to do adc lcd for 8 bit resolution. I have done changes in adc - resolution bit is 8 bit, input range is 1.024 v , continue mode. In main () code, i have changed data type size from 16 bit to 8 bit. I used P6[5] port for pot. When i start to vary the pot, the values are fluctuating and after FF value by varying the pot continue it starts roll over . So my question is why this is happened? Is there any settings required to do?

0 Likes
1 Solution

This function ADC_DelSig_1_GetResult8 returns the result of an 8-bit conversion. If the resolution is set greater than 8-bits, the LSB of the result will be returned. When the ADC is configured for 8-bit single ended mode, the ADC_GetResult16() function should be used instead. This function returns only signed 8-bit values. The maximum positive signed 8-bit value is 127, but in singled ended 8-bit mode, the maximum positive value is 255.

Just change ADC_DelSig_1_GetResult8 to ADC_DelSig_1_GetResult16 and it will work.

Regards,

Dheeraj

View solution in original post

0 Likes
3 Replies