Fujitsu FR81S User Manual

Page of 2342
CHAPTER 19: BASE TIMER 
 
 
5. Operation 
 
FUJITSU SEMICONDUCTOR LIMITED 
CHAPTER
 : BASE TIMER 
FUJITSU SEMICONDUCTOR CONFIDENTIAL 
94 
5.7.5.   Application Notes 
This section explains application notes of the base timer. 
Note the following when using the 16/32-bit PWC timer: 
   Notes on Program Setting 
 
Change the following bits of the base timer x timer control register (BTxTMCR) after stopping the up 
counter by resetting the CTEN bit to "0"(CTEN=0). 
  CKS2 to CKS0 bits 
  EGS2 to EGS0 bits 
  T32 bit 
  FMD2 to FMD0 bits 
  MDSE bit 
  All registers are initialized when the FMD2 to FMD0 bits of the timer control register (BTxTMCR) 
are set to "000" to select reset mode. 
 
  Before the base timer function or T32 bit can be changed, the base timer must be reset once. Except 
when rewriting the status of FMD2 to FMD0 bits or T32 bit of the timer control register (BTxTMCR) 
after a reset, be sure to reset the FMD2 to FMD0 bits to "000" to select the reset mode. Then, rewrite 
the status of these bits. 
 
The timer may operate due to the status of previously measured signals if the followings are set 
simultaneously during system reset or during reset mode. 
  The base timer function is set for the 16/32-bit PWC timer by setting the FMD2 to FMD0 bits of the 
base timer x timer control register (BTxTMCR) to "100"(FMD2 to FMD0=100). 
  Enable 16/32-bit PWC timer operation by setting the CTEN bit of the base timer x timer control 
register (BTxTMCR) to "1"(CTEN=1). 
 
   Notes on Operations 
 
The value loading precedes if the count timing of the up counter and the load timing occur at the same 
time. 
 
If the 16/32-bit PWC timer operation is enabled by setting the CTEN bit of the base timer x timer control 
register (BTxTMCR) to "1"(CTEN=1), the up counter value is cleared. Also, the up counter value is 
made invalid if it has been set before the operation is enabled. 
 
If the 16/32-bit PWC timer is reactivated in the continuous measurement mode and if a measurement 
start edge is detected in the input signal (TIN) simultaneously, the timer immediately starts counting 
from the value "0001
H
". 
 
If two channels of PWC timers are used as a single 32-bit PWC timer, the 16-bit PWC timer setting of 
the even-numbered channel is made valid. The timer setting of odd-numbered channel is ignored. 
 
The input operation of measurement waveforms varies depending on the base timer I/O selection 
function. 
 
   Notes on Interrupts 
 
If an instruction to clear the interrupt request flag and an instruction to change the interrupt request flag 
to "1" occur at the same time, the flag clear instruction is ignored. The interrupt request flag is held to 
"1". 
 
If a detection of measurement end edge and a reactivation of 16/32-bit PWC timer occur simultaneously, 
the following may result. In such case, set the interrupt control correctly by considering the operation of   
the interrupt request flag. 
  Pulse width single measurement mode: The timer reactivates and waits for a measurement start edge. 
Also, the measurement end interrupt request flag (EDIR) is set to "1". 
  Pulse width continuous measurement mode: The timer reactivates and waits for a measurement start 
edge. The measurement end interrupt request flag (EDIR) is set to "1", and the currently measured 
result is transferred to the data buffer register (BTxDTBF). 
MB91520 Series
MN705-00010-1v0-E
727