'AVR I2C'에 해당되는 글 2건

  1. 2012.02.20 AVR ATmega128 i2c
  2. 2012.01.11 AVR TWI 예제
embeded/AVR (ATmega,ATtiny)2012. 2. 20. 23:20
AVR 에서도 I2C는 open drain으로 구성되는데
i2c 기능을 사용하지 않고,  GPIO로 구성해서 i2c 통신을 할 경우에는
i2c 버스 풀업과 avr pin 내장 풀업으로 인해 모종의 문제가 발생하는 듯하다.

• INT1/SDA – Port D, Bit 1
INT1, External Interrupt source 1. The PD1 pin can serve as an external interrupt source to the MCU.
SDA, Two-wire Serial Interface Data: When the TWEN bit in TWCR is set (one) to enable the
Two-wire Serial Interface, pin PD1 is disconnected from the port and becomes the Serial Data
I/O pin for the Two-wire Serial Interface. In this mode, there is a spike filter on the pin to sup-
press spikes shorter than 50 ns on the input signal, and the pin is driven by an open drain driver
with slew-rate limitation.
 
•INT0/SCL – Port D, Bit 0
INT0, External Interrupt source 0. The PD0 pin can serve as an external interrupt source to the MCU.
SCL, Two-wire Serial Interface Clock: When the TWEN bit in TWCR is set (one) to enable the
Two-wire Serial Interface, pin PD0 is disconnected from the port and becomes the Serial Clock
I/O pin for the Two-wire Serial Interface. In this mode, there is a spike filter on the pin to sup-
press spikes shorter than 50 ns on the input signal, and the pin is driven by an open drain driver
with slew-rate limitation. 

Electrical Interconnection
As depicted in Figure 86, both bus lines are connected to the positive supply voltage through
pull-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 low
level on a TWI bus line is generated when one or more TWI devices output a zero. A high level
is output when all TWI devices tri-state their outputs, allowing the pull-up resistors to pull the line
high. Note that all AVR devices connected to the TWI bus must be powered in order to allow any bus operation. 
The number of devices that can be connected to the bus is only limited by the bus capacitance
limit of 400 pF and the 7-bit slave address space. A detailed specification of the electrical char-
acteristics of the TWI is given in “Two-wire Serial Interface Characteristics” on page 322. Two
different sets of specifications are presented there, one relevant for bus speeds below 100 kHz,
and one valid for bus speeds up to 400 kHz. 

'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

attiny2313과 함께하는 지랄같은 주말 -_-  (0) 2013.06.29
0으로 나누면 어떻게 될까?  (0) 2012.07.04
AVR ISP 핀 순서  (0) 2012.01.22
AVT FFT + DAC = 보청기?  (0) 2012.01.18
AVR TWI 예제  (0) 2012.01.11
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2012. 1. 11. 17:35
24CXX EEPROM 을 이용한 TWI 예제라는데
데이터시트를 살펴보면 8bit 레지스터를 위한 주소를 가지는 녀석이다.
용량이 큰녀석들은 16bit 주소를 사용하므로 nongnu에서 공개하는 소스대로 사용하면 안될듯 하다.
[링크 :  http://www.nongnu.org/avr-libc/user-manual/group__twi__demo.html



[링크 :  http://pdf1.alldatasheet.com/datasheet-pdf/view/200505/SANYO/LE24C0221M.html]


'embeded > AVR (ATmega,ATtiny)' 카테고리의 다른 글

AVR ISP 핀 순서  (0) 2012.01.22
AVT FFT + DAC = 보청기?  (0) 2012.01.18
AVR EEPROM / CODE section 관련  (0) 2012.01.03
AVR ATmega용 JTAG과 AVR32 호환성?  (0) 2011.12.29
ATMEL AVR 시리즈별 플래시 / 메모리 용량  (2) 2011.12.29
Posted by 구차니