I2C Slave

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
jeffg
Posts: 5
Joined: Sat Sep 27, 2008 7:22 pm
Contact:

I2C Slave

Post by jeffg »

Hello,

I am working on a project with 2 PICs (16f877a) with I2C communication between both of them but it seems that Flowcode has only a master i2C component.

Has someone find a good code C to insert in a flowcode project ? Or any other solution ?

Thanks for your help,

Jeff

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Slave

Post by Benj »

Hello Jeff

Can you use RS232 instead? The I2C slave component for Flowcode is still a while off yet.

Mikat
Posts: 258
Joined: Wed Nov 29, 2006 6:32 pm
Location: Finland
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: I2C Slave

Post by Mikat »

Hello. I am too very interested that i2c slave mode,because i have already i2c omponent on my design,so it would be nice to have the pics communicate on same method...
Other thing is that i already have 2 custom component,so is it possible to modify the existing i2c component to work on slave mode,or use just
c code commands?

Mika

wim314
Posts: 12
Joined: Tue Dec 25, 2007 1:51 pm
Location: Belgium
Contact:

Re: I2C Slave

Post by wim314 »

I am also interested for one of my projects in the I2C slave functionality. When will it be available in flowcode? thanks, wim

georgesz113
Posts: 5
Joined: Tue Mar 10, 2009 12:52 pm
Contact:

Re: I2C Slave

Post by georgesz113 »

Hello,

Is there any news on I2C Slave module? Could you put up a beta component for this or tell me how I could connect two PICs using the I2C ports?

Many thanks,
George

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C Slave

Post by Benj »

Hello

Yes it would be possible to use the custom components to build your own slave I2C component.

Slave components are a little tricky as they have to be ready to react to incoming data which means careful planning of your program. This is why I prefare RS232 data as you can receive and respond to data pretty much whenever your ready as long as the baud rate is not too high. I2C or SPI slave devices are essentially dumb devices that can only ever sit on the bus and await instruction. Before you go down the path of making a I2C slave device you must be sure that this operation is what you are looking for.

Essentially all you need to do is to modify the I2C hardware commands so the peripheral is configured as a slave instead of a master. Alternativly you could create a bit banged slave routine similar to the software I2C master routines available in the current I2C component.

You can find more help on editing the Flowcode custom components from here.
http://www.matrixmultimedia.com/Flowcode_Components.php

Post Reply