2 Replies Latest reply on Jan 30, 2019 3:12 AM by JuPa_302041

    SAR ADC Modustoolbox

    JuPa_302041

      Hello Everyone, I am just getting my head around Modustoolbox, It is a very powerful tool. I guess the problem we face with PSoC devices is shortage of simple examples to get a head start.

      I am trying to get SAR ADC to read 3 analog single ended signals on the psoc 6 BLE PROTOTYPING KIT (cy8cproto-063-ble) I cant find a working example, been putting some code together sort of works I am getting an interrupt triggered by the EOS routine. The SAR conversion is triggered with the user button, and the UART is used for preview the values.

       

      surely I am missing something. .chanEn = 7UL,? seems ok, Cy_SAR_Init(ADC_HW, &ADC_config); then enable and start convert.

      the program runs I am not getting any values that can relate to the voltage.

       

      any help is appreciated

       

        • 1. Re: SAR ADC Modustoolbox
          VasanthR_91

          Hello Juan,

           

          Could you please enable the Aref block too before using the SAR ADC.

           

              cy_en_sysanalog_status_t status_aref;

              status_aref = Cy_SysAnalog_Init(&Cy_SysAnalog_Fast_Local);

           

              /* Turn on the hardware block. */

              Cy_SysAnalog_Enable();

              /*

           

          I have attached one sample code I have generated too which was tested to be working at my end.

           

          Best Regards,
          Vasanth

          2 of 2 people found this helpful
          • 2. Re: SAR ADC Modustoolbox
            JuPa_302041

            Thank you Vasanth,

            I was trying to get AREF enabled but it was asking me for an OPAMP reference I didn't realize the reference can be local.

            and enabling the hardware block was missing

             

            thanks