Searching \ for 'Pin Multiplexing on the 16f84' 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/microchip/devices.htm?key=16F
Search entire site for: 'Pin Multiplexing on the 16f84'.

Truncated match.
PICList Thread
'Pin Multiplexing on the 16f84'
1999\03\01@063450 by Nuno Pedrosa

flavicon
face
Hi! I grew tired of trying to design a complex circuit that I would
never assemble for lack of time, and now I'm taking the cut-off
approach. The circuit must be simple. It's easier for me to change the
SW, than the HW.

I want to build a meter-counter. That's my main purpose.
I will use the 16f84, because I have no UV-Eraser.
I need 4 7Seg Displays. I don't want to handle LCDs for now.

Browsing through the app notes, I found basically what I needed.
The problem is, I'll need 12 pins to drive the displays. 8 for the data,
and 4 for the transistors. This leaves me with one pin to handle the
sensor input.
A keyboard will be connected to the 8 data pins.

I would like to handle more digital inputs and at least one A/D input.
Is there a simple way to do this, without adding too much HW? How much
more can I multiplex through this pins?

I know I could use a Shift Register to handle more I/Os. But that's for
later, and it will be another 16f84, using I2C. For now, I would like to
keep the chip count on 1. Resistors, caps and diodes can be more, if
needed.

How many pins do I need to handle an A/D converter with the 16f84?

Thanks for your help,
Nuno Pedrosa.
--
----  ~~~~~~~  -------  Nuno Filipe Freitas Pedrosa
--  ~~~~     ~~  -----  SIEMENS S.A. Portugal       TEL: +351 1 4242454
-  ~~~~       ~~  ----  spam_OUTNuno.PedrosaTakeThisOuTspamoen.siemens.de
-  ~~~~       ~~  ----  "MSWindows - Best run on a SlideShow"
=======================================================================

1999\03\01@074315 by paulb

flavicon
face
Nuno Pedrosa wrote:

> Browsing through the app notes, I found basically what I needed.
> The problem is, I'll need 12 pins to drive the displays.  8 for the
> data, and 4 for the transistors.
...
> I would like to handle more digital inputs and at least one A/D input.
> Is there a simple way to do this, without adding too much HW? How much
> more can I multiplex through this pins?

 Here I go again!  Drive the segments through resistors from 9 PIC
lines (or 8 if you don't need the DP).  Drive the digits via emitter
followers of appropriate sex (PNP if using dommon cathode displays, NPN
if common anode) from four of the same PIC lines; no resistor
necesssary.

 Another four lines can be used with diodes, to multiplex the keyboard
to the first four lines, so 9 lines has covered your 4-digit display
with DP and 16-key keyboard.

 You now have four (or 3¸ if you discount RA4) free lines to do
whatever else you will.  I suggest using them for IÓC and attaching an
ADC plus anything else you need.
--
 Cheers,
       Paul B.

1999\03\01@084635 by Nuno Pedrosa

flavicon
face
Wow! Too fast for me, here!

Let's say this:
7Seg + DP = 8 bits. So I'll just use Port B for this.

Now:
B7-B0 connect to the segments and DP through ~220R resistors.
B7-B4 connect to the NPN/PNP directly.

How do I connect to the keyboard?
The designs I saw, relied on the displays being disabled (or so I
thought) to mux the data lines.
Is it possible to drive 6 or 8 displays with this technique?

And what's the "trick" to drive the displays when the PNPs share the
same lines with the data?
Do you have a schematic with these connections?

Thank you,
Nuno.

Paul B. Webster VK2BZC wrote:
{Quote hidden}

--
----  ~~~~~~~  -------  Nuno Filipe Freitas Pedrosa
--  ~~~~     ~~  -----  SIEMENS S.A. Portugal       TEL: +351 1 4242454
-  ~~~~       ~~  ----  .....Nuno.PedrosaKILLspamspam@spam@oen.siemens.de        
-  ~~~~       ~~  ----  "MSWindows - Best run on a SlideShow"
=======================================================================

1999\03\01@095047 by paulb

flavicon
face
Nuno Pedrosa wrote:

> Wow! Too fast for me, here!

 I was being a bit provocative!

> Let's say this:
> 7Seg + DP = 8 bits. So I'll just use Port B for this.

 Yes, but if you include the DP, you'll need *nine* bits, so you still
have to use a bit of port A.

 I will for the present refer to common-anode displays with the anode
connected to the emitter of a NPN transistor whose collector is powered
by the unregulated supply of 9 to 12V or so.  This takes the load from
the main regulator.

> Now:
> B7-B0 connect to the segments and DP through ~220R resistors.

 B7 to B0 and *A0* actually.

> B7-B4 connect to the NPN/PNP directly.

 To the base of the NPN transistors.  Note that there is a trick!
Whichever line is used to drive the anode buffer transistor, obviously
cannot drive a segment cathode for this digit.  That's *why* you need A0
to do this, connected to a different segment on each display.

> How do I connect to the keyboard?

 The keyboard is connected with diodes from B0 to B3 (anodes to the PIC
pins) driving the columns, while rows drive diodes to B4 to B7.  The
diodes prevent (multiple) key closures from interfering with the LED
displays.

 Keyboard scanning is conventional; internal port B pull-ups are
enabled, B4 to B7 are pulled down in turn (otherwise set as inputs)
while B0 to B3 are examined as a group.  This is done as an extra phase
of the digit-by-digit multiplex sequence, and the inherent timing of the
multiplex facilitates debouncing.

> The designs I saw, relied on the displays being disabled (or so I
> thought) to mux the data lines.

 Displays are disabled when the anode drive line is tri-stated (set as
input) or pulled low.  Either way, no drive to transistor (except if
you leave the weak pull-up on).

> Is it possible to drive 6 or 8 displays with this technique?

 9 PIC lines will drive nine, 8 segment displays (but 1 in 9 multiplex
may get a little dim unless quality displays are used).  Requires nine
resistors and nine driver transistors.  This uses the pins fully, the
keyboard scan above makes use of vacant digit positions in this scheme.

> And what's the "trick" to drive the displays when the PNPs share the
> same lines with the data?

 Output low, drives a segment cathode (up to 8).  Output high, drives
a common anode (only one at a time, generally).  Output tri-state,
segment dark.

> Do you have a schematic with these connections?

 That's asking!  Someone else has I think, done it.
--
 Cheers,
       Paul B.

1999\03\01@111242 by Nuno Pedrosa

flavicon
face
Paul B. Webster VK2BZC wrote:
>   I was being a bit provocative!

That's allright. I forgive you. 8)

>   Yes, but if you include the DP, you'll need *nine* bits, so you still
> have to use a bit of port A.

Yes. Now I understood why, and...

{Quote hidden}

... it's simply _ingenuous_!!! I tend to forget that those PIC pins are
"Three"-States! 8)
This is a brilliant idea to save pins!

>   The keyboard is connected with diodes from B0 to B3 (anodes to the PIC
> pins) driving the columns, while rows drive diodes to B4 to B7.  The
> diodes prevent (multiple) key closures from interfering with the LED
> displays.

I still need to think a little more on _why_ the diodes prevent
interference.
As for the number of displays, correct me if I'm wrong, but the keyboard
rows (B4-B7) cannot drive the transistors, right? So, if I want the 16
keys keyboard, I'll have a maximum of 5 displays.
Or, I may opt for 4 displays and 8 Leds. It's flashier! 8)

Hum... If I used the R-Network approach for the keyboard, I could free
some lines to drive more displays/LEDS, and could even increase the
number of keys!! 8))))
(OPS! Complexity alert! I'm letting myself get carried away!)

This reminds me. Can I do an AD converter with just one pin?
Pin Output low discharges Cap.
Pin Input  scanned until Cap is charged.
Calibration would be done once, with a known Voltage.
How accurate could such an AD be?
And can I do this with any pin, or do I need to use the Schmitt-Trigger?

Thanx for the help!
Nuno Pedrosa.

{Quote hidden}

--
----  ~~~~~~~  -------  Nuno Filipe Freitas Pedrosa
--  ~~~~     ~~  -----  SIEMENS S.A. Portugal       TEL: +351 1 4242454
-  ~~~~       ~~  ----  Nuno.PedrosaspamKILLspamoen.siemens.de
-  ~~~~       ~~  ----  "MSWindows - Best run on a SlideShow"
=======================================================================

1999\03\01@170940 by Tony Nixon

flavicon
picon face
Nuno Pedrosa wrote:
> Do you have a schematic with these connections?

Check out Microchips AN529. I tried it and it works ok.

--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
** NEW PicNPro Programmer and Port Interface **

http://www.picnpoke.com
Email .....picnpokeKILLspamspam.....cdi.com.au

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