beautypg.com

Rainbow Electronics AT89C5132 User Manual

Page 114

background image

114

AT8xC5132

4173A–8051–08/02

The SADEN byte is selected so that each slave may be addressed separately.
For slave A, bit 0 (the LSB) is a don’t care bit; for slaves B and C, bit 0 is a 1. To commu-
nicate with slave A only, the master must send an address where bit 0 is clear (e.g.

1111 0000B

).

For slave A, bit 1 is a 0; for slaves B and C, bit 1 is a don’t care bit. To communicate with
slaves A and B, but not slave C, the master must send an address with Bits 0 and 1 both
set (e.g.

1111 0011B

).

To communicate with slaves A, B and C, the master must send an address with bit 0 set,
bit 1 clear, and bit 2 clear (e.g.

1111 0001B

).

Broadcast Address

A broadcast address is formed from the logical OR of the SADDR and SADEN registers
with zeros defined as don’t care Bits, e.g.:

SADDR = 0101 0110b

SADEN = 1111 1100b

(SADDR | SADEN)=1111 111Xb

The use of don’t care Bits provides flexibility in defining the broadcast address, however
in most applications, a broadcast address is FFh.

The following is an example of using broadcast addresses:

Slave A:SADDR = 1111 0001b

SADEN = 1111 1010b

Given = 1111 1X11b,

Slave B:SADDR = 1111 0011b

SADEN = 1111 1001b

Given = 1111 1X11b,

Slave C:SADDR = 1111 0010b

SADEN = 1111 1101b

Given = 1111 1111b,

For slaves A and B, bit 2 is a don’t care bit; for slave C, bit 2 is set. To communicate with
all of the slaves, the master must send the address FFh.

To communicate with slaves A and B, but not slave C, the master must send the
address FBh.

Reset Address

On reset, the SADDR and SADEN registers are initialized to 00h, i.e. the given and
broadcast addresses are

XXXX XXXXb

(all don’t care Bits). This ensures that the Serial

Port is backwards compatible with the 80C51 microcontrollers that do not support auto-
matic address recognition.