
185
CHAPTER 6 8/16-BIT UP/DOWN COUNTER/TIMER
6.6
Writing data to the up/down count register (UDCR)
Data cannot be written to the up/down count register (UDCR) directly from the data
bus. This section describes the procedure for writing, counter clearing, and flags of
the device.
■
Writing data to the up/down count register (UDCR)
To write data to the UDCR, follow the procedure below:
1. Write the data that is to be written to the UDCR first to the RCR (Note that this means that
the original data in the RCR will be lost).
2. By setting the CTUT of the CCR to 1, data is transferred from the RCR to the UDCR.
Perform the above operation while counting is stopped (when the CSTR bit of the CSR is 0).
Besides the above procedure, the following procedure can also be applied to clear the counter.
•
Clearing by reset input (initialization).
•
Clearing by edge input through the ZIN pin.
•
Clearing by writing 0 to UDCC of the CCR.
•
Clearing by compare.
The above can be performed regardless of the status of the counter (regardless of whether
counting is performed or stopped).
■
Count clear/gate function
The ZIN pin can be used after selecting the count clear function or gate function based on the
CGSC bit of the CCR register.
When the count clear function is started, the ZIN pin clears the counter. The CGE1 and CGE0
bits of the CCRL register can control which edge input of the ZIN pin to use for clearing the
counter.
When the gate function is started, the ZIN pin enables or disables counting. The CGE1 and
CGE0 bits of the CCR register can control which level input of the ZIN pin enables counting.
This function is effective for all modes.
Table 6.6-1 "Selecting the ZIN pin function" summarizes how the ZIN pin functions are selected.
Table 6.6-1 Selecting the ZIN pin function
CGSC
ZIN pin function
CGE1, CGE0
When counter clear
function is used
When gate function is
used
0
Counter clear function
00
B
Disables detection.
Disables detection.
1
Gate function
01
B
Rising edge
LOW level
10
B
Falling edge
HIGH level
Содержание MB91150 Series
Страница 1: ......
Страница 2: ......
Страница 3: ...FUJITSU LIMITED FR30 32 BIT MICROCONTROLLER MB91150 Series HARDWARE MANUAL ...
Страница 4: ......
Страница 10: ...vi ...
Страница 112: ...96 CHAPTER 3 MEMORY SPACE CPU AND CONTROL UNIT ...
Страница 174: ...158 CHAPTER 5 I O PORTS Note DDRI bit 6 is a test bit Always set the bit to 0 The value read from this bit is always 0 ...
Страница 178: ...162 CHAPTER 5 I O PORTS ...
Страница 214: ...198 CHAPTER 7 16 BIT RELOAD TIMER ...
Страница 240: ...224 CHAPTER 8 PPG TIMER ...
Страница 310: ...294 CHAPTER 13 8 10 BIT A D CONVERTER ...
Страница 318: ...302 CHAPTER 14 8 BIT D A CONVERTER ...
Страница 362: ...346 CHAPTER 15 UART ...
Страница 420: ...404 CHAPTER 19 PERIPHERAL STOP CONTROL ...
Страница 428: ...412 CHAPTER 20 CALENDAR MACROS ...
Страница 503: ...487 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 510: ...494 INDEX ...
Страница 512: ......