i2c device with no data register

New to XMOS and XCore? Get started here.
dimitris
Active Member
Posts: 37
Joined: Tue Feb 19, 2013 5:07 pm

i2c device with no data register

Post by dimitris »

Hi there,

I am trying to interface a BlinkM module over i2c on a slicekit device. (http://thingm.com/products/blinkm-maxm.html)
I checked that the XMOS i2c library uses functions that need both the device address and the data register address. However, BlinkM support denotes that "Not all I2C devices follow the memory register paradigm of I2C communication. Many devices adopt a serial byte-stream approach. This is the approach BlinkM adopted". I check the code they provide (mostly for Arduinos) and indeed there is no register address to write to.

I am wondering if this is a common thing and whether there is some workaround or do I have to implement a new function for the i2c library that allows for reading/writing data with only the device address available?

Once more, thank you in advance.

EDIT: In the i2c_master_write_reg there is a #ifndef I2C_NO_REGISTER_ADDRESS. Does this denote that it can be used without a register address?


User avatar
JasonWhiteman
Active Member
Posts: 63
Joined: Mon Jul 15, 2013 11:39 pm

Post by JasonWhiteman »

There are different viewpoints on how to master this subject. In my opinion, it is best to interface with parts that employ both methods. Try to write and read registers located at offset 0 and offset 5 (or some register with fixed, known values). If part is a memory storage device - try to store a value at different locations and read your value. Keep reading the same offset using your assumed correct method and see if you see the result as expected. If not, realize there are two methods - read the datasheet to start to understand more about what you're seeing.

Once you get a grip on the concept - you can usually figure out the method employed without a datasheet through reads and device stimuli (write).

The basic concept has application in certain architecture "BIOS" port access as well.

I'm not providing a "silver platter" answer because I feel you have the resources you need to get past this question on your own - with a slight nudge.

Down to the start/address/ack/data/stop level of I2C - there's really not too much to learn to master the I2C bus from both a signaling and "protocol" level. It may be useful to review the various waveforms that exist in I2C and what each looks like at the signal level. Datasheets of various parts can help here.

There's still an "aha" or two to discover when it comes to the relation of I2C and the device "interpretation" of I2C traffic. You'll get there.

Regards,
Jason Whiteman
dimitris
Active Member
Posts: 37
Joined: Tue Feb 19, 2013 5:07 pm

Post by dimitris »

Very late reply: There was a big "aha" as you suggested. :-)
Thankfully it came much earlier than this reply.
Thank you for your explanation!