C501G-1E SIEMENS [Siemens Semiconductor Group], C501G-1E Datasheet - Page 69

no-image

C501G-1E

Manufacturer Part Number
C501G-1E
Description
8-Bit Single-Chip Microcontroller
Manufacturer
SIEMENS [Siemens Semiconductor Group]
Datasheet
On-Chip Peripheral Components
C501
The timer can be configured for either “timer” or “counter” operation: In the most typical applications,
it is configured for “timer” operation (C/T2 = 0). “Timer” operation is a little different for timer 2 when
it’s being used as a baud rate generator. Normally, as a timer it would increment every machine
f
f
cycle (thus at
/12). As a baud rate generator, however, it increments every state time (
/2). In
OSC
OSC
that case the baud rate is given by the formula
Modes 1,3 baud rate =
f
/32 [65536 – (RC2H, RC2L)]
OSC
where (RC2H, RC2L) is the content of RC2H and RC2L taken as a 16-bit unsigned integer.
Note that the rollover in TH2 does not set TF2, and will not generate an interrupt. Therefore, the
timer 2 interrupt does not have to be disabled when timer 2 is in the baud rate generator mode. Note
too, that if EXEN2 is set, a 1-to-0 transition in T2EX can be used as an extra external interrupt, if
desired.
It should be noted that when timer 2 is running (TR2 = 1) in “timer” function in the baud rate
generator mode, one should not try to read or write TH2 or TL2. Under these conditions the timer
is being incremented every state time, and the results of a read or write may not be accurate. The
RC registers may be read, but shouldn’t be written to, because a write might overlap a reload and
cause write and/or reload errors. Turn the timer off (clear TR2) before accessing the timer 2 or RC
registers, in this case.
Semiconductor Group
6-35

Related parts for C501G-1E