EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / How to read 16 bit of data using I2C/TWI Protocol

How to read 16 bit of data using I2C/TWI Protocol

|

Miscellaneous › Others › How to read 16 bit of data using I2C/TWI Protocol

  • This topic has 0 replies, 1 voice, and was last updated 10 years, 11 months ago by Amit.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • November 15, 2015 at 4:24 am #4103
    Amit
    Participant

    Hi friends

     I have slave device INA219 which has 16 bit resister, and i have to read this 16 bit resister using I2C/TWI Protocol

    my confussion is I2C has Data resister(TWDR) 8bit then how to read 16 bit ?

     

    Here i have written I2C/TWI Read function 

     

     

    void TWI_read_data(void)
    {
    TWCR=(1<<TWINT)|(1<<TWEN);    // Clear TWI interrupt flag,Enable TWI
    while (!(TWCR & (1<<TWINT))); // Wait till complete TWDR byte transmitted
    while((TWSR & 0xF8) != 0x58); // Check for the acknoledgement
    recv_data=TWDR;
    PORTB=recv_data;

    }

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS feed: Recent Posts Recent Posts

  • Request for a 5W transistor controlled LED flash light controller circuit review October 10, 2026
  • Delco alternator (12SI) AC-tap - what is the mate to this connector called and where to find it? October 10, 2026
  • Frustration, single phase, high KW, high voltage battery charge module, rectifier. October 10, 2026
  • On off switch hack October 10, 2026
  • Almost Very New in PCB / KICAD DESIGN October 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of Arrowfly
Privacy Policy | Advertising

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise