Shop OBEX P1 Docs P2 Docs Learn Events
1 to 5 volt output from the propeller ? — Parallax Forums

1 to 5 volt output from the propeller ?

JMLStamp2pJMLStamp2p Posts: 259
edited 2008-04-04 02:00 in Propeller 1
Good evening,
Is it possible to output 1 to 5 volts using a propeller output pin and a few external componets ? If so does anyone have a diagram or an object written ?

Comments

  • Lethal PythonLethal Python Posts: 3
    edited 2008-04-03 18:11
    You could create a R/2R ladder DAC

    Are you asking if you can do that with 1 ouput pin? You could connect 2 pins to a serial in parallel out register

    ...but i haven't hands on experience with DAC yet
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-03 19:34
    You can get a voltage between 0 and 3V using just the Propeller, a resistor, and a capacitor. Read the AN001 Counters Application Note that you can download from the Propeller Downloads web page. This can be run through an op-amp (which you'd want to do anyway) and, if you run the op-amp off a 5V or greater power supply, you can get your 1 to 5V signal.
  • AribaAriba Posts: 2,685
    edited 2008-04-03 19:47
    You can use a R-C combination for a simple DAC, which outputs 0...3.3V. And then a Operational Amplifier (OPAMP) with a Gain of 1.5 to amplify it to 0...5V. See the attached picture for a possible circuit.
    You can for example use 1/2 LM358 for the OPAMP, but there are thousend others...
    If you use a Rail-to-Rail-Output OPAMP like the TS922 the supply voltage of the OPAMP can also be 5V.

    For such a R-C DAC no additional Cog is necessary, a Counter in Duty-Mode does the job:

    CON
      DACpin  = 0               'Pin number
    
    PUB
      ctra := %00110<<26 | DACpin
      dira[noparse][[/noparse]DACpin] := 1
    
    '  frqa := $0666_0000        '~1V
      frqa := $8000_0000        '~2.5V
    '  frqa := $FFF0_0000        '~5V
    
      repeat
    
    


    (this code is not tested)

    Andy
    281 x 117 - 1K
  • RaymanRayman Posts: 14,162
    edited 2008-04-03 20:02
    A digital pot might work too...
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-04-03 20:05
    hello JMLStamp2,

    one simple way to create an analog voltage is to use a DAC-Chip.
    To create a voltage-range from 1.0V to 5.0V you simply limit the digitalvalue-range
    that it starts not at value zero but with the value that relates to 1.0V.

    If you can effort 8 IO-PINs of the propeller you could use an 8 bit DAC with parallelinput.

    Then the driverobject would be simply to set these 8 IO-PINs to a bytevalue.

    CHIP-examples for parallel input DAC08

    there is also one for I2C-interface PCF8591. Here you would have to use
    the I2C-object and send the right adress- and valuebytes

    best regards

    Stefan
  • JMLStamp2pJMLStamp2p Posts: 259
    edited 2008-04-03 20:41
    Thanks guys,
    I will check it out.
    JMLStamp2p
  • RaymanRayman Posts: 14,162
    edited 2008-04-03 23:57
    If you only needed to cover the range 1.7 to 5V, you might be able to use a couple diodes to upshift the DAC voltage...
  • JMLStamp2pJMLStamp2p Posts: 259
    edited 2008-04-04 02:00
    Thanks Rayman, I will be doing some reading for the next couple of days. I may yell back at you guys if I have any questions.

    Regards,
    JMLStamp2p
Sign In or Register to comment.