CMS32L051 User Manual |Chapter 5 Universal Timer Unit (Timer4)
www.mcu.com.cn 153 / 703
5.6.2 Output setting of the TOmn pin
The steps and state changes from the initial setting of the TOmn output pin to the start of the timer
operation are shown below.
Figure 5-32 State change from setting timer output to start of operation
TCRmn
(counter)
Timer multiplex pin
Timer output singal
TOmn write operation enable period TOmn write operation disable period
(1)configure TOMmn
configure TOLmn
(2)configure TOMmn
(3)configure
TOEmn
(4),(5)
Configure
Port to
output mode
(6)Timer start operating
Random value ( "FFFFH" after reset )
(1) Set the operating mode of the timer output.
TOMmn bit (0: master channel output mode, 1: slave channel output mode).
TOLmn bit (0: positive logic output, 1: negative logic output).
(2) Set the timer output signal to the initial state by setting the timer output register m (TOm).
(3) Write 1 to the TOEmn bit, allowing the timer output (disable writing of TOm register).
(4) Set the port to a digital input/output through the Port Mode Control Register (PMCxx).
(5) Set the input/output of the port to output.
(6) Allow the timer to run (TSmn=1).
Note m: unit number (m=0,1) n: channel number (n=0~3).