전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

AN1045 데이터시트(PDF) 3 Page - STMicroelectronics

부품명 AN1045
상세설명  ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
PDF  16 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
제조업체  STMICROELECTRONICS [STMicroelectronics]
홈페이지  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1045 데이터시트(HTML) 3 Page - STMicroelectronics

  AN1045 Datasheet HTML 1Page - STMicroelectronics AN1045 Datasheet HTML 2Page - STMicroelectronics AN1045 Datasheet HTML 3Page - STMicroelectronics AN1045 Datasheet HTML 4Page - STMicroelectronics AN1045 Datasheet HTML 5Page - STMicroelectronics AN1045 Datasheet HTML 6Page - STMicroelectronics AN1045 Datasheet HTML 7Page - STMicroelectronics AN1045 Datasheet HTML 8Page - STMicroelectronics AN1045 Datasheet HTML 9Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 3 / 16 page
background image
3/16
ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
2.2 INITIATING A COMMUNICATION
To initiate an I2C communication, first a start condition has to be generated and then the se-
lected slave address has to be sent, both by the master.
Here, this action is done by calling the function I2Cm_Start() followed by the sending of the
slave address with the least significant bit correctly set (0:transmission, 1:reception).
As the slave here is an EEPROM, two addresses have to be sent by the master to the slave:
the address of the slave and the address where you want to write or read into the EEPROM
(refer to Section 3: Communication frames).
2.3 SENDING A DATA BYTE ON THE I2C BUS
To transmit a new data byte from the ST72324, the addresses or data bytes previously trans-
mitted have to be completed correctly. This previous byte transmission check is done with the
reception of an acknowledge condition by the master. If an error is detected (AF: Acknowledge
Failure), the AF bit of the created I2C_SR2 register is cleared and the transmission is re-
started from the START condition.
When the previous data transmission is over, the application writes the new data byte to be
transmitted. The data to transmit is put on the created I2C_DR register and is sent bit by bit
through PADR (PA6=SDA), MSB first.
All the data to send to the slave (and the addresses too) are stored in a table.
2.4 RECEIVING A DATA BYTE ON THE I2C BUS
To receive a new data byte, the previous data byte to receive has to be completed correctly.
This byte reception check is done with the sending of an acknowledge condition by the
master. An AF can’t occur on the master side because it’s the master that sends the acknowl-
edge condition. If there is a problem with the reception of this acknowledge, it’s up to the slave
to manage this problem.
The frame in this case (master receiver) is: the master after sending the first Start condition
and the two addresses, has to resend a Start condition followed by the address of the
EEPROM, but this time with the least significant bit at 1 to make the slave understand it’s
waiting for the data (refer to Section 3: Communication frames).
When the master is receiver, after receiving the last data, it has to generate a non acknowl-
edge condition to be able to generate the STOP condition afterwards.
Note: There is no need to clear the ACK bit to disable acknowledgement before receiving the
second last byte or set the STOP bit before receiving the last byte (as is necessary in ST7
MCUs with a dedicated I2C peripheral), because here Acknowledgement and Stop condition
generation is under software control, while in the I2C Peripheral it is under hardware control.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


데이터시트 다운로드

Go To PDF Page


링크 URL



ALLDATASHEET 가 귀하에 도움이 되셨나요?  [ DONATE ] 

Alldatasheet는?   |   광고문의   |   운영자에게 연락하기   |   개인정보취급방침   |   링크 투 데이터시트    |   링크교환   |   제조사별 검색
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com