
453
CHAPTER 16 PWC Timer
16.6.3
Timer Mode Operation
The timer mode includes the one-shot operation mode and reload operation mode.
■
One-shot Operation Mode
When the timer is started in this mode, a count is incremented at each count clock. The timer automatically
stops when an overflow occurs from FFFF
H
to 0000
H
.
If PWC0/PWC1 is set before the timer has started, the count is started from this set value. After overflow,
the set value is deleted and the current count value remains in PWC0/PWC1.
PWCSH0/PWCSH1:POUT is reversed if an overflow occurs.
■
Reload Operation Mode
When the timer is started in this mode, the reload value in PWC0/PWC1 is set in the timer and the count is
incremented at each count clock. If an overflow occurs when the timer counts FFFF
H
to 0000
H
, the reload
value in PWC0/PWC1 is set in the timer again, the PWCSH0/PWCSH1:POUT bit is reversed, and the
count operation is repeated. The timer does not stop until a value is written to the PWCSH0/
PWCSH1:STOP to stop the timer or it is reset. The port bit will output to pin PWO0/PWO1 if pulse output
mode is specified.
The reload value (set in PWC0/PWC1 before the timer is started) is stored during a count. When the timer
is started or restarted and an overflow occurs, the reload value is always set in the timer. If the value that is
set during a count is to be changed, a new reload value becomes valid when the next overflow occurs or the
timer is restarted.
■
Timer Value and Reload Value
In one-shot operation mode, direct access to PWC0/PWC1 accesses the up-count timer. When a value is
written to PWC0/PWC1, the value is written directly to the timer. When PWC0/PWC1 is read during a
count operation, the current timer value is read. If the value is set in PWC0/PWC1 before the timer is
started, the timer starts a count from the specified value.
In reload operation mode, the up-count timer cannot be accessed and PWC0/PWC1 functions as a reload
register (stores the reload value). When the timer is started or restarted and an overflow occurs, the value
written to PWC0/PWC1 is always set in the timer. When PWC0/PWC1 is read, the stored reload value is
read.
The PWC0/PWC1 value and timer value are undefined if the timer is set in one-shot mode after the
operation is discontinued in reload mode. Therefore, always set the values before the timer is used.
The PWC0/PWC1 value is undefined if the timer is set in reload mode after the operation is forcibly
discontinued in one-shot mode. Therefore, always set the value before the timer is used.
■
Interrupt Request Generation
During operation in timer mode, an overflow enables the generation of an interrupt request. If the
increment of a timer count causes an overflow, the overflow flag is set, an overflow interrupt request is
enabled, and an interrupt request is generated.
Summary of Contents for MB90460 Series
Page 1: ...The following document contains information on Cypress products ...
Page 3: ......
Page 5: ......
Page 9: ...iv ...
Page 41: ...22 CHAPTER 1 OVERVIEW ...
Page 45: ...26 CHAPTER 2 NOTES ON HANDLING DEVICES ...
Page 83: ...64 CHAPTER 3 CPU ...
Page 95: ...76 CHAPTER 4 RESET ...
Page 107: ...88 CHAPTER 5 CLOCK ...
Page 131: ...112 CHAPTER 6 LOW POWER CONSUMPTION MODE ...
Page 175: ...156 CHAPTER 7 INTERRUPT ...
Page 181: ...162 CHAPTER 8 MODE SETTING ...
Page 223: ...204 CHAPTER 9 I O PORT ...
Page 237: ...218 CHAPTER 10 TIME BASE TIMER ...
Page 247: ...228 CHAPTER 11 WATCHDOG TIMER ...
Page 275: ...256 CHAPTER 12 16 BIT RELOAD TIMER ...
Page 373: ...354 CHAPTER 14 MULTI FUNCTIONAL TIMER ...
Page 485: ...466 CHAPTER 16 PWC Timer ...
Page 531: ...512 CHAPTER 17 UART ...
Page 559: ...540 CHAPTER 19 DELAYED INTERRUPT GENERATOR MODULE ...
Page 589: ...570 CHAPTER 20 8 10 BIT A D CONVERTER ...
Page 601: ...582 CHAPTER 21 ROM CORRECTION FUNCTION ...
Page 633: ...614 CHAPTER 23 512K 1024K BIT FLASH MEMORY ...
Page 645: ...626 CHAPTER 24 EXAMPLE OF F2 MC 16LX MB90F462 F462A F463A CONNECTION FOR SERIAL WRITING ...
Page 715: ...696 APPENDIX ...
Page 716: ...697 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 739: ......