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>20.2.1 TWI TerminologyThe following definitions are frequently encountered in this section.Table 20-1.TermMasterSlaveTransmitterReceiverTWI TerminologyDescriptionThe device that initiates and terminates a transmission. The master also generates theSCL clock.The device addressed by a master.The device placing data on the bus.The device reading data from the bus.20.2.2 Electrical InterconnectionAs depicted in Figure 20-1, both bus lines are connected to the positive supply voltage throughpull-up resistors. The bus drivers of all TWI-compliant devices are open-drain or open-collector.This implements a wired-AND function which is essential to the operation of the interface. A lowlevel on a TWI bus line is generated when one or more TWI devices output a zero. A high levelis output when all TWI devices tri-state their outputs, allowing the pull-up resistors to pull the linehigh. Note that all AVR devices connected to the TWI bus must be powered in order to allow anybus operation.20.3 Data Transfer and Frame FormatThe number of devices that can be connected to the bus is only limited by the bus capacitancelimit of 400 pF and the 7-bit slave address space. A detailed specification of the electrical characteristicsof the TWI is given in “Two-wire Serial Interface Characteristics” on page 300. Twodifferent sets of specifications are presented there, one relevant for bus speeds below 100kHz,and one valid for bus speeds up to 400kHz.20.3.1 Transferring BitsEach data bit transferred on the TWI bus is accompanied by a pulse on the clock line. The levelof the data line must be stable when the clock line is high. The only exception to this rule is forgenerating start and stop conditions.Figure 20-2.Data ValiditySDASCLData StableData StableData Change20.3.2 START and STOP ConditionsThe master initiates and terminates a data transmission. The transmission is initiated when themaster issues a START condition on the bus, and it is terminated when the master issues aSTOP condition. Between a START and a STOP condition, the bus is considered busy, and noother master should try to seize control of the bus. A special case occurs when a new START8155C–AVR–02/11178

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

Saved successfully!

Ooh no, something went wrong!