Add squar signals

25 Apr 2013

Hi

I am new to mbed but I will try to make it as clear as possiable....

I have two square wave signals from the wave generator with different frequancy. I feed the signals to the mbed and I tried to add them togther and output them using digital output port.

Unfortunatly, nothing happened to the signal. For example, if I have (1) from the first signal and (1) from the second signal, it suppose to give (2) but I still get (1) from the output.

I use the (+) function only. Can any one help me I am really strugeling with this one.

25 Apr 2013

Well a digital output port cannot add them, since it can only output a 0 or a 1, so no 2.

You can use AnalogOut (assuming your board has one). Then add them and divide by 2 (since AnalogOut has a range of 0 to 1).

25 Apr 2013

hi Erik

is the right way to add them using (+) function.

The is what I am aiming to get

/media/uploads/Fairaq/signal1.png /media/uploads/Fairaq/signal2.png /media/uploads/Fairaq/signalcom.png

25 Apr 2013

Yes you can just add with the +, however a digitalout can only output a digital signal, a 0 or a 1, nothing in between. AnalogOut can output values in between, but not larger than 1. So if you add them and divide by 2, and then put it on an AnalogOut you get the signal 0, 0.5 or 1, depending on inputs.

27 Apr 2014

I have used cascaded adc and dac converter and i get 400 mv square wave output for 4 v input,can you tell me the reason for decrease in amplitude