mg82fel308 Megawin Technology, mg82fel308 Datasheet - Page 61

no-image

mg82fel308

Manufacturer Part Number
mg82fel308
Description
A Single-chip Microcontroller Based On A High Performance 1-t Architecture 80c51
Manufacturer
Megawin Technology
Datasheet
mask can be logically ANDed with the SADDR to create the “Given” address which the master will use for
addressing each of the slaves. Use of the Given address allows multiple slaves to be recognized while excluding
others.
The following examples will help to show the versatility of this scheme:
In the above example SADDR is the same and the SADEN data is used to differentiate between the two slaves.
Slave 0 requires a 0 in bit 0 and it ignores bit 1. Slave 1 requires a 0 in bit 1 and bit 0 is ignored. A unique address
for Slave 0 would be 1100 0010 since slave 1 requires a 0 in bit 1. A unique address for slave 1 would be 1100
0001 since a 1 in bit 0 will exclude slave 0. Both slaves can be selected at the same time by an address which
has bit 0 = 0 (for slave 0) and bit 1 = 0 (for slave 1). Thus, both could be addressed with 1100 0000.
In a more complex system the following could be used to select slaves 1 and 2 while excluding slave 0:
In the above example the differentiation among the 3 slaves is in the lower 3 address bits. Slave 0 requires that
bit 0 = 0 and it can be uniquely addressed by 1110 0110. Slave 1 requires that bit 1 = 0 and it can be uniquely
addressed by 1110 0101. Slave 2 requires that bit 2 = 0 and its unique address is 1110 0011. To select Slaves 0
and 1 and exclude Slave 2 use address 1110 0100, since it is necessary to make bit 2 = 1 to exclude slave 2.
The Broadcast Address for each slave is created by taking the logical OR of SADDR and SADEN. Zeros in this
result are treated as don’t-cares. In most cases, interpreting the don’t-cares as ones, the broadcast address will
be FF hexadecimal.
Upon reset SADDR (SFR address 0xA9) and SADEN (SFR address 0xB9) are loaded with 0s. This produces a
given address of all “don’t cares” as well as a Broadcast address of all “don’t cares”. This effectively disables the
Automatic Addressing mode and allows the micro-controller to use standard 80C51 type UART drivers which do
not make use of this feature.
Figure 13-9 Auto-Address Recognition
Note: (1) After address matching(addr_match=1), Clear SM2 to receive data bytes
This document information is the intellectual property of Megawin Technology.
© Megawin Technology Co., Ltd. 2009 All rights reserved.
QP-7300-03D
61/84
Slave 0
SADDR = 1100 0000
SADEN = 1111 1101
Given = 1100 00X0
Slave 0
SADDR = 1110 0000
SADEN = 1111 1001
Given = 1110 0XX0
(2) After all data bytes have been received, Set SM2 to wait for next address.
Receive Address D0~D7
Programmed Address
MEGAWIN
MAKE YOU WIN
Start
D0
SCON
D1
SM0/FE
Comparator
D2
Slave 1
SADDR = 1100 0000
SADEN = 1111 1110
Given = 1100 000X
Slave 1
SADDR = 1110 0000
SADEN = 1111 1010
Given = 1110 0X0X
SM1
D3
addr_match
SM2
9-bit data
D4
REN
D5
TB8
RB8
D6
TI
D7
Slave 2
SADDR = 1110 0000
SADEN = 1111 1100
Given = 1110 00XX
RI
D8
Stop
MG82FE(L)308/316
Preliminary, v 0.04

Related parts for mg82fel308