The PBP default WDT postscaler is set to 128 in the 18F1220.INC device family header file.
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
The 18F1220 nominal WDT timeout period is ~4mS. If you accept the default postcaler value of 128 this gives you roughly 4mS * 128 = 512mS. That's why you're seeing roughly 1/4 the sleep period when switching from 16F to 18F.
PBP can't change the WDT postscaler on the 18F since this is set in the config word. To make sleep work roughly the same on the 18F, just set the WDT postscaler to 512 which gives you 512 * ~4mS = ~2.048S nominal WDT timeout period.
Set your WDT postscaler to 512.
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
The 16F WDT timeout period is 18mS. PBP sets OPTION_REG for prescaler assignment to WDT with a rate of 128. This gives ~18mS * 128 = 2.304S.
With _WDTPS_512_2H this will get you pretty close to the same sleep time periods with the 18F part. If you need to increase this time period, just increase the postscaler.
Bookmarks