I am trying to connect a couple of PCA9534 IO port expanders via I2C to a PIC18F4321 and I am using the Flowcode Pro v3.6.11 to which I am fairly new but I am even newer to I2C.
The comm speed is not important and there's no need to get back any interrupts as all the expanded ports will most likely be configured as digital outputs to drive some relays and status LEDs.
The picture attached only shows a portion of the schematic, the second port expander hardware address is 110.
Can I get any help or sample flowcode to get a primer on using/configuring the I2C feature to be able to control these expanded outputs?
Any help is greatly appreciated so please reply with anything that can help me put together the thoughts behind the I2C configuration and communication structure.
The port expander datasheet http://focus.ti.com/lit/ds/symlink/pca9534a.pdf has some good advise but I am not sure of how to use that info in combination with the flowcode feature.
Here's a portion of the schematic:
I2C controlled port expansion
- 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 controlled port expansion
Hello
I2C follows a simple communications structure. If you go into the Flowcode V3 fodler then you will find the I2C.hlp file. The I2C read and write structure is detailed towards the bottom of this file.
Note that the first address you send should involve the I2C hardware address and should take account of the read / write bit.
Looking at the device datasheet and the I2C EEPROM example on the Flowcode Examples page should help with getting the communications working correctly.
http://www.matrixmultimedia.com/Flowcode_Examples.php
I2C follows a simple communications structure. If you go into the Flowcode V3 fodler then you will find the I2C.hlp file. The I2C read and write structure is detailed towards the bottom of this file.
Note that the first address you send should involve the I2C hardware address and should take account of the read / write bit.
Looking at the device datasheet and the I2C EEPROM example on the Flowcode Examples page should help with getting the communications working correctly.
http://www.matrixmultimedia.com/Flowcode_Examples.php
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
- Dan81
- Valued Contributor
- Posts: 268
- Joined: Sun Jan 15, 2006 4:07 pm
- Location: Albi France
- Been thanked: 60 times
- Contact:
Re: I2C controlled port expansion
Try this flowchart.
It is not tested (neither optimized).
Daniel
It is not tested (neither optimized).
Daniel
- Attachments
-
- i2c_forum.fcf
- (6.5 KiB) Downloaded 471 times
Re: I2C controlled port expansion
Thank you Ben and Dan81 for your prompt response.
I will give it a shot tonight and let you know about my progress.
This Flowcode is pretty exciting, I am glad to be aboard.
I will give it a shot tonight and let you know about my progress.
This Flowcode is pretty exciting, I am glad to be aboard.
