Searching \ for '[EE]: Which is the ideal IC?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=which+ideal
Search entire site for: 'Which is the ideal IC?'.

Exact match. Not showing close matches.
PICList Thread
'[EE]: Which is the ideal IC?'
2001\12\10@061959 by Bala Chandar

flavicon
face
In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A as
inputs to detect the closing of 9 PB switches. The PIC used is 16F628 with
internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has a
4.7K pull-up resistor.

As I am running short of I/O pins, I want to use an IC to reduce the number
of pins used by the PIC for detecting key pressings. After a  search through
CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal for
the purpose. With this IC, I will need only 4 pins of the PIC and as many as
5 pins will become available.

Now, my question: Is there a better IC for the purpose?
Please let me know if there is.

Thanks & Regards,
Bala

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@090332 by Tim McDonough

flavicon
face
If you are willing to periodically poll the keyboard an
inexpensive and reliable solution is to use 4021 CMOS shift
registers to connect switch inputs. They require a clock, strobe,
and data connection to the microcontroller. If you read the shift
register inputs every 100mS a human will generally not be able to
detect that their keypress was not instantly recognized.

To read the inputs the strobe signal is asserted to latch the
data on the inputs. Then the clock line is used to shift the data
bits out to the micro one at a time until all have been read. The
4021 also has a serial input so you can cascade the devices
together and add as many digital inputs as required in groups of
8.

Tim

{Original Message removed}

2001\12\10@093106 by Roman Black

flavicon
face
Bala Chandar wrote:
>
> In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A as
> inputs to detect the closing of 9 PB switches. The PIC used is 16F628 with
> internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has a
> 4.7K pull-up resistor.
>
> As I am running short of I/O pins, I want to use an IC to reduce the number
> of pins used by the PIC for detecting key pressings. After a  search through
> CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal for
> the purpose. With this IC, I will need only 4 pins of the PIC and as many as
> 5 pins will become available.


Why use a chip? I have one circuit running
16 independant dipswitches, a 7 seg display
and 2 input/output pins on a 16F84 which only
has 13 IO pins, no other chips needed. Exactly
how many things do you need to connect??
-Roman

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@111314 by as=22?=

flavicon
face
What about expand the inputs via a I2C device?

What about this:
www.semiconductors.philips.com/acrobat/datasheets/PCF8575_3.pdf
(16-bit) it can make a interrupt for you also when a key is pressed (change
of state on input pin)!

Or: www.semiconductors.philips.com/acrobat/datasheets/PCF8574_2.pdf
(8-bit)

Best regards

Ole Andreas Gløersen
LA9SHA




-----Opprinnelig melding-----
Fra: Bala Chandar [spam_OUTBala.ChandarTakeThisOuTspamAVENTIS.COM]
Sendt: 10. desember 2001 12:12
Til: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU
Emne: Re: [EE]: Which is the ideal IC?


In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A as
inputs to detect the closing of 9 PB switches. The PIC used is 16F628 with
internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has a
4.7K pull-up resistor.

As I am running short of I/O pins, I want to use an IC to reduce the number
of pins used by the PIC for detecting key pressings. After a  search through
CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal for
the purpose. With this IC, I will need only 4 pins of the PIC and as many as
5 pins will become available.

Now, my question: Is there a better IC for the purpose?
Please let me know if there is.

Thanks & Regards,
Bala

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@132438 by Jeff DeMaagd

flavicon
face
At 01:24 AM 12/11/01 +1100, Roman wrote:

>Why use a chip? I have one circuit running
>16 independent dip switches, a 7 seg. display
>and 2 input/output pins on a 16F84 which only
>has 13 IO pins, no other chips needed. Exactly
>how many things do you need to connect??
>-Roman

Can you post a generalized schematic of this?

I know tricks can be done but it seems aggravating to use them, but maybe
you have something else going here.

Jeff

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@141622 by hadirian

flavicon
face
Try MAX1608 (Serial to parallel and parallel to serial).



                   Bala Chandar
                   <Bala.Chandar@AV        To:     PICLISTspamKILLspamMITVMA.MIT.EDU
                   ENTIS.COM>              cc:
                   Sent by: pic            Subject:     Re: [EE]: Which is the ideal IC?
                   microcontroller
                   discussion list
                   <PICLIST@MITVMA.
                   MIT.EDU>


                   11/12/01 00:11
                   Please respond
                   to pic
                   microcontroller
                   discussion list






In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A as
inputs to detect the closing of 9 PB switches. The PIC used is 16F628 with
internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has a
4.7K pull-up resistor.

As I am running short of I/O pins, I want to use an IC to reduce the number
of pins used by the PIC for detecting key pressings. After a  search
through
CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal for
the purpose. With this IC, I will need only 4 pins of the PIC and as many
as
5 pins will become available.

Now, my question: Is there a better IC for the purpose?
Please let me know if there is.

Thanks & Regards,
Bala

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@154832 by Jinx

face picon face
> In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A
> as inputs to detect the closing of 9 PB switches. The PIC used is
> 16F628 with

The 74HC165 (parallel-serial) works OK for up to 8 and takes just
3 pins. I've also tried and used the 74HC251 and 4051 multiplexers

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\10@170118 by uter van ooijen & floortje hanneman

picon face
> In my circuit, I am using all the 8 pins of Port B and pin 6 of Port A as
> inputs to detect the closing of 9 PB switches. The PIC used is 16F628 with
> internal RC Oscillator. Port B weak pull-up is enabled and PortA.6 has a
> 4.7K pull-up resistor.
>
> As I am running short of I/O pins, I want to use an IC to reduce the
number
> of pins used by the PIC for detecting key pressings. After a  search
through
> CMOS data book, I found 74HC147 (10 to 4 Priority Encoder) almost ideal
for
> the purpose. With this IC, I will need only 4 pins of the PIC and as many
as
> 5 pins will become available.
>
> Now, my question: Is there a better IC for the purpose?
> Please let me know if there is.

Yes, the PIC that you already use. N I/O lines can be used to detect N *
( N - 1 ) switches. The details are somewhere of Stef's pages I posted a
summary afew days ago I think on comp.arch.embedded:

Take N lines, each with a pull-up resistor (or pull-down, suit to your
taste). Make a self-matrix, so you have N^2 cross-points. Except for
the diagonal (where a line matches with itself) put a switch and a
diode in series between the two crossing lines. Now to detect a
particular switch closure: make in trurn all lines but one input, the
one is a low output (or high for pull-own R's). Only one slected low
output will pull one input low. Note: does NOT work well with multiple
switches closed! Can probably be simplified with only one diode per
line instead of one per switch.

Someone commented that with one diode per switch multiple switches closed
can be detected,
and that one diode per I/O is sufficient when multiple switch closure need
not be corretly detected.

Wouter van Ooijen

Van Ooijen Technische Informatica: http://www.voti.nl
Jal compiler for PIC uC's:  http://www.voti.nl/jal

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\12\11@015049 by Bala Chandar

flavicon
face
Thanks a lot to all those who responded to my query with helpful tips. Now I
know that there are many ways of solving the problem, each with its own
advantages - PISO shift registers, software, special chips from Philips &
Maxim, matrix with diodes, etc.

As you would all agree, when you use microcontrollers, the ideal solution
would be to accomplish as much as possible through software and minimize
cost and component count. Viewed from this angle, Roman's suggestion sounds
very interesting as well as intriguing! How did he manage to all that
without any extra chips?

Roman Black wrote:
"I have one circuit running
 - 16 independent dipswitches
 - a 7 seg display
 - 2 input/output pins
on a 16F84 which only  has 13 IO pins,
no other chips needed. Exactly
how many things do you need to connect?"

Wow! That's brilliant, Roman. Must be a highly complex piece of code.

My circuit has the following:
  - 9 PB Switches
  - 8 Relays (Driven by a 5841)
  - 1 7-Seg display including the Dec.Point (Driven by a 74HC595)
  - 2 Inputs for zero crossing signal & data from power line
  - 1 I/O for a DS1820
  - 2 Outputs for Data & Clock combined with outputs for Red & Green LEDs
  - 2 Strobe outputs for 5841 & 74HC595
  - 1 Output for an Orange LED

I am using the internal oscillator of the 16F628 and MCLR is used as an
input pin. So, all the 16 I/O pins are being used.

Roman, your suggestions please.

Regards,
Bala

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\12\11@062244 by Vasile Surducan

flavicon
face
On Tue, 11 Dec 2001, Bala Chandar wrote:

{Quote hidden}

I don't think so. The switches are sure connected in matrix.
Pull up enabled. Resistors to minimise current in display
so no light must be seen when the button are pressed.
There are at least three or four application note at Microchip
on this theme:
.../Download/Appnote/Category/16C5X/00529e.pdf
.../Download/Appnote/Category/16CXX/00557c.pdf
I hope will help you.

Vasile

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2001\12\11@072435 by Roman Black

flavicon
face
Jeff DeMaagd wrote:
>
> At 01:24 AM 12/11/01 +1100, Roman wrote:
>
> >Why use a chip? I have one circuit running
> >16 independent dip switches, a 7 seg. display
> >and 2 input/output pins on a 16F84 which only
> >has 13 IO pins, no other chips needed. Exactly
> >how many things do you need to connect??
> >-Roman
>
> Can you post a generalized schematic of this?
>
> I know tricks can be done but it seems aggravating to use them, but maybe
> you have something else going here.



Hi Jeff, I posted the circuit at:
http://centauri.ezy.net.au/~fastvid/pic_16sw.gif

No "tricks" needed other than one diode
for each switch. I used 1N4148 diodes at
less than 2c US each in the quantity we
bought for the product. Product is now obsolete
so I don't mind showing how we connected so
much to a small PIC. Much cheaper and probably
more reliable than adding another chip to
give more I/O ports.

The switches are individually addressable!
This is what the diodes do, so any number of
switches can be on at once, unlike some simple
matrix setups. It just scans the switches in
a 4x4 diode-ed matrix.
-Roman

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2001\12\11@090928 by Roman Black

flavicon
face
Bala Chandar wrote:

> As you would all agree, when you use microcontrollers, the ideal solution
> would be to accomplish as much as possible through software and minimize
> cost and component count.

> My circuit has the following:
>    - 9 PB Switches
>    - 8 Relays (Driven by a 5841)
>    - 1 7-Seg display including the Dec.Point (Driven by a 74HC595)
>    - 2 Inputs for zero crossing signal & data from power line
>    - 1 I/O for a DS1820
>    - 2 Outputs for Data & Clock combined with outputs for Red & Green LEDs
>    - 2 Strobe outputs for 5841 & 74HC595
>    - 1 Output for an Orange LED
>
> I am using the internal oscillator of the 16F628 and MCLR is used as an
> input pin. So, all the 16 I/O pins are being used.
>
> Roman, your suggestions please.


Hi Bala, I didn't claim to do anything magic,
just that it worked without needing another
chip. :o)

What you require above is an interesting
challenge. You have 27 separate signals that
you want to connect to 16 pins? Wow.
You already have a few chips in the circuit,
in your case it may be more work trying to
do it without extra chip. More work than
it's worth? :o)
-Roman

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\11@232201 by Bala Chandar

flavicon
face
Vasile Surducan wrote:

> There are at least three or four application note at Microchip
> on this theme:
> .../Download/Appnote/Category/16C5X/00529e.pdf
> .../Download/Appnote/Category/16CXX/00557c.pdf
> I hope will help you.

Thanks, Vasile.

I had a look at the application notes. They are quite informative and
provide lots of ideas to extract the maximum performance from the PICs.

Browsing the application notes in Microchip CD teaches you many tricks about
PICs and can be a rewarding experience.

Regards,
Bala

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\12\12@121823 by Roman Black

flavicon
face
Kübek Tony wrote:
>
> Hi,
>
> a bit 'off-topic' but if it would have been an PIC with a/d
> then it's very easy to decode x number of keys ( there x is depedning on
> number of bits in ad and cost for resistor ladder, but 16 keys
> is a breeze with any resistors and 8 bit a/d ) with 1 pin :)
> or perhaps 2 pins + some logic to have an additional 'key-down' detection.
>
> Anyone interested  ?


With an R:2R ladder you can use each switch
as a binary bit. This is a very clever idea
Tony, if you have a R:2R resistor network in
a SIL package.

But 16 switches is 16 bits! You won't sense
that with an 8-bit ADC.

I think about 6 switches giving 64 dc levels
might be a limit depending on resistor
tolerances?

But still that would be 3 PIC pins for 18
switches, pretty impressive.
-Roman

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\12\12@140805 by Paul Hutchinson

flavicon
face
I think Tony meant a voltage divider network of resistors with the switches
selectively shorting out the divider.

Theoretically you could have 256 switches on one A/D input with this method.
This could work iff you calibrated the system very carefully and used low
tempco resistors and voltage reference.

From a practical standpoint you should be able to accommodate 64 switches
without needing precision components and careful calibration. I haven't done
the math so 64 switches might be troublesome but, 16 or 32 switches should
be a piece of cake.

Paul Hutchinson

{Quote hidden}

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestspamBeGonespammitvma.mit.edu


2001\12\13@011205 by Bala Chandar

flavicon
face
Roman Black wrote:

> Hi Bala, I didn't claim to do anything magic,
> just that it worked without needing another
> chip. :o)
>
> What you require above is an interesting
> challenge. You have 27 separate signals that
> you want to connect to 16 pins? Wow.
> You already have a few chips in the circuit,
> in your case it may be more work trying to
> do it without extra chip. More work than
> it's worth? :o)

Hi Roman,

I forgot to mention that the circuit (with all the PB switches, relays,
DS1820, LEDs, etc.) in the breadboard stage is working satisfactorily. As
you have mentioned, there are already extra chips (5841 & 74HC595) to
provide additional outputs.

Since I wanted to add a couple of features, I was looking for ways of
getting extra I/O pins.

I like the suggestion by Tim McDonough of using 4021 that will give 8
inputs. (74HC165 can also be used, I think, as it looks a functional
equivalent of 4021.) Since I already have two pins working as common Clock
and Data outputs, I can use them for 4021 as Clock and Load outputs. This
means, by using only one pin to receive the serial data, I can get 8
additional inputs.

Thanks for your '16 PB switches + diodes + 7Seg Disp' circuit you have put
up in your site. It will be very useful in a different project of mine.

Regards,
Bala

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\13@015002 by Tim McDonough

flavicon
face
----- Original Message -----
From: "Bala Chandar" <TakeThisOuTBala.ChandarEraseMEspamspam_OUTAVENTIS.COM>
To: <RemoveMEPICLISTspamTakeThisOuTMITVMA.MIT.EDU>
Sent: Wednesday, December 12, 2001 11:01 PM
Subject: Re: [EE]: Which is the ideal IC?


> I like the suggestion by Tim McDonough of using 4021 that will
give 8
> inputs. (74HC165 can also be used, I think, as it looks a
functional
> equivalent of 4021.) Since I already have two pins working as
common Clock
> and Data outputs, I can use them for 4021 as Clock and Load
outputs. This
> means, by using only one pin to receive the serial data, I can
get 8
> additional inputs.

You can save the additional pin by putting the 4021/74HC165 and
your output shift registers all in the same, serial chain. This
can also add a bit of a safety feature: if the data to be output
is shifted around the ring and back into the processor you can
check in software to make sure it didn't get mangled by noise,
transients, etc. BEFORE you strobe it to the output latches.

A few years back I used this technique in an 8052 based system
that had 64 inputs and 32 outputs. The data can be read/written
in very little time.

Tim

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\13@053336 by Vasile Surducan

flavicon
face
On Wed, 12 Dec 2001, Bala Chandar wrote:

> Roman Black wrote:
>
> > Hi Bala, I didn't claim to do anything magic,
> > just that it worked without needing another
> > chip. :o)
> >
> > What you require above is an interesting
> > challenge. You have 27 separate signals that
> > you want to connect to 16 pins? Wow.

   I don't want to be crude, BUT you may connect almost all directly to
the chip with a good hw design. Not 27 but probably 20...25.
Think a little, you don't have too many LEDs? One bicolour led ( two pic
pins ) could signalise a lot of states with different colours/blinking
modes.Why you need 7 seg AND leds ? Can't you do it only on 7seg display ?
9 buttons AND 8 relays coud be connected on 6+1 pic pins using a
simple 3 to 8 decoder and a 3 x 3 matrix for buttons. That +1 pin is
available also for other jobs. I don't remember exactly your input
requested parameters but often when you need serial/parallel extra devices
is definitely the sign you must change to another microcontroller.
( excep designs dealing with dosens of relays and thousents of leds )
regards,
Vasile

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\13@065146 by Bala Chandar

flavicon
face
Hi Vasile,

I welcome your comments on improving the design of my circuit.

> Why you need 7 seg AND leds ? Can't you do it only on
> 7seg display ?

The 7-segment display (red color) is to constantly display a number. Even
the decimal point is used as a separate LED indicator. The other two LEDs
(red & green) are required to indicate key press and mode changes.

> 9 buttons AND 8 relays coud be connected on 6+1 pic pins using a
> simple 3 to 8 decoder and a 3 x 3 matrix for buttons. That +1 pin is
> available also for other jobs.
Well, driving the 8 relays with 3 to 8 decoder would mean using two chips
since I have to also use a relay driver like ULN2803. Instead, I have used
UCN5841A (from Allegro), which combines a serial-in parallel-out shift
register and relay driver for 8 relays. This requires 3 pins, but two of
them are also used by the other shift register.
>  ... often when you need serial/parallel
> extra devices is definitely the sign you must change
> to another microcontroller. ( excep designs dealing
> with dosens of relays and thousents of leds )

I agree. In fact I have been seriously thinking of using 16F870 (28 pin
skinny DIP) instead of 16F628 for this project. I get 22 I/O pins and more
importantly, I can try out Kübek Tony's nice suggestion of using A to D
converter and only one pin to detect closing of 8 or more PB switches; the
added advantage being that there will be only 3 wires connecting the main
PCB and the keypad.

Like it happens to many others, my problem is that I conceive the design,
write the code and make the circuit in the breadboard stage work as
expected. Then new ideas flash in the mind. The design is modified, code is
rewritten and new features are added. The wonderful people on this list with
their suggestions greatly contribute to this process. This goes on for a
while. When the ideas for the project dry up, the order for the PCB is
placed!

Regards,

Bala

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\12\14@140008 by Dwayne Reid

flavicon
face
At 11:01 PM 12/12/01 -0600, Bala Chandar wrote:

>I like the suggestion by Tim McDonough of using 4021 that will give 8
>inputs. (74HC165 can also be used, I think, as it looks a functional
>equivalent of 4021.) Since I already have two pins working as common Clock
>and Data outputs, I can use them for 4021 as Clock and Load outputs. This
>means, by using only one pin to receive the serial data, I can get 8
>additional inputs.

You can avoid using that extra pin by using the data pin used to talk to
the output SRs as an input pin.  Just add a single 10K resistor in series
with the data out pin of the 4021 and feed the serial data pin on the
PIC.  Set the pin as input, read the 4021, set the pin as output, write the
output SRs, assert strobe.

I do this in most of my products: 3 pins to talk to all my SR based inputs
and outputs.  Add 1 more pin if I am also talking to my watchdog chip of
choice (Xicor X25043).

dwayne



Dwayne Reid   <dwaynerEraseMEspam.....planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 17 years of Engineering Innovation (1984 - 2001)

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\12\16@172836 by Alexandre Domingos F. Souza

flavicon
face
>> a bit 'off-topic' but if it would have been an PIC with a/d
>> then it's very easy to decode x number of keys ( there x is depedning on
>> number of bits in ad and cost for resistor ladder, but 16 keys
>> is a breeze with any resistors and 8 bit a/d ) with 1 pin :)
>> or perhaps 2 pins + some logic to have an additional 'key-down' detection.
>With an R:2R ladder you can use each switch
>as a binary bit. This is a very clever idea
>Tony, if you have a R:2R resistor network in
>a SIL package.

       Isn't the same in resistive touch screen devices? ;o)


---8<---Corte aqui---8<----

Alexandre Souza
EraseMEtaitospamterra.com.br
http://planeta.terra.com.br/lazer/pinball/

---8<---Corte aqui---8<----

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2001\12\18@045014 by Bala Chandar

flavicon
face
Hi Dwayne,

Thanks for the nice suggestion that enables me to save one more I/O pin.

Incidentally, in my experiments with the 4021, I found a method to use the
IC for 9 PB switches instead of only 8. The sequence is like this:

(The inputs of 4021 for the 9 switches are connected +5V through pull-up
resistors. When a PB switch is pressed, the corresponding input goes low.)

Connect switches 1 - 8 to P7 - P0 input pins of 4021 respectively.
Connect switch 9 to pin 11 (Serial Data In) of 4021.

1. Make pin 9 (PL input of 4021) high to parallel load the
   8 input bits into the shift register. Make pin 9 low again.
2. If pin 3 (output of the last stage) is low, switch 1 has been
   pressed; take appropriate action.
3. Serially shift 8 bits one by one and check each bit.
   If a bit is low, it means the corresponding switch (one of the remaining

   switches from 2 to 9) has been pressed; take appropriate action.
4. Go to step No.1.

This may be helpful to those who are not already aware of it.

Regards,
Bala

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...