1 Reply Latest reply on Sep 24, 2016 2:15 AM by user_388353959

    How to switch polarity of IDAC on PSOC 4

    j.colmen_1542866

      Hello,

         

      We are using a PSOC 4 CY8C42478ZI-MF485 and we need to switch the polarity of an IDAC using c-code but we can't find the command to do it. Is it possible to do this using software?

         

      Thanks.

        • 1. Re: How to switch polarity of IDAC on PSOC 4
          user_388353959

          You can write your own functions for that.

             
          //palarity 0(Source), 1(Sink) //IDAC -> component name in this example void idac_Set_Polarity(uint8 polarity){      uint8 enableInterrupts;      /* Set initial configuration */     enableInterrupts = CyEnterCriticalSection();      /* clear previous values */     IDAC_IDAC_POLARITY_CONTROL_REG &=             (~(uint32)((uint32)IDAC_IDAC_POLARITY_MASK <<             IDAC_IDAC_POLARITY_POSITION));      /* set new configuration */     IDAC_IDAC_POLARITY_CONTROL_REG |=        ((uint32)polarity << IDAC_IDAC_POLARITY_POSITION);      CyExitCriticalSection(enableInterrupts); } 
             

           

             

          Reiner