Pin solution?

inglewoodpete

Senior Member
I bought a few MCP23017 chips a few years ago but have not used them yet. Most of my projects and prototypes are built on stripboard ("veroboard") and therein is the problem. I have found that it is easier to wire up (I/)O to 16-bin 74HC595 chips rather than the monster 28 pin MCP23017 chips.

No doubt there will be a project where I will need the additional features of the MCP23017 (true I/O, interrupts) but I think I'll need to use a custom-made 2-layer PCB to use it effectively.
 

Circuit

Senior Member
Hi,I saw these and thought handy for those pin hungry ideas. Anyone use one or similar?
Yes, a most useful expansion chip. I have just rigged two up on the same i2c line from a 20X2; this gives me 32 input/output lines. Reasonably easy to program and so far it works 100% reliably for me. But don't forget that the easiest way to add output lines is with an additional PICAXE chip and a serial link - I also use this approach sometimes and this is an easy and reliable approach with slightly easier programming - see http://www.picaxe.com/FAQs/Interfacing/

The other chip I use for expanding out makes use of Power Logic 8 bit Shift Registers such as the Texas Instruments TPIC6595. This has eight outputs capable of 250mA "each output, all outputs on" continuous current. Like other shift registers this has a serial out to allow daisy-chaining for more outputs.
 

Circuit

Senior Member
I bought a few MCP23017 chips a few years ago but have not used them yet. Most of my projects and prototypes are built on stripboard ("veroboard") and therein is the problem. I have found that it is easier to wire up (I/)O to 16-bin 74HC595 chips rather than the monster 28 pin MCP23017 chips.

No doubt there will be a project where I will need the additional features of the MCP23017 (true I/O, interrupts) but I think I'll need to use a custom-made 2-layer PCB to use it effectively.
Gosh, this surprises me! I find that the logical and sensible pin layout of the MCP23017 is what makes it so attractive and indeed very easy to use on Veroboard - which I also use predominantly. You have eight port pins in a row on each side, the address pins on one side and the serial interface on the other. This chip is VERY easy to use with Veroboard. Just pop a resistor network chip alongside the port pins and you are ready to go. A ULN2803A also lines up beautifully on either side. It really is a most useful and simple chip. Clearly, though, I do agree about the merits of the shift registers as well.

MCP23017.png
 
Last edited:

edmunds

Senior Member
I use PCA955x for this kind of thing. I try to get NXP versions, because I find their data sheets better, but TI is supposedly the same thing. Basically the same as MCP and once you get the first one right, using the next one is not much more trouble than writing to pins directly. They also have versions with programmable 'blinkers', where you can pulse a pin at some (not too fast) rate without picaxe returning to it except for starting it and stopping when no need to blink. I have found a number of model railroad projects made a lot simpler with this as programming a loop which blinks a LED at a constant frequency while handling a other things can become tricky if these other things can vary in the time they take.


Good luck,

Edmunds
 

lbenson

Senior Member
While we're at it, if you only need 8 additional I/Os, the MCP23008 does the trick and also aligns nicely with the ULN2803.
 

stan74

Senior Member
Nice one guys. I've used vero/srpb since a teen. It works fine for me. No capacitance or oscillation problems.
These io expanders are new to me,I've used shift registers to run a led display. These chips don't need polling.
I think using another picaxe as elegant but wasteful. Many on the forum would use a picaxe instead of a 555 or a clocked led driver for knight rider robot effect..you know who you are.
The pins will be connected to uln2803a..on vero. Glad it's been covered,I'll check the thread link.
 

westaust55

Moderator
Around the time of the first work I did using the MCP23017, I was looking at an 8x8 RGB LED matrix.
That equates to 192 LEDs to control.

Some test were done comparing bit bang and for the X1 parts the inbuilt SHIFTOUT driving 74HC595 versus i2c and the MCP23017.
I did post some timing details at that time and there was a marked improvement in each step/scheme between Big Bang, SHIFTOUT and i2c.
Two MCP23017 chips gave me 32 IO to drive the RGB matrix.
Bit slow with some flicker in those days with max speed of 8MHz but would go well with a 20X2 clocking at 64 MHz.
 

BESQUEUT

Senior Member
Around the time of the first work I did using the MCP23017, I was looking at an 8x8 RGB LED matrix.
That equates to 192 LEDs to control.

Some test were done comparing bit bang and for the X1 parts the inbuilt SHIFTOUT driving 74HC595 versus i2c and the MCP23017.
I did post some timing details at that time and there was a marked improvement in each step/scheme between Big Bang, SHIFTOUT and i2c.
Two MCP23017 chips gave me 32 IO to drive the RGB matrix.
Bit slow with some flicker in those days with max speed of 8MHz but would go well with a 20X2 clocking at 64 MHz.
If the only goal is to control RGB LEDs, you now can use "intelligent" LEDs strips, like APA102 and others...
 

stan74

Senior Member
I still don't know what bit bang means. I 1st saw life on a zx81 in assembler and immediately impressed by speed of animation and it using 1/4 character graphics ie rom print routines not screen ram addressing and screen manipulation and processing was done in the raster flyback period so cool.
I started converting a spectrum basic life program because it's simple. Everything is done in strings with the speccy. On a 28x2 using peek and a 128x64 oled but that would be slow at the pixel level so I'll try character size if the oled screen can be remapped so bytes are horizontal.
I wasn't particularly interested in driving leds more stepper motors,ir led arrays.Multiplexing and stuff one day maybe to make something pretty to keep. The kids got me this kit for xmas. https://www.youtube.com/watch?v=fCMcQ3G_wCY&feature=em-upload_owner atmega8...boo-hiss
 

hippy

Technical Support
Staff member
I still don't know what bit bang means.
Bit-banging / bit-bashing simply means controlling I/O under software control, rather than using hardware.

For example; "DO : TOGGLE C.2 : LOOP" bit-bangs a square wave out of C.2, where as PWMOUT uses on-chip hardware to generate its output.
 
Top