1 / 15

APPLICATION OVER I2C

APPLICATION OVER I2C. Kıvanç ÖZBEK 504031549. What is I2C?. 2-wired communication interface Communication protocol used in small areas Defined in 1980’s by Philiphs Bidirectional data transmission 7 bit slave address Acknowledgement after each byte. I2C Properties.

phiala
Download Presentation

APPLICATION OVER I2C

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. APPLICATION OVER I2C Kıvanç ÖZBEK 504031549

  2. What is I2C? • 2-wired communication interface • Communication protocol used in small areas • Defined in 1980’s by Philiphs • Bidirectional data transmission • 7 bit slave address • Acknowledgement after each byte

  3. I2C Properties • Random selection procedure • Transmission capacity up to 400 KHz • Line length up to 4 meters • Line capacitance up to 400 pF • Divice capacitance up to 10 pF

  4. Roles • Master • Controling the clock signal • Defining the slave address • Defining the Start – Stop conditions • Slave • Sending ack after each byte • Controling the data line during read operations • Taking clock from the line

  5. About the application

  6. About the application • The term open-collector typically refers to a transistor output where the collector (output) of the transistor is not connected to a positive voltage. Since a transistor used in outputs is a saturated switch, the collector needs to be connected to a positive voltage to complete the transistor circuit. This positive voltage need not be any specific value as long as it is above the saturation of the transistor. Because of this, an open collector output can be connected to a range of voltages using a pullup resistor. This resistor is required for the output to function as it completes the transistor's circuit.

  7. About the application

  8. About the application

  9. About the application

  10. About the application wvalue=0x00; rvalue = outp(data,wvalue); delay(wait); wvalue=0x0f; rvalue=outp(control,wvalue);/*scl ve sda 1 yapildi*/ delay(wait); wvalue=0x80; rvalue = outp(data,wvalue);/*sda 0 yaparak start cond. olusturuldu*/

  11. About the application wvalue=0x00; rvalue=outp(control,wvalue); /*scl 0 yapildi*/ delay(wait); wvalue=0x80; rvalue = outp(data,wvalue); /*sda 0 yapildi*/ delay(wait); wvalue=0x0f; rvalue=outp(control,wvalue); /*scl 1 yapildi*/ delay(wait); wvalue=0x00; rvalue = outp(data,wvalue); /*sda 1 yapilarak stop cond. olusturuldu*/ delay(wait);

  12. About the application • check: • for(i;i<5;i++){ • rvalue=inportb(status); • rvalue<<=4; • delay(wait); • if(rvalue>127){ //scl 0 okundu • delay(wait); • rvalue=inportb(status); • rvalue<<=4; • if(rvalue<128){ //scl 1 okunursa hat mesgul • printf("Hat mesgul\n"); • i=0; • } • else{//isMain 0 ise sda 1 kalacaktir dolayisiyla ana master calisir • wvalue=isMain; • rvalue = outp(data,wvalue);//sda belirlenerek hat sahipligi olustu • delay(wait); • }

  13. About the application • } • } • printf("Hat uygun kullanilabilir\n"); • wvalue=0x00; • rvalue=outp(control,wvalue); //scl 0 • delay(wait*2); • if(inportb(status) > 127){ //sda kontrol edildi • printf("Ana master calisacak\n"); • goto check; • }

  14. Encountered Difficulties • No direct access to parallel port in XP • Because it is not allowed to use ports directly in windows xp, windows me is used. • No device to watch parallel port outputs • There were no hardware to watch the outputs so again parallel port is used to see what is written to the port. • Outer power supply • Game port pin 1(Vcc) and pin 4(Gnd) used.

  15. Thank you for your interest Questions?

More Related