English
Language : 

C8051F120 Datasheet, PDF (325/356 Pages) Silicon Laboratories – Mixed Signal ISP Flash MCU Family
C8051F120/1/2/3/4/5/6/7
C8051F130/1/2/3
the timer matches the value stored in RCAPnH:RCAPnL. When counting UP, the auto-reload value for the
timer is RCAPnH:RCAPnL, and overflow will occur when the value in the timer transitions from 0xFFFF to
the reload value.
To output a square wave, the timer is placed in reload mode (the Capture/Reload Select Bit in TMRnCN
and the Timer/Counter Select Bit in TMRnCN are cleared to ‘0’). The timer output is enabled by setting the
Timer Output Enable Bit in TMRnCF to ‘1’. The timer should be configured via the timer clock source and
reload/underflow values such that the timer overflow/underflows at 1/2 the desired output frequency. The
port pin assigned by the crossbar as the timer’s output pin should be configured as a digital output (see
Section “18. Port Input/Output” on page 239). Setting the timer’s Run Bit (TRn) to ‘1’ will start the toggle of
the pin. A Read/Write of the Timer’s Toggle Output State Bit (TMRnCF.2) is used to read the state of the
toggle output, or to force a value of the output. This is useful when it is desired to start the toggle of a pin in
a known state, or to force the pin into a desired state when the toggle mode is halted.
Equation 23.1. Square Wave Frequency (Timer 2 and Timer 4 Only)
Fsq = -2----×-----(--6---5----5F---3-T--6-C---–-L---K-R----C----A----P----n---)-
Rev. 1.3
325