PDA

View Full Version : Creating Bespoke output waveform



OCALLAGH
- 2nd July 2009, 16:09
Hi all

I am new to this forum and need some help please!

I need to create an output from my PIC which will be high for a defined time (+5V), it will stay high for a defined time but I then need the output to swing to -5V, I need the voltage to go negative.

In other words I need to make an output swing from a positive voltage to a negative voltage, almost like a sine wave but with square wave characteristics.

Not sure if i've been clear enough here but if anyone understands what i'm after please help!! I have uploaded a PNG file of the waveform i'm trying to create, hopefully that will help!

Thanks,
Adam

Acetronics2
- 3rd July 2009, 09:59
Hi,

This is not very difficult:

you need to use two outputs : one for positive output and one with an OPA as an inverter ( gain = -1 ) for negative output.

Of course a negative supply is needed ... think to max 232, ICL 7660 or similar as the negative voltage generator ... if no output power is needed.

BTW ... which is the final use ??? already done designs surely exist ... ( electrical stimulators, i.e.)

Alain

Nicmus
- 3rd July 2009, 13:11
There is no need for an OPA or two PIC outputs.
One RS232 level convertor chip should do the trick. All you need to keep in mind is the inverted logic.

HTH

Nick

Acetronics2
- 3rd July 2009, 13:17
There is no need for an OPA or two PIC outputs.
One RS232 level convertor chip should do the trick. All you need to keep in mind is the inverted logic.

HTH

Nick

Hi,

Ok for + 5 and -5 v ... ( better say +12 and -12 ); BUT ... How do you produce the 0 v level, then ???

The RS 232 third state, I presume ???

Alain

Nicmus
- 3rd July 2009, 14:03
My bad. I only got Adam’s written request: swing from positive 5V to negative 5V with no need for 0V as shown in the waveform.
There are few RS 232 chips that have control pins (EN if I’m not mistaken) that will cause the outputs to go in three-state mode.
In this case a pull down resistor and one more PIC IO should be enough.

Regards,

Nick

OCALLAGH
- 3rd July 2009, 15:11
My bad. I only got Adam’s written request: swing from positive 5V to negative 5V with no need for 0V as shown in the waveform.
There are few RS 232 chips that have control pins (EN if I’m not mistaken) that will cause the outputs to go in three-state mode.
In this case a pull down resistor and one more PIC IO should be enough.

Regards,

Nick

Thanks for all the help! I do need the zero fault state as this is where the signal needs to start and finish, quite right though, I didn't mention this in the original posting. I'll have a look at the RS232 option and see how I get on...

Nicmus
- 3rd July 2009, 15:49
Here is a link to Maxim site:
http://datasheets.maxim-ic.com/en/ds/MAX220-MAX249.pdf

Regards,

Nick