Recently, a pic ultra-low power project has been done with very high power requirements. I have seen some articles on the internet before, but it is not good to test them.
Here to summarize, to share a bit for the peer, software programming to pay attention to the following points,
1, no module to close
The module here is not only the enable bit, but PMD
2, do not use the IO port to be placed into the output
Here and other articles on the internet say the input is not the same, measured down my side is the output standby current lower
3, internal regulator must be closed
Here must pay attention: must choose through "controlled by REGSLP bit", otherwise the single-chip computer sleep after dead, can no longer burn write, this can not let people understand, but the actual test is true
Specific practices:
(1)
(2) WDTCONBITS.REGSLP = 1;
Finally, I'm going to share the operation between sleep, for reference only:
PMD0 = 0XFF;
PMD1 = 0XFF;
PMD2 = 0XFF;
Trisa = 0;//xff;
TRISB = 0;//xff;
Trisc = 0;//xff;
PORTA = 0;
PORTB = 0x28;
PORTC = 0;
Power_rf_pin = 1;
Ad_press_ctrl_pin = 1;
Led_red_pin = 1;
Led_blue_pin = 1;
Wdtconbits.swdten = 1;
Idlen = 0;
WDTCONBITS.REGSLP = 1;
About the key points of Pic MCU 18 series Ultra low Power software programming