12.07.2015 Views

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

ATmega32A Datasheet - Sunrom Technologies

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ATmega32A</strong>4. The transfer must be finishedNote that data is transmitted both from master to slave and vice versa. The master must instructthe slave what location it wants to read, requiring the use of the MT mode. Subsequently, datamust be read from the slave, implying the use of the MR mode. Thus, the transfer direction mustbe changed. The master must keep control of the bus during all these steps, and the stepsshould be carried out as an atomical operation. If this principle is violated in a multimaster system,another master can alter the data pointer in the EEPROM between steps 2 and 3, and themaster will read the wrong data location. Such a change in transfer direction is accomplished bytransmitting a REPEATED START between the transmission of the address byte and receptionof the data. After a REPEATED START, the master keeps ownership of the bus. The followingfigure shows the flow in this transfer.Figure 20-19. Combining Several TWI Modes to Access a Serial EEPROMMaster TransmitterMaster ReceiverS SLA+W A ADDRESS A Rs SLA+R A DATA A PS = START Rs = REPEATED START P = STOPTransmitted from Master to SlaveTransmitted from Slave to Master20.8 Multi-master Systems and ArbitrationIf multiple masters are connected to the same bus, transmissions may be initiated simultaneouslyby one or more of them. The TWI standard ensures that such situations are handled insuch a way that one of the masters will be allowed to proceed with the transfer, and that no datawill be lost in the process. An example of an arbitration situation is depicted below, where twomasters are trying to transmit data to a slave receiver.Figure 20-20. An Arbitration ExampleV CCDevice 1MASTERTRANSMITTERDevice 2MASTERTRANSMITTERDevice 3SLAVERECEIVER........ Device n R1 R2SDASCL8155C–AVR–02/11201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!