IO Extender with MCP23017 & MCP23S17 issues [SOLVED]

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

IO Extender with MCP23017 & MCP23S17 issues [SOLVED]

Post by karthickefy »

Hi Matrix Team,
I would like say thanks to you guys for added MCP23017 & MCP23S17 modules in Flowcode8. I have tried with both I2C and SPI (MCP23017 & MCP23S17) demo boards, both are not working. MCU is ATMEGA128A. I have attached my code here. I didn't see any error/Warning while compile. please advice.

Note: I just leave it "INTA,INTB" pins as open.

Karthick.
Attachments
MCP23017.fcfx
(8.52 KiB) Downloaded 189 times
MCP23S17.fcfx
(8.69 KiB) Downloaded 192 times

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: IO Extender with MCP23017 & MCP23S17 issues

Post by Benj »

Hello Karthick,

Many thanks for letting us know.

I've just looked at the component again and I had accidentally put the register addresses in decimal instead of hex. All seems to be working fine now. You can get the latest fixes now by using the Help -> check for updates menu.

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: IO Extender with MCP23017 & MCP23S17 issues

Post by karthickefy »

Dear Ben,
Thanks. Even now I can control only PA0 and PB0 ports in 23017 . Other ports are still not working. Please see the logic analyzer screen shot. I switch each port ever 10ms. Even I have tried individually by port by port,but no output. Please advice.
Also I have tested the SPI 23S17 component and the result is same phenomenon as I2C ? Also I didn't see the external slave address option in component property window for MCP23S17. Please help to check.Thanks
Attachments
MCP23S17 all port.fcfx
(10.06 KiB) Downloaded 204 times
MCP23017 with flowcode.PNG
(106.67 KiB) Downloaded 1343 times
MCP23017 all port.fcfx
(9.78 KiB) Downloaded 189 times

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: IO Extender with MCP23017 & MCP23S17 issues

Post by Benj »

Aha, many thanks for letting us know. I've spotted an additional bug in the WritePortPin macro when using a pin greater than pin0, I was testing previously using the WritePort macro which is working correctly.

The updated components should now be available and hopefully should all be fixed now.
Also I didn't see the external slave address option in component property window for MCP23S17. Please help to check.
I've now added this and added a 9th option for don't use if you don't wish the addressing to be switched on.

Let us know how you're getting on.

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: IO Extender with MCP23017 & MCP23S17 issues

Post by karthickefy »

HI Ben,
Thanks . All the ports are working now other than PB7. I checked with 2 demo MCP23S17 PCBA's. I just tested only SPI. I will test I2C tomorrow. :D
Attachments
MCP23S17 all port.fcfx
(10.06 KiB) Downloaded 199 times
MCP23S17 with flowcode.PNG
(44.58 KiB) Downloaded 1328 times

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: IO Extender with MCP23017 & MCP23S17 issues

Post by Benj »

Many thanks for letting me know.

Port B pin 7 is working well for me with the SPI version (port write and pin write) so maybe check your connections are ok? Strange for two boards to have the same problem? Hmm.

Could it be anything to do with your pull ups that you are enabling? To enable pull ups on all port pins use the value 255 in the parameters for the function.

karthickefy
Posts: 74
Joined: Thu Nov 30, 2017 3:21 am
Has thanked: 4 times
Been thanked: 9 times
Contact:

Re: IO Extender with MCP23017 & MCP23S17 issues

Post by karthickefy »

Dear Ben,
Now both SPI and I2C (MCP23017 & MCP23S17 ) Flowcode8 modules is working perfectly. Finally I found the solderability issues on my SPI demo board. Now both boards are (MCP23017 & MCP23S17 ) working fine. Thanks for your help. :D

Post Reply