CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Max number of s/w I2C

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

Max number of s/w I2C
PostPosted: Tue Apr 27, 2021 10:55 am     Reply with quote

Is there a maximum number of software I2C channels with the compiler?
I'm thinking of using a single master with a bunch of I2C slave sensors but they don't have separate addresses.
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Apr 27, 2021 1:38 pm     Reply with quote

What about using chip select (CS)?

or this
https://learn.adafruit.com/adafruit-tca9548a-1-to-8-i2c-multiplexer-breakout/overview
This one will give you up to 64 I2C devices.
_________________
Google and Forum Search are some of your best tools!!!!


Last edited by dyeatman on Tue Apr 27, 2021 1:43 pm; edited 1 time in total
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Tue Apr 27, 2021 1:40 pm     Reply with quote

What do you mean?

I think you might be confusing I2C with SPI haha

But I think that multiplexer is along the lines of what I want.
temtronic



Joined: 01 Jul 2010
Posts: 9220
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Apr 27, 2021 2:05 pm     Reply with quote

Compiler shouldn't care about # of SW I2C

That mux is what I'd use, as it saves 14 I/O pins !!! but then there's a wee bit of PCB space you'll need.....and $ for the MUX.
Maybe write down the 'pros and cons'(cost,space, time,pins, codespace,??)
Jay
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Tue Apr 27, 2021 2:07 pm     Reply with quote

Thanks for the heads-up

However, this is going to be a one-off thing. Might even be just plugged into a solderless breadboard and put into a box.
Ttelmah



Joined: 11 Mar 2010
Posts: 19487

View user's profile Send private message

PostPosted: Wed Apr 28, 2021 3:07 am     Reply with quote

Yes, the multiplexer is a definite solution for this. It also means you don't
get the problem of increasing capacitance on the bus as the number of
sensors goes up.
The Adafruit board is based on the 9548. There are actually a number of
these multiplexers:

https://www.nxp.com/products/interfaces/ic-spi-serial-interface-devices/ic-multiplexers-switches:MC_41851

The devices have their own I2C address (3 pins set this), so you can have
a single I2C bus talking to (say) two of these, which then address up to 16
devices all using the same address. All you have to be careful of it that
you make sure that the I2C address these are using are different from each
other, and from the final target device. These use 0b1110xxxR for their
address. You send the multiplexor address byte, followed by a control
byte to say what bus to talk to. Be careful, the control bytes just has bits
to select which bus is enabled. So you can send a command to all eight
busses by turning all the bits on. This can be useful for configuration for
example, but you need to make sure you are only selecting a single bus
when you are expecting a reply!...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group