Reply by roma October 21, 20052005-10-21
bw@baark.net (B1ackwater) wrote in news:434a62cb.6492746
@news.west.earthlink.net:

> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible. > Somewhere I heard of devices called 'sequencers' or something > like that where you just feed it a clock signal and it turns > on individual i/o pins in order and then wraps around to pin > zero again (or is reset with a third line - which would seem > better since you'd KNOW the thing would re-start on pin 0). > > Something like this would be ideal since it would only consume > three i/o pins on my controller. However, a quick google search > didn't reveal any such devices. Maybe I'm not using exactly the > right name for the things ? I'd heard of something like it for > scan-writing to those big 60-odd-pin LCD chips, but I'm > interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> > Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > > Any info helpful. Reply to group. > >
See what you can do with these circuits : http://members.shaw.ca/roma/switching-2.html roma
Reply by Jasen Betts October 12, 20052005-10-12
On 2005-10-10, Jim Granville <no.spam@designtools.co.nz> wrote:
> B1ackwater wrote: > > The HEF4021 can read 8 ips, and drive 3 ops, so you can matrix 24 > buttons on one of those. They are under 20c.
neat, with the addition of a 3-bit address decoder you could matrix 64 buttons without using any more uC pins than are needed to drive the HEF4021 Bye. Jasen
Reply by Jasen Betts October 12, 20052005-10-12
["Followup-To:" header set to sci.electronics.misc.]
On 2005-10-10, B1ackwater <bw@baark.net> wrote:

> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible. > Somewhere I heard of devices called 'sequencers' or something > like that where you just feed it a clock signal and it turns > on individual i/o pins in order and then wraps around to pin > zero again (or is reset with a third line - which would seem > better since you'd KNOW the thing would re-start on pin 0).
if it's an output it'd be a decade counter, one pin to advance the high signal, one pin to reset it to it starting place, 10 outputs, if you want to read try a parallel-in serial out shift register, typically 8 inputs one output pin, one pin so signal the chip to read the inputs, and one pin to get the next input, the also have an input whare you can attach the output of another shift register... so they can be daisy-chained (plugged into the back of each other) so you could line up 8 of them and read the whole 64 inputs only three pins on your micro. try 74HC165 if you can matrix your inputs you may be able to lower the chip count by using a decade counter to select rows and a single shift register to read columns - it'd use more i/o pins though Bye. Jasen
Reply by Don McKenzie October 10, 20052005-10-10
B1ackwater wrote:

> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible. > Somewhere I heard of devices called 'sequencers' or something > like that where you just feed it a clock signal and it turns > on individual i/o pins in order and then wraps around to pin > zero again (or is reset with a third line - which would seem > better since you'd KNOW the thing would re-start on pin 0). > > Something like this would be ideal since it would only consume > three i/o pins on my controller. However, a quick google search > didn't reveal any such devices. Maybe I'm not using exactly the > right name for the things ? I'd heard of something like it for > scan-writing to those big 60-odd-pin LCD chips, but I'm > interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> > Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > > Any info helpful. Reply to group.
have a look at: http://www.dontronics.com/pipex.html something I did with shift registers years ago, but it gives you the schematic and code examples, if you want to try shift registers. Don... -- Don McKenzie E-Mail Contact Page: http://www.e-dotcom.com/ecp.php?un=Dontronics Micro,TTL,USB to 1.5" color LCD http://www.dontronics.com/micro-lcd.html USB,RS232 or TTL to VGA Monitor http://www.dontronics.com/micro-vga.html World's smallest USB 2 TTL Conv http://www.dontronics.com/micro-usb.html
Reply by Jim Granville October 10, 20052005-10-10
B1ackwater wrote:

> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible. > Somewhere I heard of devices called 'sequencers' or something > like that where you just feed it a clock signal and it turns > on individual i/o pins in order and then wraps around to pin > zero again (or is reset with a third line - which would seem > better since you'd KNOW the thing would re-start on pin 0). > > Something like this would be ideal since it would only consume > three i/o pins on my controller. However, a quick google search > didn't reveal any such devices. Maybe I'm not using exactly the > right name for the things ? I'd heard of something like it for > scan-writing to those big 60-odd-pin LCD chips, but I'm > interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> > Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > > Any info helpful. Reply to group.
What you are looking for are called IO Expanders, or ShiftRegisters. See http://www.standardics.philips.com/products/shiftregisters/ Which one is best depends on price, component count, if the IO are distributed, noise immunity etc. Simple Logic Shift registers will be the lowest cost, but they need external pullups. They are also very easy to cascade and expand. PCF8574 series i2c IO expanders are convenient, but quite expensive. The HEF4021 can read 8 ips, and drive 3 ops, so you can matrix 24 buttons on one of those. They are under 20c. CPLD/SPLD can be used, but are more complex to deploy, so are best used if there is something special about the IO that means std shift registers will not be suitable. -jg
Reply by October 10, 20052005-10-10
On Monday, in article
     <434a62cb.6492746@news.west.earthlink.net> bw@baark.net
     "B1ackwater" wrote:

>An embedded project I'm working on requires the ability to >read the status of up to 64 input ports - but obviously I >want to use as few of my microcontroller pins as possible. >Somewhere I heard of devices called 'sequencers' or something >like that where you just feed it a clock signal and it turns >on individual i/o pins in order and then wraps around to pin >zero again (or is reset with a third line - which would seem >better since you'd KNOW the thing would re-start on pin 0).
Sounds like a shift register (parallel load serial output), mind you are you wanting to clock load all 64 bits at once, before shifting?
>Something like this would be ideal since it would only consume >three i/o pins on my controller. However, a quick google search >didn't reveal any such devices. Maybe I'm not using exactly the >right name for the things ? I'd heard of something like it for >scan-writing to those big 60-odd-pin LCD chips, but I'm >interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> >Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > >Any info helpful. Reply to group.
Another alternative SPI or I2C chips or PLD providing the 40 pin I/O but serial to micro. On I2C you can get chips like PCF8574(A) or PCF8575 that are 8bit and 16bit I2C I/O chips and only needs bit banging on two micro pins, and read bytes at a time. -- Paul Carpenter | paul@pcserviceselectronics.co.uk <http://www.pcserviceselectronics.co.uk/> PC Services <http://www.gnuh8.org.uk/> GNU H8 & mailing list info <http://www.badweb.org.uk/> For those web sites you hate
Reply by Spehro Pefhany October 10, 20052005-10-10
On Mon, 10 Oct 2005 23:54:40 +1000, the renowned Al Borowski
<al.borowski@EraseThis.gmail.com> wrote:

>Hi, > >B1ackwater wrote: >> An embedded project I'm working on requires the ability to >> read the status of up to 64 input ports - but obviously I >> want to use as few of my microcontroller pins as possible. > >Depending on volume, you could just program another cheap 40 pin uC to >handle the bulk of them. Its wasteful but easy :) > >Al
Sure, use a couple of those $1.47 LPC ARMs as peripherals for your PIC. ;-) Best regards, Spehro Pefhany -- "it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com
Reply by Rich Webb October 10, 20052005-10-10
On Mon, 10 Oct 2005 13:12:04 GMT, bw@baark.net (B1ackwater) wrote:

>An embedded project I'm working on requires the ability to >read the status of up to 64 input ports - but obviously I >want to use as few of my microcontroller pins as possible. >Somewhere I heard of devices called 'sequencers' or something >like that where you just feed it a clock signal and it turns >on individual i/o pins in order and then wraps around to pin >zero again (or is reset with a third line - which would seem >better since you'd KNOW the thing would re-start on pin 0). > >Something like this would be ideal since it would only consume >three i/o pins on my controller. However, a quick google search >didn't reveal any such devices. Maybe I'm not using exactly the >right name for the things ? I'd heard of something like it for >scan-writing to those big 60-odd-pin LCD chips, but I'm >interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> >Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > >Any info helpful. Reply to group.
Probably easiest to whip one together out of a small CPLD and a bit of HDL code. Something like an SPI interface where the uC sends a read request (where 3 of the 8 bits constitute an "address") and the CPLD replies with the values on the 8 input pins at that address. Very little overhead if the uC has a built-in SPI port and fairly straightforward on the CPLD side. Also give you random vice sequential access. -- Rich Webb Norfolk, VA
Reply by Al Borowski October 10, 20052005-10-10
Hi,

B1ackwater wrote:
> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible.
Depending on volume, you could just program another cheap 40 pin uC to handle the bulk of them. Its wasteful but easy :) Al
Reply by techie_alison October 10, 20052005-10-10
"B1ackwater" <bw@baark.net> wrote in message
news:434a62cb.6492746@news.west.earthlink.net...
> An embedded project I'm working on requires the ability to > read the status of up to 64 input ports - but obviously I > want to use as few of my microcontroller pins as possible. > Somewhere I heard of devices called 'sequencers' or something > like that where you just feed it a clock signal and it turns > on individual i/o pins in order and then wraps around to pin > zero again (or is reset with a third line - which would seem > better since you'd KNOW the thing would re-start on pin 0). > > Something like this would be ideal since it would only consume > three i/o pins on my controller. However, a quick google search > didn't reveal any such devices. Maybe I'm not using exactly the > right name for the things ? I'd heard of something like it for > scan-writing to those big 60-odd-pin LCD chips, but I'm > interested in READING a logic 0 or 1. Reset -> Read Pin 0 -> > Clock -> Read pin 1 -> repeat -> repeat -> repeat(N) -> reset. > > Any info helpful. Reply to group. >
Hello, The other way to do it would be to code another pic chip specifically meeting these requirements. ;-) I wonder if you mean a multiplexor, not sure here. I know what you're trying to achieve though. The trouble is that there's no robustness built into the circuit in the event of a misread if purely clocking a pin and dumping the contents of your output. Parallel wise it would take 6 bits to represent 64 (or 63 for those that refuse to accept 0 as a state). Tricky one. Currently wading through this site for my own purposes atm; http://www.kpsec.freeuk.com/components/74series.htm Good luck :-) Aly