True digital mux, not switch?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
KrJo_1049446
Level 2
Level 2
5 sign-ins Welcome! 5 replies posted

I'm trying to mux together the 4 outputs of a UDB PWM on a PSoC5LP, and I could've sworn there was a way to do it with a single component. But the digital mux is only a switch; it won't let you mix multiple inputs. The analog mux component can be configured to mix or switch, but I'm not using analog signals, so that won't work.

I tried just connecting the PWM outputs together, but it gives me a "multiple drivers on one signal" error.

I suppose I could use a bunch of OR gates, but is there a single component that can do what I need?

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi KrJo_1049446,

Summing up all the responses here is the most suitable alternative to your question on using a single converter instead of 4 pulse converters.

pastedImage_0.png

Regards

Alakananda

Alakananda

View solution in original post

0 Likes
6 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi KrJo_1049446​,

Can you please share your schematic so that we can understand which 4 output signals you are trying to mix?

Can you provide your application so that we can suggest an alternative?

Regards,

Alakananda

Alakananda
0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Krjo,

The digital outputs are normally should be joined through some logic elements (XOR, OR, etc.), else circuit may be shorted. If you trying to sum PWMs for analog output, they can be connected externally using resistors (in parallel). Please make clear what is the goal of summing PWMs.

/odissey1

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Is this something you'd like to try?

You can control by writing like...

Control_Reg_Write(1) ;

Control_Reg_Write(2) ;

Control_Reg_Write(4) ;

Control_Reg_Write(8) ;

Control_Reg_Write(3) ;

Control_Reg_Write(15) ;

000-schematic.JPG

At least it was compile-able.

moto

This is very close to what I need. I think replacing the second and third stages of AND gates with OR will do it.

Thanks for your comment!

KrJo_1049446
Level 2
Level 2
5 sign-ins Welcome! 5 replies posted

I'm investigating alternate ways to drive a stepper motor controller.

I am curious if it would be possible to change the number of pulses in a PWM interval without modifying the PWM settings.

Being able to do this digitally would allow a lot of control, while simplifying the control mechanism.

I was able to find a PWM config that outputs rising edges with (almost) equal time between them.

Controlling each output allows 1-4 pulses per interval, with (I assume) less delay than changing the PWM and input clock settings.

I already added independent control of the outputs with 4 AND gates and a Control Register.

If the 4 outputs could be muxed together, a single Pulse Converter could be used, instead of the 4 separate ones I'm using now.

PWM_waveform.jpg

You can see the rising edges on each output of the PWM are (almost) evenly spaced. (The falling edges are ignored.)

PWM_and_control.jpg

The PWM outputs are controlled via AND gates and a Control Register.

Pulse_Converters.jpg

Pulse Converters trigger on the rising edges of the outputs and generate pulses of equal length.

I've built and tested this implementation, and it works as I expected, (except there is a strange delay after 10 pulses, but that is probably something to do with the PWM settings).

Now I would like to mux the PWM outputs down to a single signal. I think 2 layers of OR gates after the AND gates will do it.

If anyone has suggestions/comments on any part of this design, please reply!

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi KrJo_1049446,

Summing up all the responses here is the most suitable alternative to your question on using a single converter instead of 4 pulse converters.

pastedImage_0.png

Regards

Alakananda

Alakananda
0 Likes