Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
21-03-2014, 11:29 PM,
#1
Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Hi

In the 979 version of the IDE added support for the Microchip MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander.

I added library MCP23017.c and MCP23S17.c for 32bit Pinguino boards.


Bye Bye, Moreno
Reply
26-03-2014, 09:51 PM,
#2
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Great. Thank you Moreno !

(21-03-2014, 11:29 PM)moreno Wrote: Hi

In the 979 version of the IDE added support for the Microchip MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander.

I added library MCP23017.c and MCP23S17.c for 32bit Pinguino boards.


Bye Bye, Moreno
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
27-03-2014, 09:29 AM,
#3
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Hi

Nothing, is only my little contribution.


Bye Bye, Moreno
Reply
27-03-2014, 11:17 AM,
#4
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
I saw you placed the examples in 04.Communication but as these devices have an i2c interface can you move them into the 04.Communication/i2c directory ?
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
27-03-2014, 03:24 PM,
#5
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Hi

The problem is which the test program use both I2C and SPI interface.

I think is better prepare two test program, one for MCP23017 and I2C and another for MCP23S17 and SPI.


Bye Bye, Moreno
Reply
27-03-2014, 04:25 PM,
#6
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Hi

OK Done.

Created MCP23017-I2C_IO_Expander.pde in I2C folder and MCP23S17-SPI_IO_Expander.pde in SPI folder.


Bye Bye, Moreno
Reply
27-03-2014, 05:36 PM,
#7
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
That's perfect. Thank you.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
05-07-2014, 08:03 AM,
#8
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
HI IT WORK!!!

My first IO Board with MCP23017 work PERFECTLY!!!

Is an 8In + 8 Out board not isolated but isolable adding a I2C Bus isolator SI8602AC.

Is the first time I use PMOS power mosfet, are very cheap and robust.
It can work until 12A but are not short circuit protect, for this I added a ripristinable fuse.

The most artistic parts are the Input connected directly to the MCP23017 pin.
I used TVS diode 1SMB9.0AT3G to cut the voltage and ensure a steep on-off transition around 16 volts.


The board work very well and I can flash the leds at 500Hz without problems.



Bye Bye, Moreno


Attached Files Thumbnail(s)
   
Reply
06-07-2014, 06:03 PM,
#9
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Moreno,

You must be having fun with the project. I have a few comments on the interface circuit.

1) The 'artistic' input can cause input latchup by transient spike and the clamping diode may not be sufficient to prevent it. When it happens, all input is stuck closed and power down reset is the only way to recover (not just reset). Many designs use opto-coupler to isolate the input, but it didn't really work for me for input from relay contact. The only way to stop the latchup was adding a simple RC filter. 1k in series and 0.1u parallel just before the GPIO input is good enough to stop the spike triggered by piezo ignition (possibly a few kV). This will also help debounce the input jittery. Series resistor before the pullup is not necessary, or best without to ensure the pull down the io voltage to ground.

2) You must be using ULN2003 to invert the input to PMOS? Unless common ground with individual positive output is required, or need higher current than ULN2003 can supply, I'd rather go with ULN2003 output for simplicity, especially LED output. But I guess this circuit is meant to be more of the general purpose. ULN2003 is wonderful part to drive the relays with high current and also built-in clamping diode.

3) When you use an FEP to drive LED, it is a good practice to check the input capacitance value. Some FEP has high CI and the speed turning on can be somewhat delayed and the LED output can be dimmer than expected. If there is no current limiting resistor at the input, it may not be much problem.

DJ
Reply
06-07-2014, 08:33 PM, (This post was last modified: 06-07-2014, 08:35 PM by moreno.)
#10
RE: Support for MCP23017 MCP23S17 I2C - SPI 16 bit IO Expander
Hi

1) There is an RC filter in the input (in the pictures the capacitors are not mounted, (I must decide the correct value), the circuit is LED + DIODE + TVS + R2,2k C ??, R define the input current at 24Volt.
The IC pin is not connected directly but through a 20kohm resistor to limit the clamp diode current. Optionally I can add an other TVS diode directly to the input pin, in dangerous situation I use SMBJ5.0CA-TR 5 volt bidirectional TVS, it survive at all, can dissipate about 600W in few nS.


2) The problem of PMOS is which require a negative VGS voltage, my VCC is 24Volt, to do this I use 2 resistors mounted as divider, when put to GND the resistor the PMOS go ON.
But when the circuit is open the voltage on the resistor is 24Volt, the poor device can't survive.
The ULN2003 is the only 8 port driver I know and it can work until 60Volt and is very cheap, less expensive than a 7407 six OC driver


3) Ehm, sorry what is a FEP ??
I checked the output signal on a PMOS blinking at 500Hz (with and without load) and is a good square wave.


Bye Bye, Moreno
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)