You switch only 1 pin of port 2 and 4 pins of port1 to high-z analog. This does not reduce power to its minimum.
Thanks Bob for the reply. But all other pins are in High Z Analog by default.
Sleep mode (With all configured modifiers and sleep *TIMER MODULE* is inactivated): ~9mA
Sorry for the typo error.
You have to re-enable global interrupts after you
come out of sleep.
/* Configure PSoC 1 for sleep */
/* Disable interrupts during sleep */
/* Enable Sleep in PSoC 1 */
M8C_EnableGInt; // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SleepTimer_TickWait(50); //Originally I would want the system to delay the program until next wake up rountine.
//But the system halts at this line with current draw of 23mA...
Also are you still powering the RS232 interface chip on the board ?
I also do not see where you have set the mask -
When the Sleep Timer rolls over, an interrupt is posted to
the system. To allow an interrupt from the Sleep Timer to
wake the PSoC, it must be unmasked in the INT_MSK0
register like any other interrupt source.
/* Set Mask for Sleep Timer Interrupts */
M8C_EnableIntMask(INT_MSK0, INT_MSK0_SLEEP) ;
Thanks for the reply. Yes I didn't mask the sleep interrupt and at least the sleep timer interrupt is working fine now. =)
But I have a doubt: The current drawn by the development board does not reduce much when I am using the SleepTimer API (eg: SleepTimer_TickWait, SleepTimer_SyncWait, etc...) The current draw is ~23mA.
So my assumption is: The PSoC wake up according to the sleep timer interrupt at designated frequency and when it does so, the current draw increases....
So does this defeat the purpose of having sleep mode? I mean, the power consumption doesn't really decrease that much if taking sleep timer interrupt into the design as the system will always wake up and check at every time interval.
Please correct me if I made wrong assumption.
PS: Yes, the RS232 chip consume some power as well. Thanks for clearing this up.
The RS232 has a charge pump in it that draws a lot of power, so
you need to lift the Vdd lead off of the PSOC and connect ammeter
between there and Vdd. Sleep should produce, for the 29466, ~
20 - 30 uA.
Thanks for the advices, again. I have connected the the direct power supply to CY8C29466 and i
t draws ~400uA when it is in sleep mode. I think this is much better compared to my very first design which has many flaws.
Sorry it is indeed ~4uA with only PSoC being connected to the device. Great one!!
By the way, I failed to have an accurate sleep timer during sleep mode. For example, I am planning to put the system into sleep mode for 10 seconds. But the system will wake up at approximate 8++ seconds. Anything wrong with the code? The API SleepTimer_TickWait does the job but it won't reduce the power consumption that much.
This is my recent codes:
PRT1DR ^= 0xF0; // Toggle P1,P1,P1 and P1
SleepTimer_TickWait(10); //Delay program for 10 seconds, it works well
PRT1DR &= ~0xF0; // Turn off P1,P1,P1 and P1
SleepPrep(); //User commands to configure sleep mode
M8C_EnableIntMask(INT_MSK0,INT_MSK0_SLEEP); //Enable sleep timer interrupt
for (stimer = 0; stimer < 10; stimer++) //stimer to indicate sleep time interval, but it didn't work well... (Only sleep for 8++ seconds)
WakeUpRestore(); //User commands to wake up PSoC
Hi Dana and Bob,
Just changed the configuration with connection to external clock. And now the system is working brilliantly!!
Really appreciate your help and patience! Cheers!!! =)
I noticed in your code you are doing port GPIO writes. If you
have mixed I/O in a port and are doing read modify writes on
the port (like looking at an input pin then writing back to port)
you must use shadow registers. See this ap note, AN2094
www.cypress.com/ page 7.