- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is sample project for CY8CKIT-041-40XX.
Each time SW2 is pressed, the following three methods are switched.
BLUE LED : Firmware
GREEN LED : PWM
RED LED : WDT w/interrupt
In this project, I roughly control the functions.
It would be interesting to control whether or not each function works and measure the current consumption.
- Labels:
-
PSoC 345 LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for provide a sample project.
I tried with my CY8CKIT-145-40XX board. Please let me add some comments.
Out of the reset, the WDT interrupt is running behind the firmware. So, the blinking period is quite strange. It is better to disable the WDT at the beginning of the main loop like...
CySysWdtDisable();
isr_WDT_Stop();
for(;;)
{
You mentioned about current consumption. But the firmware main loop is executing CySleep() regardless of the ledState. It is recommend to stop the CPU for PWM and WDT states.
/* Place your application code here. */
if (ledState == FW) {
BLUE_LED_Write(~(BLUE_LED_Read()));
CyDelay(1000);
} else if (ledState == PWM) {
CySysPmSleep();
} else {
CySysPmDeepSleep();
}
I don't think this is a best solution. It is better to write all control logics in the main lop not in the ISR.
Regards,
Noriaki