This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

writing integer on I2C device.

I want to write/read a integer/ long integer on a I2C device, but all the routines I have supports only character(single byte) writing/ reading from I2C device. Can anyone help me?

Parents Reply Children
  • "The Keil compiled does not execute shift 8, it is 'smart'enough to realize that shift 8 means 'grab the other byte'. Thus shift 8 is fast and simple."

    Yes; that's why I said,

    "Shifting is portable but may be slow;
    The others are non-portable, but
    likely to be fast." (now with added emphasis).

    Portability is definite; performance depends on the implementation - and which is the most important depends upon the requirements of the application!