3 Replies Latest reply on Jun 1, 2015 8:12 AM by user_14586677

    Dynamically Switch CSD Bleed Resistor between P1[1] and P1[4]

    danny.van.den.bliek

       Hi,

         

       

         

      I'm using the CY8C21534 and need to switch bleed resistor between P1[1] and P1[4]. I followed the application note CE66058 and came to the routines:

         

      void Connect_Rb_to_P1_4(void)

         

      {

         

      /*Disconnect P1[1] from Global Out buses*/

         

      PRT1GS &= ~0x02;

         

      /*Change the drive mode to High Z Analog*/

         

      PRT1DM0 &= ~0x02;

         

      /*Disable the comparator connection to GOO1*/

         

      CMP_GO_EN &= ~0x40;

         

      /* Change Analog LUT Control Register 0 */

         

      ALT_CR0 &= ~0xc5;

         

      ALT_CR0 |= 0x0c;

         

      /*Enable the comparator connection to GOO4*/

         

      CMP_GO_EN |= 0x08;

         

      /*Change the drive mode of the pin to open drain low*/

         

      PRT1DM0 |= 0x10;

         

      /*Connect P1[4] to Global out bus*/

         

      PRT1GS |= 0x10;

         

      }

         

      void Connect_Rb_to_P1_1(void)

         

      {

         

      /* Disconnect P1[4] from Global Out buses */

         

      PRT1GS &= ~0x10;

         

      /* Change the drive mode to High Z Analog */

         

      PRT1DM0 &= ~0x10;

         

       

         

      /* Disable the comparator connection to GOO4 */

         

      CMP_GO_EN &= ~0x08;

         

      /* Change Analog LUT Control Register 0 */

         

      ALT_CR0 &= ~0x0c;

         

      ALT_CR0 |= 0xc5;

         

      /* Enable the comparator connection to GOO1 */

         

      CMP_GO_EN |= 0x40;

         

      /* Change the drive mode of the pin to open drain low */

         

      PRT1DM0 |= 0x02;

         

      /* Connect P1[1] to Global out bus */

         

      PRT1GS |= 0x02;

         

      }

         

       

         

      But it doesn't seem to work. Can it be that I need to change some other registers also?

         

       

         

      Thanks.