MCP23017 GPIO PIN CONFIGURATION
Posted: 08 Jun 2017, 10:40
Hi,
MY DESIGN
In my project i used MCP23017 and i connected 8 switches from port 1 to 8, and i connected relay driver ULN2003 to drive 12v relay from the port 9 to 16. The hardware am using is ESP-12E with espeasy firmware 2.0.10 (latest). ESP-12E I2C is GPIO4 and GPIO5
PROBLEM
1. Relay connected with MCP will not respond as quick when i pressed the switch.
OBSERVATION
I checked the source of the firmware and came to a conclusion that, i have to configure 9-16 as OUTPUT.
REQUEST
So, I request everyone to help me
1. to configure MCP 1 - 8 PORT as INPUT and 9 to 16 as OUTPUT.
2. how to make MCP GPIOs respond as fast i press the switch
REFERENCES
ESPEASY Rules
On SW1#Switch=1 do
If [RL1#Switch]=1
mcpgpio,9,0
else
mcpgpio,9,1
Endif
Endon
On SW2#Switch=1 do
If [RL2#Switch]=1
mcpgpio,10,0
else
mcpgpio,10,1
Endif
Endon
On SW3#Switch=1 do
If [RL3#Switch]=1
mcpgpio,11,0
else
mcpgpio,11,1
Endif
Endon
On SW4#Switch=1 do
If [RL4#Switch]=1
mcpgpio,12,0
else
mcpgpio,12,1
Endif
Endon
On SW5#Switch=1 do
If [RL5#Switch]=1
mcpgpio,13,0
else
mcpgpio,13,1
Endif
Endon
//-END of RULES-
ESPEasy Devices
Task : 1
Device : Switch input - MCP23017
Name : SW1
Port : 1
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
.
.
Task : 5
Device : Switch input - MCP23017
Name : SW5
Port : 5
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
Task : 6
Device : Switch input - MCP23017
Name : RL1
Port : 9
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
.
.
Task : 10
Device : Switch input - MCP23017
Name : RL1
Port : 13
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
//-END OF DEVICE LIST-
MY DESIGN
In my project i used MCP23017 and i connected 8 switches from port 1 to 8, and i connected relay driver ULN2003 to drive 12v relay from the port 9 to 16. The hardware am using is ESP-12E with espeasy firmware 2.0.10 (latest). ESP-12E I2C is GPIO4 and GPIO5
PROBLEM
1. Relay connected with MCP will not respond as quick when i pressed the switch.
OBSERVATION
I checked the source of the firmware and came to a conclusion that, i have to configure 9-16 as OUTPUT.
REQUEST
So, I request everyone to help me
1. to configure MCP 1 - 8 PORT as INPUT and 9 to 16 as OUTPUT.
2. how to make MCP GPIOs respond as fast i press the switch
REFERENCES
ESPEASY Rules
On SW1#Switch=1 do
If [RL1#Switch]=1
mcpgpio,9,0
else
mcpgpio,9,1
Endif
Endon
On SW2#Switch=1 do
If [RL2#Switch]=1
mcpgpio,10,0
else
mcpgpio,10,1
Endif
Endon
On SW3#Switch=1 do
If [RL3#Switch]=1
mcpgpio,11,0
else
mcpgpio,11,1
Endif
Endon
On SW4#Switch=1 do
If [RL4#Switch]=1
mcpgpio,12,0
else
mcpgpio,12,1
Endif
Endon
On SW5#Switch=1 do
If [RL5#Switch]=1
mcpgpio,13,0
else
mcpgpio,13,1
Endif
Endon
//-END of RULES-
ESPEasy Devices
Task : 1
Device : Switch input - MCP23017
Name : SW1
Port : 1
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
.
.
Task : 5
Device : Switch input - MCP23017
Name : SW5
Port : 5
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
Task : 6
Device : Switch input - MCP23017
Name : RL1
Port : 9
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
.
.
Task : 10
Device : Switch input - MCP23017
Name : RL1
Port : 13
GPIO: GPIO-4 GPIO-5
Values: Switch: 0
//-END OF DEVICE LIST-