bug: sleep code commented out, WDTE config word disabled — no deep sleep #40
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wait-to-fix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
daru/PICsense#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.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.