Chip to Sequentially Read Many Inputs ?
Electronics Forum Index Electronics
Circuits, theory, electrons and discussions.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ElectronicsHelp.net
Chip to Sequentially Read Many Inputs ?

 
Post new topic   Reply to topic    Electronics Forum Index -> Electronics General
Author Message
B1ackwater
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Chip to Sequentially Read Many Inputs ? Reply with quote

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.

Back to top
Paul Carpenter
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

On Monday, in article
<434a62cb.6492746@news.west.earthlink.net> bw@baark.net
"B1ackwater" wrote:

Quote:
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?

Quote:
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
Back to top
techie_alison
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

"B1ackwater" <bw@baark.net> wrote in message
news:434a62cb.6492746@news.west.earthlink.net...
Quote:
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

Back to top
Geoff Field
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

There's a common 4000-series chip (4060?) that's a parallel-to-serial
converter. Basically, you can connect your parallel inputs into one of the
8 input lines, latch the input and simply clock the data through on a
synchronous serial line. There's a complementary chip that does outputs.
You can chain as many of these as you like together. The only real problem
is that the more inputs/outputs you have, the longer a single operation will
take.

Geoff


B1ackwater wrote:
Quote:
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.


--
Geoff Field
Professional Geek,
Amateur Stage-Levelling Gauge
Back to top
Spehro Pefhany
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

On Mon, 10 Oct 2005 13:12:04 GMT, the renowned bw@baark.net
(B1ackwater) wrote:

Quote:
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.

A 64:1 multiplexer will likely take a few chips to implement, probably
from 8:1 muxes and a bit of glue logic.

It takes 6 bits to address 64 inputs (ln(64)/ln(2) if you must)--
so a 6 bit counter will do you. You could use a 74HC4040 ripple
counter (12 bits) which would address 4096 inputs. That will require
only 3 port pins, perhaps less if you use other tricks, but probably
at least 10 chips.

Another, perhaps more attractive, approach could be to use a
parallel-in, serial out 64-bit shift register (say made from 8 chips
eg. 74HC165). You would use one port pin for the data, one for the
clock, and one for the load signal. This has the advantage of sampling
every input virtually simultaneously, requires no glue logic, and
still only requires 3 port pins. Instead of bit-banging the clock and
data signals, you may be able to use available SPI bus hardware to
read the inputs at relatively high speed.


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
Back to top
Noel Henson
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

B1ackwater wrote:

Quote:
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.

You can use eight 74HC165 pallel-in/serial-out shift registers. You can
control it with just three pins, if you like.

Noel
Back to top
Al Borowski
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

Hi,

B1ackwater wrote:
Quote:
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
Back to top
Spehro Pefhany
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

On Mon, 10 Oct 2005 23:54:40 +1000, the renowned Al Borowski
<al.borowski@EraseThis.gmail.com> wrote:

Quote:
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
Back to top
Rich Webb
Guest





Posted: Mon Oct 10, 2005 4:35 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

On Mon, 10 Oct 2005 13:12:04 GMT, bw@baark.net (B1ackwater) wrote:

Quote:
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
Back to top
Jim Granville
Guest





Posted: Tue Oct 11, 2005 12:35 am    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

B1ackwater wrote:

Quote:
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
Back to top
Don McKenzie
Guest





Posted: Tue Oct 11, 2005 12:35 am    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

B1ackwater wrote:

Quote:
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
Back to top
Jasen Betts
Guest





Posted: Wed Oct 12, 2005 4:28 pm    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

["Followup-To:" header set to sci.electronics.misc.]
On 2005-10-10, B1ackwater <bw@baark.net> wrote:

Quote:
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
Back to top
Jasen Betts
Guest





Posted: Thu Oct 13, 2005 12:32 am    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

On 2005-10-10, Jim Granville <no.spam@designtools.co.nz> wrote:
Quote:
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
Back to top
roma
Guest





Posted: Sat Oct 22, 2005 12:35 am    Post subject: Re: Chip to Sequentially Read Many Inputs ? Reply with quote

bw@baark.net (B1ackwater) wrote in news:434a62cb.6492746
@news.west.earthlink.net:

Quote:
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
Back to top
 
Post new topic   Reply to topic    Electronics Forum Index -> Electronics General All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Home & Living New Topics
Contact Us
Powered by phpBB