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).
Is there any reason why you do not trust into the datasheets?
For nearly each module there is a start() function, and some have additional power-saving states which you can send them into with the sleep() APIs.
For the time being, I don't have any components in the Schematic (i.e. the Schematic is blank).
I just compiled that to have the source codes.
Yes, I do know that each components have a <comp_name>_[Start|Stop]() function. I will take that into account when the Schematic is populated in the future.
But just for the time being, I was thinking of how to turn off everything else. For example, if I had only one DelSig ADC in the Schematic, I would like to turn off the CPU, UDB, Flash, etc. and leave only the DelSig ADC running with the necessary resources (clocks, etc.).
They did mention that the CPU can be stopped. Is that using the low-power modes?
Thanks, I'll try and see if I could get any more results. I'll keep this thread updated when I get one.
I've fixed my problems for this one. It turns out that there are APIs for turning off components like clocks, etc.
But I have one weird remark.
When I try to turn off certain components that is not used in the design (for example, the analog routing pump) using its API, the global consumption increases. And when I comment or delete this line of code in the main, the consumption falls back down.
Any ideas why that is so?
You might consider posting a CASE on this and when you get answer
posting back on forum for everyone -
To create a technical case at Cypress -
“Create a Case”
You have to be registered on Cypress web site first.