Zet, It's not available on all processors and perhaps the most important thing to note is that the CONTROL setting makes the watchdog available whether the hardware fuse is set or not. The SWDTEN calls are the actual switch-on and switch-off of the WDT when software control is enabled.
As an example, it' s useful for waking processors from deep sleep,
although the implementation will vary from processor to processor. The
attached file is one I use for a project which had an 18F master with a
couple of 12F1840 slaves. The timer is set to give a (roughly) one second
sleep between watchdog interrupts. Note the different pragma for the
watchdog timer pre-scaler for the two different chip types.
-John-
On Sunday, 1 December 2019 16:04:55 UTC+9, RobJ wrote:
>
> Hi Zet,
>
> I am not sure but I think it could be the following. The pragma normally
> controls the 'fuses' of the PIC so they are not changeable anymore since
> the fuses are programmed when you program the PIC. In your case of the WDT
> you could 'fuse' the WDT during programming but apparently there is still a
> way to change the operation in software.
>
> But maybe somebody has a better explanation. This is the one I could think
> off.
>
> Kind regards,
>
> Rob
>
>
> On Sunday, December 1, 2019 at 7:57:59 AM UTC+1, Zet Weeh wrote:
>>
>> LS
>>
>> I can't find the difference between:
>>
>> 'WDTCON_SWDTEN = off' and 'pragma target WDT control'.
>>
>> I searched on Internet but I could not find the answer.
>> I hope someone will explain.
>>
>> Kind regards
>> Peter
>>
>
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/db761ca3-33a2-4e79-85f9-dafc820b0921%40googlegroups.com.
watchdog_sleep.jal
Description: Binary data
