4 Replies Latest reply on Jul 31, 2018 8:13 AM by tecnico_1936286

    ADC SAR Seq change to External VRef dynamically

    tecnico_1936286

      I’m using Bit 6:4 of CYREG_SAR_CTRL register to change the Vref values dynamically and I can change between different internal VRefs:

      CY_SET_REG32(CYREG_SAR_CTRL, (CY_GET_REG32(CYREG_SAR_CTRL) & 0xFFFFFF0F) | 0x000000C0); //1.024 reference with Vref Bypass cap

      CY_SET_REG32(CYREG_SAR_CTRL, (CY_GET_REG32(CYREG_SAR_CTRL) & 0xFFFFFF0F) | 0x000000E0); //VDDA/2 reference with Vref Bypass cap

      CY_SET_REG32(CYREG_SAR_CTRL, (CY_GET_REG32(CYREG_SAR_CTRL) & 0xFFFFFF0F) | 0x000000F0); // VDDA reference with Vref Bypass cap

       

      Now I need to set registers to change from Internal Vref to External Vref. How can I do this ?