bug: sleep code commented out, WDTE config word disabled — no deep sleep #40

Closed
opened 2026-08-08 03:19:07 +00:00 by time · 1 comment
Contributor

In main.c, the sleep sequence is commented out (//stop_fvr_tmp_adc(), //wdt_clear(), //go_to_sleep()) and replaced with __delay_ms(4000). Additionally, the WDTE config word is commented out (//#pragma config WDTE = ON), meaning the WDT is disabled. The device loops indefinitely without entering deep sleep, which defeats the battery-life design goal. Fix: uncomment the sleep code and WDTE, and ensure the WDT is properly configured to wake the device from sleep.

In main.c, the sleep sequence is commented out (`//stop_fvr_tmp_adc()`, `//wdt_clear()`, `//go_to_sleep()`) and replaced with `__delay_ms(4000)`. Additionally, the WDTE config word is commented out (`//#pragma config WDTE = ON`), meaning the WDT is disabled. The device loops indefinitely without entering deep sleep, which defeats the battery-life design goal. Fix: uncomment the sleep code and WDTE, and ensure the WDT is properly configured to wake the device from sleep.
Author
Contributor

Fixed in PR #41: WDT (256s, WDTE=ON) is now the wakeup source for deep sleep. Added DEBUG_MODE define to toggle between sleep and static delay. Verified the WDT-sleep wake logic against the PIC12LF1840T39A datasheet — WDT timeout during sleep wakes without Reset.

Fixed in PR #41: WDT (256s, WDTE=ON) is now the wakeup source for deep sleep. Added DEBUG_MODE define to toggle between sleep and static delay. Verified the WDT-sleep wake logic against the PIC12LF1840T39A datasheet — WDT timeout during sleep wakes without Reset.
daru closed this issue 2026-08-08 18:56:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
daru/PICsense#40
No description provided.