1 / 19

I 2 C

I 2 C. Wat kun je ermee?. Het concept. Patent Philips Afkorting : inter-ic bus: i*i*C Seriële bus, bi-directioneel Standaard voor trage communicatie (10 kbyte/s) Twee leidingen: SDA (serial data) en SCL (Serial Clock) Master en slave principe Elke component adresseerbaar. Het protocol.

nusa
Télécharger la présentation

I 2 C

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. I2C Wat kun je ermee? HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  2. Het concept • Patent Philips • Afkorting : inter-ic bus: i*i*C • Seriële bus, bi-directioneel • Standaard voor trage communicatie (10 kbyte/s) • Twee leidingen: SDA (serial data) en SCL (Serial Clock) • Master en slave principe • Elke component adresseerbaar HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  3. Het protocol • Zodra de bus vrij is, kan een master de bus in beslag nemen door een startconditie te genereren. • Het eerste byte dat nu vérzonden wordt, bevat het 7-bits IC-adres samen met het R/W-bit. Is het geadresseerde IC op de bus aanwezig, dan reageert het met een ACK-puls. De data-uitwisseling kan daarna beginnen. • Was de R/W-puls '0', dan stuurt de master data naar de slave totdat hij geen ACK-puls meer ontvangt of alle data verzonden is. Was de R/W-puls ' 1', dan genereert de master klokpulsen gedurende welke de slave zijn data kan verzenden. Na ieder ontvangen byte genereert de master (deze is nu ontvanger) een ACK-puls. • Tot slot kan de master de bus weer vrij maken door een stopconditie te genereren. HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  4. I2C implementatie 1. hardwarematig 2. via een microcontroller 3. simulatie HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  5. I2C implementatie1. hardwarematig i2c interface tussen 8 bits databus en i2c bus: HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  6. I2C implementatie2. microcontroller HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  7. I2C implementatie3. simulatie Public Function I2CInit() SCL=1 SDA=1 End Function Public Function I2CStart() SDA=0 SCL=0 End Function Public Function I2CStop() SCL=0 SDA=0 SCL=1 SDA=1 End Function HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  8. I2C implementatie3. simulatie Public Function I2CSchrijf(waarde As Byte) As Boolean Dim Bitwaarde, n, i As Byte I2CSchrijf = True Bitwaarde = 128 For n = 1 To 8 If (waarde And Bitwaarde) = Bitwaarde Then SDA=1 Else SDA=0 End If SCL=1 wacht (1) ' Even wachten.. SCL=0 'integer deling \ = div operator in pascal: Bitwaarde = Bitwaarde \ 2 Next n SDA=1 SCL=1 wacht (1) ' Even wachten.. If cts = 1 Then I2CSchrijf = False rts (0) ' SCL=0 End Function HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  9. Z5.1 Z5.1 I2C interfaceVoorbeeld: VBprojects\i2ctest\i2ctest.bas I2C bus via seriële poort: I2C bus via de seriële poort CTS SDA DTR 6k8 SCL RTS 6k8 GND GND HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  10. I2C bus via USB poort USB CY7C63001A P0.0 P0.1 P0.4 SCL SDA I2C interface I2C bus via USB: HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  11. I2C interfaceVoorbeeld VBprojects\usbi2c\usbi2c1 HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  12. I2C interfaceVoorbeeld VBprojects\usbi2c\usbi2c1 I2C bus via USB: HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  13. I2C interfaceVoorbeeld: Bascom I2C bus via de microcontroller: HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  14. I2C interfacePDA HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  15. I2C Componenten • PCFB200: spraaksynthesizer • PCFB566: universele LCD-driver • PCF8570: statische RAM • PCF857OC: statische RAM • PCF8572: EEPROM (12BxB) • PCF8573: real-time-klok-kalender • PCF8574 remote 8-bit IO-expander HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  16. I2C Componenten • PCF8579: LCD-driver voor dotmatrix • PCF85B2A: EEPROM (256xB) • PCF85B3: klok-kalender met RAM • PCF8591: 8-bit A/D- en D/A-conv. • SAAIO64: 4-digit LED-driver • SAAI136: PCM-audio-interface • SAAI300: tuner-schakelcircuit HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  17. I2C Componenten • SAA5243145: computerbestuurd teletekst-circuit • TEA6000/6100: FMtuner • TEA6300(T)/10T: fader-geluidscircuit • TEA6330T: regelversterker SAA9020 HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  18. I2C Toepassingen 1. I2Ckompas (www.zenot.nl) 2. Koelkast (www.zenot.nl) 3. Stappenmotor controller (www.zenot.nl) HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

  19. I2C Toepassingen Testbordje koelkast: HCC PC gebruikersgroep: Practical Electronics, 26-02 Maarssenbroek

More Related