3 Replies Latest reply on Oct 29, 2018 6:40 AM by DheerajK_81

    In adc lcd, potentiometer values fluctuating

      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?

        • 1. Re: In adc lcd, potentiometer values fluctuating

          That shouldn't happen. Its quite strange. Can you please provide your PSoC Creator project? It will make debugging easier.




          • 2. Re: In adc lcd, potentiometer values fluctuating

            Its similar with code example (ADC_single_ended). Only change is ADC Resolution of 8 bit.


            uint8 output;


                /* Start the components */





                /* Start the ADC conversion */



                /* Display the value of ADC output on LCD */

                LCD_Position(0u, 0u);







                        output = ADC_DelSig_1_GetResult8();

            LCD_Position(1u, 0u);




            • 3. Re: In adc lcd, potentiometer values fluctuating

              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.