EasyManua.ls Logo

ARTERY AT32F421C8T7 - Debug Mode; TMR3 Registers; Figure 14-37 Starting Master and Slave Timers Synchronously by an External Trigger; Table 14-5 TMR3 Register Map and Reset Value

Default Icon
337 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AT32F421 Series Reference Manual
2022.11.11 Page 192 Rev 2.02
Starting master and slave timers synchronously by an external trigger:
In this example, configure the master timer as master/slave mode synchronously and enable its slave
timer synchronization function. This mode is used for synchronization between master timer and slave
timer.
Set the STS bit of the master timer.
Configure master timer output signal TRGOUT as an overflow event (PTOS[2: 0]=3’b010). The
master timer outputs a pulse signal at each counter overflow event, which is used as the
counting clock of the slave timer.
Configure the slave timer mode of the master timer as trigger mode, and select C1IN as trigger
source
Configure slave timer trigger input signal TRGIN as master timer output
Configure slave timer as trigger mode (SMSEL=3’b110 in the TMR2_STCTRL register)
Figure 14-37 Starting master and slave timers synchronously by an external trigger
COUNTER
PR[15:0]
TMREN
TMR_CLK
0
DIV[15:0]
32
22
PR[15:0]
TRGIN
1
...
21
22
0 1 2 3
...
21
COUNTER
0 1 2 3
22
0
0
DIV[15:0]
TMR_CLK
Master
TMR
Slave
TMR
1
...
31
32
0 1 2 3
...
31
0 1 2 3
32
0
TMR_EN
14.2.3.6 Debug mode
When the microcontroller enters debug mode (Cortex
TM
-M4 core halted), the TMR3 counter stops
counting by setting the TMR3_PAUSE bit in the DEBUG module.
14.2.4 TMR3 registers
These peripheral registers must be accessed by word (32 bits).
TMR3 registers are mapped into a 16-bit addressable space.
Table 14-5 TMR3 register map and reset value
Register
Offset
Reset value
TMR3_CTRL1
0x00
0x0000
TMR3_CTRL2
0x04
0x0000
TMR3_STCTRL
0x08
0x0000
TMR3_IDEN
0x0C
0x0000
TMR3_ISTS
0x10
0x0000
TMR3_SWEVT
0x14
0x0000
TMR3_CM1
0x18
0x0000
TMR3_CM2
0x1C
0x0000
TMR3_CCTRL
0x20
0x0000
TMR3_CVAL
0x24
0x0000 0000
TMR3_DIV
0x28
0x0000

Table of Contents