7 Replies Latest reply on Apr 15, 2014 12:21 PM by user_14586677

    How to measure consumption of individual (sub)systems in PSoC

    user_366036678

       Hello,

         

       

         

      I've been trying to find a way to measure the consumption of each individual components in the PSoC 5LP. The most logical way that I thought about is to enable ONLY that component (and NOTHING ELSE) and measure the consumption.

         

       

         

      And this is where the problem comes in. How exactly do you do that?

         

       

         

      I've done some reading and I stumbled across this in cyfitter_cfg.c :

         

       

         

      /* Enable UDB array */

         

      CY_SET_XTND_REG8( (void CYFAR *)CYREG_PM_ACT_CFG0,

         

                        CY_GET_XTND_REG8((void CYFAR *)CYREG_PM_ACT_CFG0) | 0x40u );

         

       

         

      CY_SET_XTND_REG8( (void CYFAR *)CYREG_PM_AVAIL_CR2,

         

                        CY_GET_XTND_REG8((void CYFAR *)CYREG_PM_AVAIL_CR2) | 0x10u );

         

       

         

      I did some research on what CY_SET_XTND_REG8, CYREG_PM_ACT_CFGx and CYREG_PM_AVAIL_CRx are, and this is what I understood :

         

       

         

      > CY_SET_XTND_REG8 is a method used to write to registers

         

      > CYREG_PM_ACT_CFGx are a set of registers used to enable/disable specific subsystems (UDB, clkdist, analog if, etc.)

         

      > CYREG_PM_AVAIL_CRx are a set of registers used to make specific subsystems available/unavailable (more or less the same subsystems as above)

         

       

         

      So far, I though of using all zeros (0x00) as the second argument in the CY_SET_XTND_REG8 method to disable certain registers that are not used (example, comparators). But is that the way to go?

         

       

         

      And what is the difference between CYREG_PM_ACT_CFGx and CYREG_PM_AVAIL_CRx since it looks like they both do more or less the same thing?

         

       

         

      My references are the TRM, Systems Ref Guide, Register Map and the generated code (cyfitter_cfg.h).