The COP counter is reset by writing 0x55 and 0xAA (in that order) to the address of the
SIM's Service COP (SRVCOP) register during the selected timeout period. Writes do not
affect the data in the SRVCOP register. As soon as the write sequence is complete, the
COP timeout period is restarted. If the program fails to perform this restart during the
timeout period, the microcontroller resets. Also, if any value other than 0x55 or 0xAA is
written to the SRVCOP register, the microcontroller immediately resets.
SIM_COPCTRL[COPCLKS] selects the clock source used for the COP timer. The clock
source options are either the bus clock or an internal 1 kHz clock source. With each clock
source, there are three associated timeouts controlled by SIM_COPCTRL[COPT]. The
following table summarizes the control functions of SIM_COPCTRL[COPCLKS] and
SIM_COPCTRL[COPT] fields. The COP watchdog defaults to operation from the 1 kHz
clock source and the longest timeout for that clock source (2
10
cycles).
Table 3-18. COP configuration options
Control bits
Clock
source
COP window opens
(SIM_COPCTRL[COPW]=1)
COP overflow count
SIM_COPCTRL[COPCLKS] SIM_COPCTRL[COPT
]
N/A
00
N/A
N/A
COP is disabled.
0
01
1 kHz
N/A
2
5
cycles (32 ms)
0
10
1 kHz
N/A
2
8
cycles (256 ms)
0
11
1 kHz
N/A
2
10
cycles (1024 ms)
1
01
Bus
6,144 cycles
2
13
cycles
1
10
Bus
49,152 cycles
2
16
cycles
1
11
Bus
196,608 cycles
2
18
cycles
After the bus clock source is selected, windowed COP operation is available by setting
SIM_COPCTRL[COPW]. In this mode, writes to the SIM_SRVCOP register to clear the
COP timer must occur in the last 25% of the selected timeout period. A premature write
immediately resets the chip. When the 1 kHz clock source is selected, windowed COP
operation is not available.
The COP counter is initialized by the first writes to the SIM_COPCTRL register and after
any system reset. Subsequent writes to the SIM_COPCTRL register have no effect on
COP operation. Even if an application uses the reset default settings of
SIM_COPCTRL[COPT], SIM_COPCTRL[COPCLKS], and SIM_COPCTRL[COPW]
fields, the user should write to the write-once SIM_COPCTRL register during reset
initialization to lock in the settings. This approach prevents accidental changes if the
application program becomes lost.
The write to the SIM_SRVCOP register that services (clears) the COP counter should not
be placed in an interrupt service routine (ISR) because the ISR could continue to be
executed periodically even if the main application program fails.
Chapter 3 Chip Configuration
KL02 Sub-Family Reference Manual, Rev. 2.1, July 2013
Freescale Semiconductor, Inc.
53
Содержание KKL02Z32CAF4R
Страница 2: ...KL02 Sub Family Reference Manual Rev 2 1 July 2013 2 Freescale Semiconductor Inc...
Страница 24: ...KL02 Sub Family Reference Manual Rev 2 1 July 2013 24 Freescale Semiconductor Inc...
Страница 36: ...Orderable part numbers KL02 Sub Family Reference Manual Rev 2 1 July 2013 36 Freescale Semiconductor Inc...
Страница 76: ...Human machine interfaces HMI KL02 Sub Family Reference Manual Rev 2 1 July 2013 76 Freescale Semiconductor Inc...
Страница 94: ...Module clocks KL02 Sub Family Reference Manual Rev 2 1 July 2013 94 Freescale Semiconductor Inc...
Страница 142: ...Functional description KL02 Sub Family Reference Manual Rev 2 1 July 2013 142 Freescale Semiconductor Inc...
Страница 188: ...Memory map and register descriptions KL02 Sub Family Reference Manual Rev 2 1 July 2013 188 Freescale Semiconductor Inc...
Страница 214: ...Application information KL02 Sub Family Reference Manual Rev 2 1 July 2013 214 Freescale Semiconductor Inc...
Страница 222: ...Memory map register descriptions KL02 Sub Family Reference Manual Rev 2 1 July 2013 222 Freescale Semiconductor Inc...
Страница 256: ...Memory map and register definition KL02 Sub Family Reference Manual Rev 2 1 July 2013 256 Freescale Semiconductor Inc...
Страница 300: ...Functional description KL02 Sub Family Reference Manual Rev 2 1 July 2013 300 Freescale Semiconductor Inc...
Страница 532: ...Functional description KL02 Sub Family Reference Manual Rev 2 1 July 2013 532 Freescale Semiconductor Inc...
Страница 534: ...KL02 Sub Family Reference Manual Rev 2 1 July 2013 534 Freescale Semiconductor Inc...