View previous topic :: View next topic |
Author |
Message |
jharkins Guest
|
Adding lots of I/O to a PIC |
Posted: Sat Jan 04, 2003 6:12 pm |
|
|
My hardware needs a lot of switch inputs. Nothing fast, response on the order to 50 ms or more should be fine. The switches won't change very often either, maybe once a minute.
Philips has an I/O expander that connects to an I2C bus and adds 16 bits. I need about 40 bits total. Anyone know of a way to add about 40 bits to a PIC without using 3 I/O expander chips, or resorting to a largish FPGA? The I2C bus is ideal as I'm already using all the pins on an 18f452 for other stuff.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10420 |
|
|
Lance Lascari Guest
|
Re: Adding lots of I/O to a PIC |
Posted: Sat Jan 04, 2003 6:28 pm |
|
|
I tend to like to use shift register based designs for slow-i/o, often with manual (software) spi type interfaces. 74hc165 might be worth looking at. You can chain as many of these as you want together, poll them at whatever rate makes sense.
-Lance
:=My hardware needs a lot of switch inputs. Nothing fast, response on the order to 50 ms or more should be fine. The switches won't change very often either, maybe once a minute.
:=
:=Philips has an I/O expander that connects to an I2C bus and adds 16 bits. I need about 40 bits total. Anyone know of a way to add about 40 bits to a PIC without using 3 I/O expander chips, or resorting to a largish FPGA? The I2C bus is ideal as I'm already using all the pins on an 18f452 for other stuff.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10421 |
|
|
Charlie U Guest
|
Re: Adding lots of I/O to a PIC |
Posted: Sun Jan 05, 2003 9:41 am |
|
|
:=My hardware needs a lot of switch inputs. Nothing fast, response on the order to 50 ms or more should be fine. The switches won't change very often either, maybe once a minute.
:=
:=Philips has an I/O expander that connects to an I2C bus and adds 16 bits. I need about 40 bits total. Anyone know of a way to add about 40 bits to a PIC without using 3 I/O expander chips, or resorting to a largish FPGA? The I2C bus is ideal as I'm already using all the pins on an 18f452 for other stuff.
Have you considered a scanned array of switches? Configure the switches in an array that has 5 columns and 8 rows, for example. The switches are at the cross points of the array and when closed, connect a column to a row. The basic concept is to drive one of the columns and read the rows, then drive the next column and read the rows, etc. To implement this scheme, you might try an additional small PIC that can operate as an I2C slave and just let it scan the switches. You could use the weak pull ups on the PIC to pull the inputs high and then have the column outputs idle high and drive low to scan. If you will ever have multiple switches closed at one time, you might consider current limiting series resistors, or just switch the idle outputs to inputs.
Melabs has a schematic of one of the proto boards on their website. They have a scanned array of 16 switches on a port. See the link below.
Give this a thought and let us know what you come up with.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10427 |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: Adding lots of I/O to a PIC |
Posted: Sun Jan 05, 2003 9:18 pm |
|
|
Use the 74165 for the inputs and 74595 for the outputs
Regards
Mark
:=I tend to like to use shift register based designs for slow-i/o, often with manual (software) spi type interfaces. 74hc165 might be worth looking at. You can chain as many of these as you want together, poll them at whatever rate makes sense.
:=
:=-Lance
:=
:=
:=:=My hardware needs a lot of switch inputs. Nothing fast, response on the order to 50 ms or more should be fine. The switches won't change very often either, maybe once a minute.
:=:=
:=:=Philips has an I/O expander that connects to an I2C bus and adds 16 bits. I need about 40 bits total. Anyone know of a way to add about 40 bits to a PIC without using 3 I/O expander chips, or resorting to a largish FPGA? The I2C bus is ideal as I'm already using all the pins on an 18f452 for other stuff.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10443 |
|
|
Douglas Kennedy
Joined: 07 Sep 2003 Posts: 755 Location: Florida
|
port expansion |
Posted: Mon Jan 06, 2003 9:07 pm |
|
|
An 82C55 will expand an 8 bit port by 3
___________________________
This message was ported from CCS's old forum
Original Post ID: 10489 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Adding lots of I/O to a PIC |
Posted: Tue Jan 07, 2003 1:06 pm |
|
|
:=Use the 74165 for the inputs and 74595 for the outputs
:=
---------------------------------------------------------
CCS has example files for doing this:
EX_EXPIO.C
74165.C
74595.C
___________________________
This message was ported from CCS's old forum
Original Post ID: 10513 |
|
|
John Yaron Guest
|
Re: Adding lots of I/O to a PIC |
Posted: Tue Jan 07, 2003 1:11 pm |
|
|
:=My hardware needs a lot of switch inputs. Nothing fast, response on the order to 50 ms or more should be fine. The switches won't change very often either, maybe once a minute.
:=
:=Philips has an I/O expander that connects to an I2C bus and adds 16 bits. I need about 40 bits total. Anyone know of a way to add about 40 bits to a PIC without using 3 I/O expander chips, or resorting to a largish FPGA? The I2C bus is ideal as I'm already using all the pins on an 18f452 for other stuff.
Resistor array and analog input
___________________________
This message was ported from CCS's old forum
Original Post ID: 10514 |
|
|
Steve H Guest
|
New Microchip Product |
Posted: Wed Jan 08, 2003 9:10 am |
|
|
Microchip is sampling a new I2C I/O Expander: MPC23016.
I found it on their website by searching for I/O Expander.
Steve H.
___________________________
This message was ported from CCS's old forum
Original Post ID: 10537 |
|
|
|