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

Search found 3 matches
CCS Forum Index
Author Message
  Topic: Multiple I2C channels
runemadsen

Replies: 12
Views: 37708

PostForum: General CCS C Discussion   Posted: Fri Aug 03, 2012 8:46 am   Subject: Multiple I2C channels
OK, I have fixed it.
In case others are interested here is what I did:

#use i2c(master,sda=PIN_C4, scl=PIN_C3,FORCE_SW,STREAM=ST1)
#use i2c(master,sda=PIN_C1, scl=PIN_C2,FORCE_SW,STRE ...
  Topic: Multiple I2C channels
runemadsen

Replies: 12
Views: 37708

PostForum: General CCS C Discussion   Posted: Fri Aug 03, 2012 8:05 am   Subject: Multiple I2C channels
Yes, but the stream must be a constant, not a variable.
Then I have to copy up the code for each stream, in my case at least five.
Is it a way to avoid that?

Rune
  Topic: Multiple I2C channels
runemadsen

Replies: 12
Views: 37708

PostForum: General CCS C Discussion   Posted: Fri Aug 03, 2012 7:48 am   Subject: Multiple I2C channels
I shall use some sensors with hardcoded and equal i2c addresses.

I therefore try to make up more i2c channels like this:

void select_sensor(int n){

if(n==1){
...
 
Page 1 of 1
All times are GMT - 6 Hours
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group