I am a newbie when it comes to electronics, but because of some things I'm being exposed to at work, I've grown a bit of an interest. I was given a Cognimem CM1K chip on a board, which is essentially a 1024-node neural network on a chip. They have software for Java and .Net, and I'm interested in using it on Linux/Mac OS X with Python or C if possible.

I bought a USB to I2C adapter and saw on the Cognimem chip's documentation that is supports I2C. What are some ways to get started? I was thinking just to begin by reading some basic values from the chip.

What are some things to take into consideration? How do I write code to first interact with the USB I2C adapter, then out over I2C to (in general terms) the connected device? Thank you.

  • \$\begingroup\$ That's a very interesting piece of hardware you have there. \$\endgroup\$ Commented Oct 27, 2012 at 1:04

1 Answer 1


Ok so the first thing you need to do before you write a SINGLE line of code is to thoroughly understand the I2C Protocol. I have worked with Serial, I2C and many more protocols. You will rip your hair out if you tackle the problem by trying to code your way through it.

Basically what I2C allows is, communication to 2^(bits) devices. So if you have 8-bit addressing that would allow communication of 2^8 = 256 devices each with their unique addresses on just 2 wires. This is where the name I2C (two wire interface) comes from.

The idea is, you hook up some peripheral device such as a sensor to your CM1K's I2C pins known as a 'slave' (the master is the CM1K).

enter image description here

Lets say the master needs to read data from a specific slave. In the real world if you wanted to talk to someone you would naturally yell out their name ("Hey Mike") and then the conversation would begin. In a similar fashion the master would broadcast the address along with a read/write bit to ALL slaves and wait for a response. I have taken this image below from the CM1K's hardware datasheet. This diagram outlines exactly how a single byte of data can be read from a particular slave.

enter image description here

So basically what you need to do is to grab that datasheet and read the entire chapter on I2C. Keep in mind I2C has 4 ways of communication read, write, burst read and burst write.

Hope this helps.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.