T81L0006B TM Technology Inc., T81L0006B Datasheet - Page 9

no-image

T81L0006B

Manufacturer Part Number
T81L0006B
Description
8-bit A/d Type Mcu
Manufacturer
TM Technology Inc.
Datasheet
tm
Multiprocessor Communications
The 9
serial port interrupt will be activated only if RB8 = ‘1’. This feature is enabled by setting bit SM2 in SCON. A way to use
this feature in multiprocessor systems is as follows: When the master processor wants to transmit a block of data to one of
several slaves, it first sends out an address byte which identifies the target slave. An address byte differs from a data byte in
that the 9th bit is ‘1’ in an address byte and ‘0’ in a data byte. With SM2 = ‘1’, no slave will be interrupted by a data byte. An
address byte, however, will interrupt all slaves, so that each slave can examine the received byte and see if it is being
addressed. The addressed slave will clear its SM2 bit and prepare to receive the data bytes that will be coming. The slaves
that weren’t being addressed leave their SM2s set and go on about their business, ignoring the coming data bytes.
SM2 = ‘1’, the receive interrupt will not active unless a valid stop bit is received.
Serial Port Control Register
contains not only the mode selection bits, but also the 9th data bit for transmit and receive (TB8 and RB8), and the serial port
interrupt bits (TI and RI).
Baud Rates
the value of bit SMOD in Special Function Register PCON. If SMOD = ‘0’ (which is the value on reset), the baud rate is 1/64
the oscillator frequency. If SMOD = ‘1’, the baud rate is 1/32 the oscillator frequency.
Mode 2 Baud Rate =2
In the T81L0006A/B, the baud rates in Modes 1 and 3 are determined by the Timer 1 overflow rate.
SCON
MSB
Where SM0, SM1 specify the serial port mode, as follows:
Using Timer 1 to Generate Baud Rates
When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3 are determined by the Timer 1 overflow
rate and the value of SMOD as follows:
Mode 1, 3 Baud Rate =2
The Timer 1 interrupt should be disabled in this application. The Timer 1 itself can be configured for either “timer” or
“counter” operation, and in any of its 3 running modes. In the most typical applications, it is configured for “timer” operation,
in the auto-reload mode (high nibble of TMOD = 0010B). In that case the baud rate is given by the formula:
Mode 1, 3 Baud Rate =2
One can achieve very low baud rates with Timer 1 by leaving the Timer 1 interrupt enabled, and configuring the Timer to run
as a 16-bit timer (high nibble of TMOD = 0001B), and using the Timer 1 interrupt to do a 16-bit software reload.
Using Timer 2 to Generate Baud Rates
Timer2 is selected as the baudrate generator by setting TCLK and/or RCLK in T2CON register as followed.
T2CON (
T2CON.7: TF2 Timer2 overflow flag set by timer2 overflow and must be cleared by software. TF2 will not be set when
either RCLK=1 or TCLK=1.
T2CON.6: EXF2 Timer 2 external flag set when either a capture or reload is caused by a negative transition on T2EX and
EXEN2=1. when timer2 interrupt is enabled, EXF2=1 will cause the CPU to vector to the timer2 interrupt routine. EXF2
must be cleared by software.
T2CON.5: RCLK Receive clock flag. When set, cause the serial port to use timer2 overflow pulses for its receive clock in
TM Technology Inc. reserves the right
SM0 SM1
to change products or specifications without notice.
0
0
1
1
SM0
Modes 2 and 3 have a special provision for multiprocessor communications. In these modes, 9 data bits are received.
th
SM2 has no effect in Mode 0, in Mode 1 can be used to check the validity of the stop bit. In
The serial port control and status register is the Special Function Register SCON, shown in Figure 11. This register
The baud rate in Mode 0 is fixed: Mode 0 Baud Rate = Oscillator Frequency / 12. The baud rate in Mode 2 depends on
MSB
one goes into RB8. Then comes a stop bit. The port can be programmed such that when the stop bit is received, the
0
1
0
1
address :
TF2
CH
TE
SM1
Mode
0
1
2
3
C8h)
SMOD
EXF2
SMOD
SMOD
Description
shift register
8-bit UART
9-bit UART
9-bit UART
/64* (Oscillator Frequency)
SM2
/32* (Timer 1 Overflow Rate)
*(Oscillator Frequency)/ 32/12 / [256 _ (TH1)]
RCLK
REN
Baud Rate
f
Variable
UART F
Variable
TCLK
OSC
/ 12
TB8
OSC
/64 or F
P. 9
EXEN2
RB8
OSC
/32
TR2
TI
C/T2
Publication Date: JAN. 2006
LSB
RI
T81L0006A/B
CP/RL2
Mode 1 reception, if
LSB
Revsion : C

Related parts for T81L0006B