
148
ATmega8515(L)
2512A–AVR–04/02
The Multi-processorCommunication modeenablesseveralSlave MCUs to receive data
from a MasterMCU.This isdone by first decodinganaddress frame to find out which
MCU hasbeen addressed. If a particularslave MCU hasbeen addressed, it will receive
the following data frames as normal, whiletheotherslave MCUs will ignorethe received
frames until another address frame isreceived.
Using MPCM For an MCU to actas a Master MCU, it can usea9-bit characterframe format
(UCSZ = 7).Theninthbit (TXB8) must be set when an address frame (TXB8 = 1) or
clearedwhen a data frame (TXB = 0) isbeing transmitted.The slave MCUs mustinthis
case be set to usea9-bit characterframe format.
The following procedure should beused to exchange data in Multi-processorCommuni-
cation mode:
1. All Slave MCUs areinMulti-processorCommunication mode (MPCM in UCSRA
isset).
2. The MasterMCUsends an address frame, and all slavesreceive andread this
frame. Inthe Slave MCUs, theRXC flag in UCSRA will be set as normal.
3. Each Slave MCU reads the UDR Register anddetermines if it hasbeen
selected. If so, it clears the MPCM bit in UCSRA, otherwiseitwaitsfor thenext
address byte andkeeps the MPCM setting.
4. TheaddressedMCUwill receive all data frames until anew address frame is
received.TheotherSlave MCUs, which still have the MPCM bit set,will ignore
the data frames.
5. When the last data frame isreceivedbytheaddressedMCU,theaddressed
MCU sets the MPCM bit andwaitsfor anew address frame from Master.The
process then repeatsfrom 2.
Using any of the5- to 8-bit characterframe formats ispossible,but impracticalsincethe
Receiver must change between using n and n+1 characterframe formats.This makes
full-duplex operation difficult sincetheTransmitter and Receiver uses the same charac-
tersize setting. If 5- to 8-bit characterframes areused, theTransmitter must be set to
usetwo stopbit (USBS = 1)sincethe first stopbit is usedfor indicating the frame type.
Do not useRead-Modify-Write instructions (SBI andCBI)to set orclear the MPCM bit.
The MPCM bit shares the same I/Olocation as theTXC flag and this mightaccidentally
be clearedwhen using SBI orCBIinstructions.
Kommentare zu diesen Handbüchern