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

    How to switch polarity of IDAC on PSOC 4



      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?



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

          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); } 




          1 of 1 people found this helpful