Page 1 of 1

Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Sun Feb 19, 2017 4:00 am
by cortex
Hi i've been trying to figure out my mistake for a while now, but i just can't seems to hit a solution.

My Setup

I have an arduino UNO hooked up to a MCP23017 through SDA and SCL pins.
On the MCP23017 i have 8 LED from GPA21 to GPA28 of the MCP.
I know my setup is right as when i compile my code through the arduino IDE, i have the LEDs to lite up according to the data i passed through.

My issue is that i can not reproduce this with my flowchart.
My component address is 0x20 and the register's address on which the LED are is 0x12.

Therefore i used the Initialise Macro, followed by the SendByteTransaction Macro with the following values:
Devide_ID: 0x20
AddrH:0x00
AddrL:0x12
Data:170

After compiling nothing happens. What is most puzzling is that i have a logic analyzer hook to SCL and SDA pins. When compiling with arduino IDE the signals shows but when compiling in Flowcode i have no signal showing up on the bus.

Can anyone help me figure out what i am missing ?

thanks*

Re: Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Mon Feb 20, 2017 12:11 pm
by Benj
Hello,

It looks like the SendByteTransaction won't work with the MCP23017 device as the device has only one address byte, rather then the 2 used by the transaction macro.

Here's a slightly different version of your program that hopefully should work correctly.
Arduino MCP23017.fcfx
(7.48 KiB) Downloaded 434 times

Re: Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Mon Feb 20, 2017 12:54 pm
by cortex
Hi benj,

Thank you for your quick reply.

I will look into the file as soon as i get home. :)

Re: Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Wed Mar 01, 2017 4:12 pm
by cortex
Hi Benj,

I could finally get back to it.

I tried the new flowchart, unfortunatly it still does not work.
I'm stuck as the data showed in the console when simulating is consistent with the protocol of the MCP23017.
So it should work, but it does not.

The setup still works when compiling using the Arduino IDE.

In another Topic related to the MCP23017 (but with PIC) you mentioned to disable "Extended CPU" i can't seem to find this option for Arduino chip in flowcode.

Could it be the answer ?

Re: Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Sat Mar 04, 2017 8:02 am
by cortex
Hi Benj,

Sorry for the late reply I thought I had already given the feedback.

The new flowchart does not work either although in the simulation it seems to send the right commands.
Today I received a logical signal analyzer, I ll look into it later.

Re: Flowcode I2C + Arduino UNO + MCP23017 I/O

Posted: Sat Mar 04, 2017 8:39 am
by EtsDriver
cortex wrote:,

Sorry for the late reply I thought I had already given the feedback.

Hi, for some reason your earlier message was not showing up on waiting for moderation. Sorry for inconvience it might have caused.