CMS32L051 User Manual |Chapter 5 Universal Timer Unit (Timer4)
www.mcu.com.cn 140 / 703
5.3.15 Registers for controlling timer input/output pin port functions
When using a general-purpose timer unit, the input/output pins of timer 0 are multiplexed to a fixed
port, and the input/output pins of timer 1 can be arbitrarily configured to ports except RESETB. For details,
please refer to Chapter 2 Pin Functions.
When multiplexing the output pin of Timer 0 to a port, the bit of Port Mode Control Register (PMCxx),
the bit of Port Mode Register (PMxx), and the bit of Port Register (Pxx) corresponding to the port must be
set to 0.
When using the multiplexed port of the timer 0 input pin as the input to the timer, the port must
correspond to position 0 of the port mode control register (PMCxx) and 1 of the port mode register
(PMxx).
When using the multiplexed port of timer 0 input pin as timer input, the corresponding bit of the port
mode control register (PMCxx) must be set to 0 and the bit of the port mode register (PMxx) must be
set to 1.
Example: P21 is configured to TO10 as the timer output
Set the PMC21 bit of the port mode control register 2 to 0.
Set the PM21 bit of the port mode register 2 to 0.
Set the port output multiplexing function configuration register P21 CFG to 0x01.
When using the multiplexed port of Timer 1 input pin as timer input, the bit of Port Mode Register
(PMxx) corresponding to each port must be set to 1 and the bit of Port Mode Control Register (PMCxx)
must be set to 0. And set the port multiplexing function configuration register (TI10PCFG). At this point,
the port register (Pxx) bit can be 0 or 1.
Example: P20 / TI10 is used as the timer input
Set the PMC20 bit of Port Mode Control Register 2 to 0.
Set the PM20 bit of Port Mode Register 2 to 1.
Set the port input multiplexing function configuration register TI10PCFG to 0x0b.