Hello everybody,
I want to expand the I/Os of the Raspberry with the following IO Expander(MCP23017).
I have created the „MCP23017.devdesc.xml“ and a libary „MCP23017.library“ file based on an copy of „SRF02.devdesc.xml“ und „I2C_SRF02.library“.
The Rasberry indentify the MCP23017 but I can´t access with Codesys and don´t know why!!
I think I fail because I didn´t use the right Parameters in “AfterReadInputs” and “BeforeWriteInputs” to activate the chip or port.
I send you some files and hope you can help me!
Maybe someone worked on MCP23017 and solved my problem already.
You have to add this declaration in your device configuration file if you like to use also BeforeWriteOutputs method:
I haven't deep dived in the MCP23017 device datasheet yet. But I saw imediately that you are using wrong device address in your lib. For MCP23017 you have to use 0x20, suppose you have A0-A2 low (usiAddress := 16#20;).
I hope this helps you further.
BR
Zdenko.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everybody,
I want to expand the I/Os of the Raspberry with the following IO Expander(MCP23017).
I have created the „MCP23017.devdesc.xml“ and a libary „MCP23017.library“ file based on an copy of „SRF02.devdesc.xml“ und „I2C_SRF02.library“.
The Rasberry indentify the MCP23017 but I can´t access with Codesys and don´t know why!!
I think I fail because I didn´t use the right Parameters in “AfterReadInputs” and “BeforeWriteInputs” to activate the chip or port.
I send you some files and hope you can help me!
Maybe someone worked on MCP23017 and solved my problem already.
thankfully
MCP23017.library [337.29 KiB]
MCP23017.devdesc.xml [2.35 KiB]
Hi,
Please look at this post for a good start:
l viewtopic.php?f=21&t=5744 l
You have to add this declaration in your device configuration file if you like to use also BeforeWriteOutputs method:
I haven't deep dived in the MCP23017 device datasheet yet. But I saw imediately that you are using wrong device address in your lib. For MCP23017 you have to use 0x20, suppose you have A0-A2 low (usiAddress := 16#20;).
I hope this helps you further.
BR
Zdenko.