3 Replies Latest reply on Apr 5, 2020 11:09 PM by VasanthR_91

    ADC routing in Modus for P6 BLE

    GrahamS_21

      Team

       

      i'm trying to get the ADC routing working properly in Modus 2.0 for the PSoC 6 BLE module using the 063 proto board.

       

      i started with the empty psoc project from modus, added LEDs, Button, and uart for printf. all appear to work fine.

      i then added the ADC, and through a lot of trial and error got something to work.

      i followed the examples from the pdl documentation, and have 2 channels 1 single ended and 1 differential.

      the interrupt works ok, but i find if i connect the single ended input to GND or VDD, the differential inputs also change. not to the same scale but there is an affect.

       

      if left floarting the single ended input says ~270mV and the differential one says -1250mV

       

      if i ground the singled ended input that says 0mv where as the diff says -1550mV.

      likewise if i gnd P10_1 input of the diff channel, the value reads 760mv, but the single ended input also say 1280mV.

       

      it seems like it's not disconnecting the channels properly.

       

      i have attached my main.c and my config.h file, that's all i've changed, can you advise why i'm getting odd readings?

       

      thanks

      Graham

        • 1. Re: ADC routing in Modus for P6 BLE
          VasanthR_91

          Hi Graham,

           

          One suggestion could you please reduce the execution time of the ISR. Get the results int the ISR and mark a flag, do the printf action inside the main loop. Also could you try increasing the acquisition time in the code. See sample time (SAMPLE_TIME01) in code.

           

          Best Regards,
          Vasanth

          • 2. Re: ADC routing in Modus for P6 BLE
            GrahamS_21

            Hi Vasanth

             

            the printf in the ISR is lazy coding so i can definitely change that.

            however the sample time is exactly that which is set in the documentation in the PDL.(section for Cy_SAR_Init() )

             

            so if we think the sample time is an issue, perhaps we should change the default numbers?

             

            thanks

            Graham

            • 3. Re: ADC routing in Modus for P6 BLE
              VasanthR_91

              Hi Graham,

               

              The acquisition time should be dependent on the input source, 9 times the RC time constant is the recommended value to be given.

              For inputs which are floating we cannot expect the reading to remain constant. But for inputs with proper input signal this should guarantee proper result.

               

              Best Regards,
              Vasanth