PSoC 4200M Low Power with WDTs | Cypress Semiconductor
PSoC 4200M Low Power with WDTs
[re-printed from iotexpert.com]
The last few weeks of my technical life have been frustrating. Nothing and I mean nothing has been easy. A few weeks ago I replied to a comment about cascading the watch dog timers in the PSoC 4200M to extend the sleep time – the article was called “PSoC 4200M WDT Long Deep Sleep“. I wanted to measure power to see what exactly was happening. But the great technical gods were conspiring against me and I had tons of problems. Well I have things sorted out. In this article I will build a project using the PSoC 4200M Watch Dog Timers and show the power measurements on the CY8CKIT-043 and CY8CKIT-044. I will include PSoC 4200M low power measurements at 5V and 3.3V as well as with both the ILO and the WCO as the source of the WDT. To do this I:
- Created a PSoC 4200M low power project
- Modified the CY8CKIT-043M
- Reject the Fluke 175
- Read the Keysite 34465A Multimeter Manual
- PSoC 4200M Low Power Current Measurement
PSoC 4 Low Power Firmware
First I create a schematic. This includes 4 digital output pins. The GREEN, RED and BLUE are attached to the tri-color LED. A UART to print the status of the startup. And an interrupt connected to the WDT Interrupt.
The next thing to do is to make sure that the WDT is being driven by the ILO. I also turn off the three WDTs because I will configure them in the firmware.
In order to get low power you need to switch the debugging pins off i.e. make them GPIOs. You can do this on the DWR System Screen.
Finally write some firmware. The firmware simply
- Blinks the LED 10 times
- Prints “Started” to the UART, waits until the buffer is flushed, then turns off the UART to make sure the power is low.
- Configure the Watch Dog Timers. This could have been done on the Low Frequency Clock Screen (except for the cascading of timers which had to be done with firmware)
- Turn off the Pin, Deep Sleep the chip… and wait. When an interrupt from the WDT occurs, it calls the ISR (next section)
int main(void)
{
trigger_Write(1); // Measure Startup
// Blink the LED when the PSoC Starts
for(int i=0;i<10;i++)
{
BLUE_Write(~BLUE_Read());
CyDelay(200);
}
BLUE_Write(0);
UART_Start();
UART_UartPutString("Started\n");
isr_1_StartEx(wdtInterruptHandler);
while(UART_SpiUartGetTxBufferSize()); // Wait until the UART has flushed - then turn off the power
UART_Stop();
CySysWdtUnlock(); // Enable modification of the WDT Timers
// Turn off the WDTs (all three of them)
CySysWdtDisable(CY_SYS_WDT_COUNTER0_MASK);
CySysWdtDisable(CY_SYS_WDT_COUNTER1_MASK);
CySysWdtDisable(CY_SYS_WDT_COUNTER2_MASK);
// Make Timer 0 & 1 run with no interrupt, and 2 cause an interrupt
CySysWdtSetMode(CY_SYS_WDT_COUNTER0,CY_SYS_WDT_MODE_NONE);
CySysWdtSetMode(CY_SYS_WDT_COUNTER1,CY_SYS_WDT_MODE_NONE);
CySysWdtSetMode(CY_SYS_WDT_COUNTER2,CY_SYS_WDT_MODE_INT);
// Set the time to 32768/(64*64*2^6) = 32768/(2^18) = 0.125 = 1/8 Hz
CySysWdtSetMatch(CY_SYS_WDT_COUNTER0, 64);
CySysWdtSetMatch(CY_SYS_WDT_COUNTER1, 64);
CySysWdtSetToggleBit(6);
CySysWdtSetClearOnMatch(CY_SYS_WDT_COUNTER0,1); // When counter his period reset counter
CySysWdtSetClearOnMatch(CY_SYS_WDT_COUNTER1,1);
CySysWdtSetCascade(CY_SYS_WDT_CASCADE_01 | CY_SYS_WDT_CASCADE_12); // Cascade 0-1-2
CySysWdtEnable(CY_SYS_WDT_COUNTER0_MASK | CY_SYS_WDT_COUNTER1_MASK | CY_SYS_WDT_COUNTER2_MASK );
trigger_Write(0); // End measurement
CyGlobalIntEnable; /* Enable global interrupts. */
for(;;)
{
trigger_Write(0); // setup trigger
CySysPmDeepSleep(); // wait for interrupt in deep sleep
}
}
The ISR first turns on the trigger pin (which I will use in the next article to trigger the oscilloscope). Then it determines which timer caused the interrupt. Originally I was blinking different color LEDs when I was trying to figure out what was happening. With the current configuration WDT0 and WDT1 will never trigger an interrupt. Finally it clears the interrupt and returns. When it returns the main loop will turn off the trigger pin and then deep sleep.
void wdtInterruptHandler()
{
trigger_Write(1); // Chip is woken up
uint32 reason = CySysWdtGetInterruptSource();
if(reason & CY_SYS_WDT_COUNTER0_INT)
RED_Write(~RED_Read());
if(reason & CY_SYS_WDT_COUNTER1_INT)
GREEN_Write(~GREEN_Read());
if(reason & CY_SYS_WDT_COUNTER2_INT)
BLUE_Write(~BLUE_Read());
CySysWdtClearInterrupt(reason); // Clear the WDT Interrupt
}
Modified the CY8CKIT-043
In order to measure current with the. CY8CKIT-043 you need to remove the 0 ohm resistor R22 and install a jumper (J4) so that you can measure the current into the board.
R22 is on the back of the development kit. You can see that I circled it.
Then install a jumper into J4. I just use a two pin break away header.
Fluke 175
According to the AN 86233 PSoC® 4 and PSoC Analog Coprocessor Low-Power Modes and Power Reduction Techniques I should be able to get 1.3uA in deep sleep 1.3mA in active.
I started with my trusty Fluke 175… but quickly realized that uA are not in the cards. It appears that the lowest it can measure is 10’s of microamps.
It does fine with the active mode.
Keysight 34465A 6 1/2 Digit Multimeter
The good news is that I also have a Keysight 34465A 6/12 digit multimeter. In the 1uA range it can measure +- 0.055% of 1uA or about 5nA (is that right?)
It also doesnt change the input power supply very much. In fact only 0.0011v in 3.3v is negligible.
PSoC 4200M Low Power Current Measurement
I wanted to measure Active, Sleep, Deep Sleep on the CY8CKIT-043 and CY8CKIT-44 with the WCO on and off. In the two pictures below you can see that the system is taking between 3.6uA and 4.2uA in Deep Sleep.
Here are tables with all of the measurements.
Mode | WCO On | WCO Off |
---|---|---|
Active | 12.860mA | 12.859mA |
Sleep | 5.339mA | 5.335mA |
Deep Sleep | 4.206uA | 1.078uA |
Mode | WCO On | WCO Off |
---|---|---|
Active | 12.84mA | 12.84mA |
Sleep | 5.328mA | 5.327mA |
Deep Sleep | 4.096uA | 0.940uA |
Mode | WCO Off |
---|---|
Active | 12.711mA |
Sleep | 5.352mA |
Deep Sleep | 3.632uA |
The other thing that is pretty cool with the KeySite is that you can put it into “Trend” mode and it can display the current readings over a long period. In the picture below I am flashing the LED which takes around 3.5mA @ 3.3v on this development kit.
ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.
Comments
Articles that have huge and shrewd comments are more pleasing, at any rate to me. It's fascinating to examine what different people thought and how it relates to them or their clients, as their point of view could help you later on. It was crystal clear, continue sharing. For more info you can use this best essay writing service to having a wonderful assistant in writing and even you can get the guidelines too.
Mark,
For nA and uA current readings with a Fluke or other standard multimeter, I found the uCurrent Gold. I use it for verifying power consumption for BLE and CapSense project that need to run off of a battery. Here is the link.
http://www.eevblog.com/product/ucurrentgold/
It's $90 and I tested it with the current DACs in the PSoC5LP. It was spot on. I have been using mine for 4 years now.
I needed to gauge energy to perceive what precisely was going on. Essay Writing Help Yet, the colossal specialized divine beings were scheming against me and I had huge amounts of issues.
Articles that have huge Cara mengobati mata minus dan silinder secara alami and shrewd comments are more pleasing, at any rate to me. It's fascinating to examine what different people thought and how it relates to them or their clients, as their point of view could help you later on.
I was attempting to make sense of what was going on. With the present setup WDT0 and WDT1 will never trigger an interfere. At long last it clears the hinder and returns. When it restores College Assignments the principle circle will kill the trigger stick and afterward profound rest.
Here are the latest version of the most popular android game freedom apk 2018 only for you. Download & install this amazing game in your mobile. Here we offer you exclusive freedom app for android 2018 version.
Thank you for your calculations, although they coincide completely with mine, but this has given me confidence in my abilities. You have an excellent and very useful blog 192.168.1.1
A disadvantage of those networks is that the data charges are a great deal decrease than those of traditional radio networks. information costs in LPWANs are measured in bits according to 2d, instead of megabytes in line with 2nd. additionally, many of these Do My Homework For Me Online networks operate within the unlicensed spectrum (ISM band), which requires gadgets to stick to responsibility cycle barriers, handiest permitting to send a fragment of the time even as tormented by interference. those traits make it difficult to aid firmware updates over the air.
Provides multiple learning environment of International standard with holistic system of education at an affordable cost for the successful life of young generation.
Agriculture college in uttarakhand
Bachelor of Physiotherapy in Dehradun
M.Sc. Horticulture College in Dehradun
Agriculture College north india
It seems like you have had quite an achievement in the past few weeks. It is true that one will get more advanced in the technical field once they start following this website and take part in the discussions.
paris tour guide
Wow what a great post i really love this
Jobs in Narela
Jobs in Bawana
All Springsteen on Broadway Shows. Buy Now at http://www.greendalecinema.com/fonts/icomoon/Springsteen-on-Broadway-NYC...
The Andhra Pradesh and Telangana Inter Results will be going to be released very shortly and all the aspirants need to visit the site results.cgg.gov.in to check the marks.
results.cgg.gov.in
Hi there! Nice stuff, do keep me posted when you post again something like this!
acim
nice bLog! its interesting. thank you for sharing....
Invest HZ
I read that Post and got it fine and informative. Please share more like that...
Primeworld
Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!
cat logo