Creating Bespoke output waveform


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2009
    Posts
    2

    Default Creating Bespoke output waveform

    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
    Attached Images Attached Images  

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Default

    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Nicmus View Post
    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5


    Did you find this post helpful? Yes | No

    Default

    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

  6. #6
    Join Date
    Jul 2009
    Posts
    2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Nicmus View Post
    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...

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Here is a link to Maxim site:
    http://datasheets.maxim-ic.com/en/ds/MAX220-MAX249.pdf

    Regards,

    Nick

Similar Threads

  1. Help changing CCP3 output pin
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th July 2008, 03:30
  2. Bit Banging input to output on PIC16F876A
    By Bronurstomp in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th June 2008, 20:50
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 04:46
  4. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 23:19
  5. HSEROUT Newbie question/problem
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 11th July 2006, 15:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts