Download Print this page

Automatic Address Recognition; Uart1 Slave Address Control Registers - STC micro STC8A8K64D4 Series Reference Manual

Advertisement

STC8A8K64D4 Series Manual

14.3.9 Automatic Address Recognition

14.3.10 UART1 slave address control registers

Symbol
Address
SADDR
A9H
SADEN
B9H
SADDR: Slave address register
SADEN: Slave address mask register
The automatic address recognition function is typically used in the field of multi-machine communications. Its
main principle is that the slave system identifies the address information from the master serial port data stream through
the hardware comparison function. The address of the slave is set by the registers SADDR and SADEN. The hardware
filters the slave address automatically. The hardware will generate a serial port interrupt when the slave address
information from the master matches the slave address set by the slave. Otherwise, the hardware will discard the serial
port data automatically without any interruption. When a number of slaves in Idle mode are connected together, only
the slave that matches the slave address will wake up from Idle mode. Then the power consumption of the slave MCU
reduces greatly. Constantly entering the serial port interrupt which reduces the system execution efficiency can be
avoided even if the slave is in normal operation.
To use the automatic address recognition feature of the serial port, mode 2 or mode 3 of the serial port of the MCU
that participates in communication is selected. Usually the mode 3 with variable baud rate is selected because the baud
rate of mode 2 is fixed, and it is inconvenient to adjust. SM2 bit of slave in SCON is set to 1. The 9
in RB8 is the address/data flag in mode 2 or 3. When the 9
SBUF is the address information. If SM2 is set to 1, the slave MCU will filter out non-address data whose 9
automatically while the address data whose 9
SADDR and SADEN. If the address matches, RI will be set to "1" and an interrupt will occur. Otherwise the received
data is discarded.
The slave address is set by two registers, SADDR and SADEN. SADDR is the slave address register, where the
slave address is stored. SADEN is the slave address mask register, which is used to set the ignore bit in the address
information. The setting method is as follows.
For example
SADDR =
11001010
SADEN =
10000001
Then the matched address is 1xxxxxx0
That is, as long as bit 0 is 0 and bit 7 is 1 in the address data sent by the master, the address can be matched with
the local address.
Another example
SADDR =
11001010
SADEN =
00001111
Then the matched address is xxxx1010
That is, as long as the low 4 bits are 1010 in the address data sent by the master, the address can be matched with
the local address. The high 4 bits can be any value and are ignored.
The Broadcast Address (FFH) can be used by the master to select all the slaves simultaneously for communication.
B7
B6
th
bit is 1 in SBUF will automatically be matched with the address set in
B5
B4
B3
th
bit is 1, it indicates the previous 8-bit datum stored in
B2
B1
B0
th
bit which is stored
th
bit is 0
- 379 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin