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

Revisiting I2C Slave, multiple addresses

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



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

Revisiting I2C Slave, multiple addresses
PostPosted: Tue Jan 19, 2010 12:48 pm     Reply with quote

Hi All. Last July I was asking about this and resolved it on a temporary basis, but now it has reared it's ugly head again. I am using the 18F6723 PIC to read 2 I2C addresses as slaves, but now I need to handle 3 slave addresses with the same pic. Looking at what Microchip has, they do not seem to have anything that can do more than two x I2C except by going up to the PIC24 line. But those devices do not have any onboard EEPROM! Seems strange. Anyway they are not suitable for that reason.

So, one obvious answer is to put 2 PICs on the board and get them to talk to one another. But before I give up on the one processor approach, I wonder if anyone has any other ideas. I have been told that doing software I2C for slave operation is not possible. And it also appeared that it is not possible to receive data from two addresses on the same set of I2C lines. Using STREAM?

Any help?

Thanks, Russ
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Jan 19, 2010 3:13 pm     Reply with quote

Quote:

I am using the 18F6723 PIC to read 2 I2C addresses as slaves, but now I
need to handle 3 slave addresses with the same pic.

Do you mean that you need to make 3 i2c slaves, on 3 separate i2c
busses, inside one PIC ? What do these slaves do ?
russk2txb



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

Revisiting I2C Slave, multiple addresses
PostPosted: Tue Jan 19, 2010 3:39 pm     Reply with quote

Hi again PCM Programmer. Yes, my job is to emulate three ePots that are I2C slaves, each with a different address. So with two MSSP units I can only emulate 2 of the ePots - unless someone here knows a way. PIC24 devices have more than two I2C channels, but they do not have EEPROM and they also only have 10 bit A/D and I need the 12 bits provided by PIC18.

I'm currently thinking I will have to use a second PIC. In that case I guess using software SPI would be a good way to synchronize.

Your thoughts?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Jan 19, 2010 4:11 pm     Reply with quote

The PIC24 I2C slave interface has an address masking option, that allows to accept multiple addresses.
russk2txb



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

Revisiting I2C Slave, multiple addresses
PostPosted: Wed Jan 20, 2010 2:45 pm     Reply with quote

FvM, ok on the address masking. I have studied the Microchip data sheets and cannot be sure I am correctly understanding how address masking works. It appears that when you set an address mask, the chip will respond to any address in the mask range, as one would expect. But I do not see any way for the programmer to determine which address in the range was matched. Without that capability it is of no use to me.

Can you tell me if the above is correct, or am I missing something?

Thanks, Russ
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Jan 20, 2010 3:24 pm     Reply with quote

Quote:
Can you tell me if the above is correct, or am I missing something?

The latter. You may want to read the PIC24F Family Reference Manual I2C chapter more thoroughly to understand
the device operation. Generally, address data are transferred to the receive buffer and can be checked by your application.
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