Electronic Components Datasheet Search
  English  ▼

X  

AN1045 Datasheet(PDF) 11 Page - STMicroelectronics

Part # AN1045
Description  ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
PDF  16 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1045 Datasheet(HTML) 11 Page - STMicroelectronics

Back Button AN1045 Datasheet HTML 7Page - STMicroelectronics AN1045 Datasheet HTML 8Page - STMicroelectronics AN1045 Datasheet HTML 9Page - STMicroelectronics AN1045 Datasheet HTML 10Page - STMicroelectronics AN1045 Datasheet HTML 11Page - STMicroelectronics AN1045 Datasheet HTML 12Page - STMicroelectronics AN1045 Datasheet HTML 13Page - STMicroelectronics AN1045 Datasheet HTML 14Page - STMicroelectronics AN1045 Datasheet HTML 15Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 11 / 16 page
background image
11/16
ST7 S/W IMPLEMENTATION OF I2C BUS MASTER
SetBit(I2C_SR2,AF);
ClrBit(I2C_SR1,ACK);
return;
}
delay(1);
if (ValBit(PADR,SDA))
/* Test of SDA level, if high -> pb
*/
{
SetBit(I2C_SR2,AF);
ClrBit(I2C_SR1,ACK);
return;
}
delay(1);
SetBit(PADDR,SCL);
/* End of the clock pulse
*/
SetBit(I2C_SR1,ACK);
delay(1);
ClrBit (PADR,SDA);
SetBit(PADDR,SDA);
/* Reconfigure SDA as output to proceed at the next transmission
*/
}
/*--------------------------------------------------------------------------
ROUTINE NAME : I2C_nAck
INPUT/OUTPUT : None.
DESCRIPTION : Non acknoledge generation from now.
COMMENTS
: Transfer sequence = DATA, NACK.
--------------------------------------------------------------------------*/
void I2C_nAck (void)
{
ClrBit(I2C_SR2,ACK);
/* Non acknoledge when the master is receiver
*/
SetBit(PADR,SDA);
/* The master pulls the SDA line high
*/
SetBit(PADDR,SCL);
/* Output open drain to have a low level
*/
delay(10);
ClrBit(PADDR,SCL);
/* The master generates a clock pulse
*/
delay(10);
SetBit(PADDR,SCL);
/* Clock pulse complete
*/
ClrBit(PADR,SDA);
/* The master pulls the SDA line high
*/
delay(3);
}
/*--------------------------------------------------------------------------
ROUTINE NAME : I2Cm_Init
INPUT/OUTPUT : None.
DESCRIPTION : I2C peripheral initialisation routine.
COMMENTS
: Contains inline assembler instructions in C like mode !
--------------------------------------------------------------------------*/
void I2Cm_Init (void)



Html Pages

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


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
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