2 Replies Latest reply on Apr 16, 2015 11:24 AM by user_14586677

    ADC/Potentiometer noise issue

    alex.swift

      New to the forums, just started using PSoC and the board that I have. Currently working an small project, as we are supposed to use an on board potentiometer to adjust an  on board LED brightness. We are also supposed to report the 16 bit value to the LCD character display. I have managed to perform both of these steps, however there appears to be some sort of noise, as my least significant digit fluctuates.

         

       

         

      Source Code:

         

       int main()

         

      {

         

      LCD_Char_Start();

         

      PWM_1_Start();

         

          ADC1_Start();

         

          Clock_1_Start();

         

          uint16 ADC_Val;

         

          char buffer[5];

         

          

         

          for(;;){

         

              ADC_Val=ADC1_Read16();

         

              PWM_1_WriteCompare(ADC_Val/65);

         

              sprintf(buffer,"%04x",ADC_Val);

         

              LCD_Char_Position(0u, 0u);

         

              LCD_Char_PrintString(buffer);

         

       

         

          }

         

      }

         

      Any suggestions?

         

      Thanks in advance.