Good day!
I have a prototype with several modules, each containing a PIC micro-controller. The whole system is controlled by a central module, yes, another PIC. All the PIC's are wired to a single I2C bus.
I would like to set the PIC in the 'central module' as a Master, and all the surrounding modules as Slaves.
I've seen a lot of I2C Flowcode examples for PIC's communicating with eeproms and sensory modules, but none concerning two PIC's. Maybe I couldn't find the article?
What would be the best Protocol to use when sending data between the Master and a Slaves? I've come-up with the following:
1. Master sends slave address onto I2C bus.
2. All slaves are listening, so the slave with matching address prepares for incoming data.
3. Master sends data.
4. Slave sends data.
5. Steps 3 & 4 are repeated several times as the PIC's exchange information.
6. Process ends, all Slaves return to 'listening'.
I'm not exactly sure how to work the ACK's and NACK's, what would be the best approach to setting-up the blocks in Flowcode?
I'm using Flowcode V3
Any advice appreciated!
Thanks,
Ed
I2C PIC-to-PIC
- 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 PIC-to-PIC
Hello Ed,
I think this is the topic you are looking for.
http://www.matrixmultimedia.com/mmforum ... ave#p17145
The specific protocol is really up to you but the one you are currently implementing looks quite good.
I think this is the topic you are looking for.
http://www.matrixmultimedia.com/mmforum ... ave#p17145
The specific protocol is really up to you but the one you are currently implementing looks quite good.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel