Shop OBEX P1 Docs P2 Docs Learn Events
How To Use I2C — Parallax Forums

How To Use I2C

Mike MarksMike Marks Posts: 3
edited 2013-05-28 20:08 in BASIC Stamp
I am a first time user of the I2C command having recently purchased an Adafruit INA219 current and voltage measurement breakout board. For the write operation, the INA219 does not require an address after the saveID. Can one write via a Stamp2p:

Sid con %10000000

I2Cout,0,Sid,[$02] leaving out the address after the slaveID?
Or, does one have to include a 0 just to fill the address, as in:
I2Cout 0,$Sid,0,[$02]
Or, are both acceptable?

Mike Marks
Milwaukee

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-27 09:00
    The "Basic Stamp Syntax and Reference Manual" is clear that the address parameter is optional. The Stamp Editor accepts "I2COUT 0,%10000000,[$02]"
  • Mike MarksMike Marks Posts: 3
    edited 2013-05-28 17:46
    Mike:

    Thanks for the reply. I had been reading the old book, Stamp Works Version 1.1, which does not list the address parameter as an option. After your mention, I then consulted the newer Syntax & Reference Manual which states it's optional. Sometimes 4 eyes are better than 2!

    I would have preferred to purchase the INA219 breakout board form Parallax, rather than Adafruit.com, as you provide sample BASIC software for us users to get a quick start rather than struggling to learn a new IC and deciphering a sometimes arcane data sheet. Any thoughts of Parallax supplying such a breakout board in future? Very handy and accurate, gives voltage & current readout with no A to D required.

    Seems breakout boards are getting more important as lots of ICs now come only in surface mount, then how do we mount them to a proto board.

    Mike Marks
  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-28 20:08
    Parallax tends to provide breakout boards when they are needed for a larger product and when there's a large enough projected market to support the product for a significant time. Given that Adafruit is carrying it, it's unlikely that Parallax would come up with another one. Keep in mind that Adafruit and SparkFun complement Parallax's offerings. Adafruit can support lower volumes than Parallax can and SparkFun really has gotten the breakout board thing down to where they can provide them cheaply for a long time and make enough money to keep doing it.
Sign In or Register to comment.