![Nova Electronics MCX514 Скачать руководство пользователя страница 105](http://html1.mh-extra.com/html/nova-electronics/mcx514/mcx514_user-manual_1710400105.webp)
NOVA electronics Inc.
MCX514 -
92
-
92
-
2.9.2 Timer Setting
To operate a timer, the timer value and operation mode (once / repeat) must be set.
■
Timer value setting
A timer value can be set by timer value setting command (16h). Set values to WR6, 7 registers and write timer value setting
command (16h) into WR0 register, and then it will be set. It can be set with the range of 1 ~ 2,
147,483,647μsec in increments of
1μsec (See chapter 7.2.23).
The timer value can be changed while operating a timer.
■
Timer operation mode setting
Set the operation mode of a timer to D14 bit (TMMD) of WR3 register.
When 0 is set to D14 bit (TMMD), the timer operates once and when 1 is set, the timer operates repeatedly.
2.9.3 Timer-Start / Timer-Stop
■
Timer-start
A timer is started by timer-start command (73h) or the activation of the synchronous action that timer-start is set as the action.
■
Timer-stop
In the operation mode is once, a timer stops when the count reaches the value specified by the timer value (the time is up). While
operating a timer, it can be stopped by timer-stop command (74h) or a synchronous action.
When the operation mode is repeat, it can be stopped by timer-stop command (74h) or a synchronous action.
2.9.4 Timer and Synchronous Action
Timer operation can be used in a synchronous action.
As the activation factor of a synchronous action, “Timer is up” can be specified. As the action of a synchronous action, there are 3
kinds, “CT
→
MRm (saving the current timer value intoMRm register)”, “Timer-start” and “Timer-stop” can be specified. For
more details of these functions, see chapter 2.6.
2.9.5 Timer Operating State and Current Timer Value Reading
■
Current timer value reading
The current timer value in operation can be read out by current timer value reading command (38h).
A timer counter starts to count up from 0, and the value of a timer counter can be read out anytime during operation.
A timer counter clears to 0 when a timer stops. After a timer is finished or issuing timer-stop command, if the user reads the
current timer value, 0 will be read out.
■
Timer operating check
Timer operating state can be checked by D10 bit (TIMER) of RR3 register Page1. When a timer starts, D10 bit (TIMER) becomes
1 and that indicates the timer is in operation.
2.9.6 Interrupt by Timer
The user can generate an interrupt signal when a timer is up. Set D9 bit (TIMER) of WR1 register to 1.
For more details of the interrupt function, see chapter 2.10.