fix: shut down peripherals before sleep, add config words #16

Merged
daru merged 1 commit from fix/sleep-peripherals into main 2026-07-27 00:10:15 +00:00
Contributor

Fixes #15

Changes:

  • Add explicit config words: BOREN=NSLEEP, MCLRE=OFF, FCMEN=OFF, IESO=OFF
  • Disable comparator before sleep (was never shut down)
  • Add defensive stop_fvr_tmp_adc() before sleep

Power-down budget (3.0V typical):

  • Base IPD: 30nA
  • WDT: 500nA
  • Total: ~530nA (matches product brief spec)

BOREN=NSLEEP saves 300nA during sleep while keeping BOR active during awake operation.

Fixes #15 **Changes:** - Add explicit config words: BOREN=NSLEEP, MCLRE=OFF, FCMEN=OFF, IESO=OFF - Disable comparator before sleep (was never shut down) - Add defensive stop_fvr_tmp_adc() before sleep **Power-down budget (3.0V typical):** - Base IPD: 30nA - WDT: 500nA - Total: ~530nA (matches product brief spec) BOREN=NSLEEP saves 300nA during sleep while keeping BOR active during awake operation.
Add explicit config words: BOREN=NSLEEP (saves 300nA in sleep), MCLRE=OFF
(frees RA3), FCMEN=OFF, IESO=OFF. Disable comparator before sleep (Issue #15)
as it was never shut down. Also add stop_fvr_tmp_adc() before sleep as a
defensive measure to ensure FVR/ADC are off.

Power-down budget at 3.0V typical:
- Base IPD: 30nA
- WDT: 500nA
- Total: ~530nA (matches product brief RF Sleep spec)
daru merged commit d91cb14ebc into main 2026-07-27 00:10:15 +00:00
Sign in to join this conversation.
No reviewers
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!16
No description provided.