When you say SLEEP 21600, you are specifying the number of seconds, not the number of WDT periods.
On 16F1's PBP simply divides the number you give it by 2 (21600 / 2 = 10800).
Times are approximate and uncalibrated.
On a 12F683, there are two prescalers.
The first one is controlled by WDTCON, with a power-on ratio of 1:512.
The second one is controlled by OPTION_REG, with a power-on ratio of 1:128.
Multiply them together to get the total prescaler ratio (512 * 128 = 65536).
So it's pretty much the same as the 12F1822, with the exception that PBP calculates the number of 2.3 second periods, even though the periods are 2.1 sec.
The reason for the difference is that most of the older PIC's like the 16F877A, have an 18ms WDT period with an OPTION_REG prescaler of 1:128. (0.018 * 128 = 2.304 sec.)
Since the 12F683 is really a standard 14-bit core, it is treated the same as the older chips.
It was not changed because the times are "approximate and uncalibrated.
In fact, if you look at the Electrical Characteristics for the WDT period on a 16F877A, it can be anywhere between 7 - 33 mS.
So the SLEEP command has never been intended to be "Accurate". It only gives an approximate time.
If you need "Accurate" timing while in sleep mode, you should use a 32768hz crystal on Timer1, and count the SLEEP/Wake-Up cycles manually.
Bookmarks