LAPIS Semiconductor ML62Q1000 Series User Manual page 316

Table of Contents

Advertisement

8.3.2.3
Setting Example
Figure 8-8 shows a setting example when using the 8-bit timer mode.
In the case change the setting
FEUL62Q1000
Start
High-speed clock
Need when using the high-speed clock (HSCLK) for the timer clock
setting
Timer stop
Confirm the corresponding bit of TMHSTAT register is "0"
confirmation
Timer output port
Choose TMHnOUT as the shared function and specify enabling the
setting
output by the PnMODxx register.
Specify the timer mode, timer operation mode, timer clock, count clock
and the timer output logic in the THnMOD register.
Timer mode setting
THn8BM=1; // 8-bit timer mode
Timer data register
Set a comparison value into TMHnD register that is to be compared with
setting
TMHnC register
THnHIC=1;
Clear timer interrupt
THnLIC=1;
Clear the interrupt by writing TMHnIC register to "1".
QTMn=0;
Enable interrupt
ETMn=1;
Clear timer counter
TMHnC=0x0000; Write a data into the TMHnC register
Set corresponding bits of TMHSTR register to "1".
Upper side 8-bit timer THnHRUN=1;
Start timer
Upper side 8-bit timer THnRUN=1;
Repeat mode or
One shot mode
operation
Set corresponding bits of TMHSTP register to "1".
Stop timer
Higher byte side 8-bit timer THnHSTP=1;
Lower byte side 8-bit timer THnSTP=1;
End
Figure 8-8 Setting Example of 8-Bit Timer Mode
ML62Q1000 Series User's Manual
Reset corresponding bits of IRQ45 register and IRQ67 register to "0".
Set corresponding bits of IE45 register and IE67 register to "1".
Chapter 8 16-Bit Timer
8-25

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents