1 / 19

I 2 C Bus Drivers for Windows 2K, XP

I 2 C Bus Drivers for Windows 2K, XP. Pavel No vák Tomáš Ma toušek. I 2 C Basic Characteristics. Inter-Integrated Circuts Bus originally to interact within small num. of devs (radio/TV tuning, …) max. speeds: 100 kbps ( standard mode ) 400 kbps (fast mode) 3 . 4 Mbps (high-speed mode)

liza
Télécharger la présentation

I 2 C Bus Drivers for Windows 2K, XP

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 Bus Driversfor Windows 2K, XP Pavel Novák Tomáš Matoušek

  2. I2C Basic Characteristics • Inter-Integrated Circuts Bus • originally to interact within small num. of devs (radio/TV tuning, …) • max. speeds: • 100 kbps (standard mode) • 400 kbps (fast mode) • 3.4 Mbps (high-speed mode) • data transfers: serial, 8-bit oriented, bi-directional • master/slave relationships with multi-master option (arbitration) • master can operate as transmitter or receiver • addressing: 7bit or 10bit unique addresses

  3. Wires and Signals • two-wired bus • serial data line (SDA) • serial clock line (SCL) • bit transfer • level triggered • one clock pulse per data bit • stable data during high clocks • data change during low clocks

  4. Wired-AND Connection • open collectors, pull-up resistors • bus is free  SDA and SCL are high

  5. Frame Formats master-transmitter master-receiver (since second byte)

  6. Addressing by 7 bits • the first byte transmitted by master: • 7 bits: address • 1 bit: direction (R/W) 0 … master writes data (W) – transmitter since next byte 1 … master reads data (R) – receiver since next byte • during the first byte transfer: • master is transmitter • addressed slave is receiver • data transfer terminated by a stop condition • master may generate repeated start and address another device

  7. Microchip PIC16F628 • 8-bit 20MHz RISC microcontroller • USART • Rx, Tx, DTR, DSR for communication • RTS resetting, low voltage programming • memory • FLASH program (2048 x 14bit) • RAM data (224B) • EEPROM data (128B) • hardware stack (8 levels) • interrupts, 3 timers, 16 I/O pins • 35 instructions • single-cycled except for 2-cycled branches

  8. Layered Drivers TCP/IP drivers TCP/IP drivers NDIS.sys NDIS.sys I2CNET.sys I2CNET.sys Ethernet over I2C I2C.sys I2C.sys link layer Serial.sys Serial.sys PC UART PC UART PIC16F628 PIC16F628 physical layer I2C bus I2C bus

  9. Virtual Network Device Installation

  10. Virtual Network Device Installation

  11. Virtual Network Device Settings

  12. Virtual Network Device Settings

  13. Network Driver Interface Specification (NDIS) • Common interface for network drivers • specification not only for device drivers • includes: • Miniport drivers • Intermediate drivers • Protocol drivers

  14. NDIS Miniport Implementation • DriverEntry() • driver initialization • calls NdisMRegisterMiniport() • informs NDIS about new Miniport driver • MiniportInitialize() • – called by NDIS for each instance of network controller device • MiniportHalt() • MiniportReset() • MiniportShutdown()

  15. Information Transmission – To NDIS NDIS_STATUS MiniportQueryInformation(IN NDIS_HANDLEMiniportAdapterContext,IN NDIS_OIDOid,IN PVOIDInformationBuffer,…OUT PULONGBytesWritten,…); Oids:OID_GEN_MEDIA_SUPPORTED // EthernetOID_GEN_LINK_SPEEDOID_GEN_MEDIA_CONNECT_STATUSOID_PNP_CAPABILITIESOID_802_3_PERMANENT_ADDRESSOID_GEN_XMIT_OK…

  16. Information Transmission – To Our Driver NDIS_STATUS MiniportSetInformation(IN NDIS_HANDLE MiniportAdapterContext,IN NDIS_OIDOid,IN PVOIDInformationBuffer,…OUT PULONGBytesRead,…); Oids:OID_GEN_NETWORK_LAYER_ADDRESSESOID_GEN_CURRENT_PACKET_FILTEROID_PNP_SET_POWER…

  17. Data Transfer – To Network NDIS_STATUS MiniportSend(IN NDIS_HANDLE MiniportAdapterContext,IN PNDIS_PACKET Packet,…); NdisQueryPacket(Packet,…,&Buffer…);

  18. Data Transfer – From Network VOID NdisMEthIndicateReceive(IN NDIS_HANDLE MiniportAdapterHandle,IN NDIS_HANDLE MiniportReceiveContext,IN PVOID HeaderBuffer,…IN PVOID LookaheadBuffer,…IN UINT PacketSize); NDIS_STATUS MiniportTransferData(OUT PNDIS_PACKETPacket,…IN NDIS_HANDLEMiniportAdapterContext,IN NDIS_HANDLEMiniportReceiveContext,……);

  19. Further Information • The I2C Bus Specification, version 2.1, January 2000 www.semiconductors.philips.com/buses/i2c • Microchip PIC16F627/8 Data Sheet ww1.microchip.com/downloads/en/DeviceDoc/40300c.pdf • WinPic - A PIC Programmer for Windows www.qsl.net/dl4yhf/winpicpr.html • PIC C compiler www.ccsinfo.com/picc.shtml

More Related