EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

multiplexing two PWM signals to one pin

Started by vfraenc1 January 30, 2005

I am using a PIC 16F876 and need to multiplex two seperate signals to
one of the CCP inputs. What is the best way to do this?

Any enlightenment will be appreciated.

TIA

Vic




At the risk of sounding trite, a simple quad pack NAND IC
will do the trick.

This is assuming that you aren't trying to monitor the two
signals concurrently.

As there is no good way to show a schematic here, I suggest
that if you have a quad input pack (identified by 1,2,3,4), each
with two inputs (A,B) and one output (O1,02,03,04) you can
have the following connections:
A1= Select line from PIC for which line to monitor, (HI==>Input2)
B1= Select line from PIC for which line to monitor, (HI==>Input2)
O1= output of gate one.

A2= O1(the output of the gate above)
B2= Input1. One of the signals that you are monitoring
O2= output of gate two.

A3= Select line from PIC for which line to monitor, (HI==>Input2)
B3= Input1. The other signal that you are monitoring
O3= output of gate three.

A4= O2
B4= O3
O4= mulitplexed signal to CCP input of PIC.

So, by setting/clearing the select line from the PIC, the
signal from either Input1 or Input2 is selected and passed
to the CCP input of the PIC.

Of course, there are many variations on this theme, including
saving a nand gate by doing the inversion of the selection with
two outputs of the pic, etc, etc.

Assuming you have TTL inputs, something like a 74LS00 will do
the trick. There are a lot of logic families that you can use,
I picked the LS00 just because they are still readily available
on the surplus market. C00s, ALS00s, F00s are all candidates.

Hope that this helps!

Cheers,

Rich S.
--- In , "vfraenc1" <victorf@w...> wrote:
>
> I am using a PIC 16F876 and need to multiplex two seperate signals
to
> one of the CCP inputs. What is the best way to do this?
>
> Any enlightenment will be appreciated.
>
> TIA
>
> Vic




I just did this last week....

A nice simple way to do it, is to use a single 2-1 multiplexor chip.
I used a Texas Instruments SN74LVC2G157 which is an 8 pin surface
mount package - you could surely find a similar part in a DIP style if
you needed to.

I added a few decoupling caps and some pullups since my sources were
both open-drains. Other than that, nothing to it.

Jonny

--- In , "vfraenc1" <victorf@w...> wrote:
>
> I am using a PIC 16F876 and need to multiplex two seperate signals to
> one of the CCP inputs. What is the best way to do this?
>
> Any enlightenment will be appreciated.
>
> TIA
>
> Vic



2 pairs of resistor + diode could do,
if
- your current demands are not too high and
- you have enough voltage range and
- you can permit that onde iddle state = 0 and the other is 1
connect the resistors to the PWM out,
in series with each resitor a diode (one forward, one backward)
connect the other ends of the diodes to a select pin
and now you have both the PWM on each ot the diode - resistor connections
Stef Mientki

vfraenc1 wrote:

>I am using a PIC 16F876 and need to multiplex two seperate signals to
>one of the CCP inputs. What is the best way to do this?
>
>Any enlightenment will be appreciated.
>
>TIA
>
>Vic >to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
>Yahoo! Groups Links




The 2024 Embedded Online Conference