HELP !!! How change the voltage of a pin ????


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2007
    Posts
    3

    Exclamation HELP !!! How change the voltage of a pin ????

    Hi all . . .

    I know where the COMMAND HIGH change the especific pin a 5.0 v . . ok thats fine

    But i need change this voltage . . . 0 to 5.0 v

    How i make this ? How i change the voltage of especific pin ?

    Example :

    var_voltage = 3.5

    SET PORTA.0 = 3.5

    i dont know the code for this.

    Can you help me ?

    Thanks.

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sorry, but you can't do that.

    Although PORTA.0 is an analog pin, the analog functions are input only.

    You can use PWM or HPWM to generate a voltage with an external cap and resistor.

    You could use several pins with an R2R resistor network.

    Or you can interface to an external D/A (Digital to Analog) convertor.

    hth,
    DT

  3. #3
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default More about DAC...

    Hi Stormdacta,


    I suggest that you have a look at MAX518 or MAX521 from Maxim (www.maxim-ic.com).
    This is a 2 wire dual DAC, octal for MAX521, that works very well with PBP I2C commands.

    TIPS: They do samples too!

    J-P

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default MicroChip to MicroChip I2M

    Allow me to recommend MCP4921 DAC for easier and less complex control.




    ======================
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Many PICs have onboard Voltage Reference Modules (See the 16F628A for example). With this PIC for example, you can output the reference voltage on RA2 (and use an external buffer if and as necessary). You can get between 4.5 and 5 Bit resolution depending on the segment selected. See the Voltage Reference Module section of your PIC's datasheet.

    For the 16F628A, you can output (assuming VDD = 5.00V)
    0-3.125V by 0.15625V intervals
    0-3.594V by 0.20833 intervals
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    Join Date
    Mar 2005
    Location
    Mandalay,Myanmar
    Posts
    9


    Did you find this post helpful? Yes | No

    Default Check sine function & frequency out function

    Hi,
    One of PBP build in maths functions is sine.
    This mean PIC pin can generate time dependent voltage.
    So by means of software pwm(***pbp build in function) technique you can get any analog volt between 0 volt and 5 volt.
    To get smooth voltage you should use passive low pass filter.(R & C series )
    from_myanmar

  7. #7
    Join Date
    Jul 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Question I2C vs SPI

    Quote Originally Posted by sayzer View Post
    Allow me to recommend MCP4921 DAC for easier and less complex control.




    ======================
    Hi Sayzer,

    MCP4921 is using SPI instead of I2C. I tought I2C, which I'm currently using, was easier than SPI because PBP has I2CREAD and I2CWRITE commands. I saw example of SPI slave & master on melabs website, but I can't see why you said MCP4921 was easier. Can you elaborate?

    J-P
    Last edited by GrandPa; - 21st August 2007 at 21:18.

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. make a low voltage output from a PIC pin
    By emptyset in forum General
    Replies: 1
    Last Post: - 8th February 2008, 19:20
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07
  5. Grounding Negative voltage through I/O pin
    By Squibcakes in forum Schematics
    Replies: 2
    Last Post: - 31st July 2006, 12:12

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