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 support@ccsinfo.com

I2C Multi Master mode

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



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

I2C Multi Master mode
PostPosted: Wed Sep 16, 2009 3:37 am     Reply with quote

CCS PCH C Compiler, Version 4.011, 26184

I am curently trying to make I2C Multi Master mode work between a pic 18F6722 and an arm processor. Both state they do multi master and I have had some success.

Arm works as master and slave (Multimaster)
Pic works as master only (Multimaster mode)

When I enable the SSP and BUSCOL interrupts on the PIC for slave (multimaster) opperation I get a problem.

1st I issue a start, get an interrupt SSP1STAT = 0x88 but then the write hangs.
I then restart the pic (not the arm) and the start creates a bus collision.
SSP1STAT = 0x80 prior to the i2c_start and after the BUSCOL interrupt.

It works ok except for pic not being able to work in slave mode using interrupts with the interrupts dissabled.

I havn't posted any code because all I want to know is:-

What I would like to know is what actually does the MULTIMASTER setting in the #use i2c statement do ?

I assumed that if the pic does a start command then it enables the clock output. If it does a write statement without a start then it puts the data in the spi buffer to be clocked out by the other master!
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Wed Sep 16, 2009 4:01 am     Reply with quote

It's OK I worked out what the differences were myself. Didn't need to create a new project for it, just change the setting and looked at the .lst file without the #nolist setting.
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Sep 17, 2009 3:36 am     Reply with quote

I have just foud a problem with I2C MultiMaster mode with the PIC. From the datasheet :-

"SSPxADD register holds the slave device address when the MSSP is configured in I2C Slave mode. When the MSSP is configured in Master mode, the lower seven bits of SSPxADD act as the Baud Rate Generator reload value."

Does this mean that when just before I switch to master mode (send a start) I have to load this with the Baud rate reload value and after sending a stop load it with the slave address ?
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