I2C subaddress Question
Burritoe
Posts: 5
Hello everyone.
Let me introduce myself.· My name is Andy, and I am becoming a prop-a-holic.
I spent my last Saturday with a new prop·demo board I think its called (the one with the white little proto board) playing around learning spin and writing from scratch a driver for a 8 by 2 line lcd just to learn the basics.· I liked it so much, I ordered a supply of prop proto boards.
I played with I2C years ago, but used a pc printer port, and frankly dont remember much about it.· So I've been reading posts and such freshing up this last week on the topic.· So think I got a basic understanding of how to implement and use it.
Ok heres my question/plea for advise
I wish to use 2 identical I2C devices on the same bus as slaves, with the prop being the third device and the master.· My understanding is that they are going to have the same slave address.· I need to assign each one a unique sub address, which the devices seem to support.
At this point my idea is to hold one in a reset state while assigning the first one a sub address.· Then of course releasing the reset, and issue the second one its sub address, which the first one should ignore.
Any Ideas, or comments, or did I miss anything?
Thanks in advance for any comments, Andy
P.S.
It also seems as far as pin count goes on the prop side, I could junk the idea connecting the prop chip to the reset lines and just use 2 different I2C busses out the prop chip.· Due to the fact I am exploring the devices themselves, I choose not to go this route, as I may wish to reset them to change operation modes.
Of course the highest priority is pin count at prop side of things, as any remaining pins will be used to communicate out.
·
Let me introduce myself.· My name is Andy, and I am becoming a prop-a-holic.
I spent my last Saturday with a new prop·demo board I think its called (the one with the white little proto board) playing around learning spin and writing from scratch a driver for a 8 by 2 line lcd just to learn the basics.· I liked it so much, I ordered a supply of prop proto boards.
I played with I2C years ago, but used a pc printer port, and frankly dont remember much about it.· So I've been reading posts and such freshing up this last week on the topic.· So think I got a basic understanding of how to implement and use it.
Ok heres my question/plea for advise
I wish to use 2 identical I2C devices on the same bus as slaves, with the prop being the third device and the master.· My understanding is that they are going to have the same slave address.· I need to assign each one a unique sub address, which the devices seem to support.
At this point my idea is to hold one in a reset state while assigning the first one a sub address.· Then of course releasing the reset, and issue the second one its sub address, which the first one should ignore.
Any Ideas, or comments, or did I miss anything?
Thanks in advance for any comments, Andy
P.S.
It also seems as far as pin count goes on the prop side, I could junk the idea connecting the prop chip to the reset lines and just use 2 different I2C busses out the prop chip.· Due to the fact I am exploring the devices themselves, I choose not to go this route, as I may wish to reset them to change operation modes.
Of course the highest priority is pin count at prop side of things, as any remaining pins will be used to communicate out.
·
Comments
Thank you for your reply.
What I am seeing in the data sheet is
write mode
[noparse][[/noparse]Start condition] [noparse][[/noparse]7-bit slave address][noparse][[/noparse]0][noparse][[/noparse]Ack][noparse][[/noparse]8 bit sub address][noparse][[/noparse]Ack]......
maybe what I am seeing in the 8 bit sub address is really the register address then?
in that case, I see no other option but to have 2 I2C busses.
I think·my problem came from·both a mis-understanding the terminalogy of the data sheet in addition to a mis-understanding of the i2c protocol.
Thank you for your help.
Edit -- additional below
Now I see that first ack must come from somewhere.....ha.· even before the sub address is sent....ding the bell has rung.
What device is this? Can you post link to the datasheet? I've generally seen where most I2C devices let you either A) set the slave address by wiring actual pins on the device high/low, as Mike described, or the master needs to send a special command string to the slave device WHEN IT IS THE ONLY DEVICE ON THE BUS to change it's address. The latter I generally see in "micro" based slave devices, i.e., a PIC or the like that's been pre-programmed as an I2C slave. If that is the case with your devices, just socket them on them a single bus -- pop one of them out to set the address. Then pop the other one in (and the first one out) to change it's address. Then you'll be ready w/both on the same bus.
A few devices do not allow you to the change address in any way. If that is really the case here, then yes, you'll need two busses.
Datasheet? Device name?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
I wish to control the operating modes of these camera i2c devices.
The image data is a seperate 8 bit bus, the i2c side is for setting of a boat-load of registers.
The data sheet is a 30 page long pdf,·and I dont wish to break anything my first day here.
The devices are TCM8240MD 1300x1040 cameras.
the pdf info has the slave address as
·a6 a5 a4 a3 a2 a1 a0 r/w
·0·· 1·· 1·· 1· 1·· 0·· 1 1/0
7bit slave address.
So I think its pretty much fixed.
btw: I am not planning to try to fit that massive amount of image data from 2 of these in the prop chip.....
EDIT: --add
the pdf is hosted on sparkfun site....just google·tcm8240md.pdf if your eyes widen and have to look....
Post Edited (Burritoe) : 5/24/2008 9:27:11 PM GMT
[noparse][[/noparse]8 bit sub address] = Register Address to Read/Write
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nothing is impossible, there are only different degrees of difficulty.
Sapieha
Full datasheet: www.sparkfun.com/datasheets/Sensors/Imaging/TCM8240MD.pdf
P.S. -- "7bit slave address" -- generally all I2C devices (with normal addressing) have 7bit addresses, with the lowest bit reserved for letting the device know if the operation is to be a write or a read. So an address of 0xA0 is the same device as 0xA1; 0xB8 is the same device as 0xB9, etc. In short, I2C addresses are generally even numbers...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 5/25/2008 1:44:19 AM GMT