Project-Read voltage in / different voltage out


Closed Thread
Results 1 to 7 of 7
  1. #1
    andydoc's Avatar
    andydoc Guest

    Default Project-Read voltage in / different voltage out

    I have a project in mind that will be a good beginner project.

    The goal is to read in a voltage through a 8bit A/D, have the PIC take the voltage and look up a table in memory. This table will have the 'in' voltage value, and a corresponding 'out' value. Find the value, and select the value corresponding to the first. Then, output the voltage value (PWM?)

    I need some help/pointers as to a beginning for the PIC selection and coding.

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


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    You want to create the non-linear digital amplifier ???

    which "transfer function" are you looking for ???

    Alain

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    For a nasty 8 bit resolution ... yuk!!!!
    Code:
    adcin 0, B0
    Read B0
    HPWM 1,b0,Frequency
    or use the internal ressource to have a 10 bit resolution of your PWM.

    everything will be done by your lookup table in the EEPROM.

    Look for DATA & READ
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    In general Steve's code example should work,
    but it will require some filtering and smoothing at the PWM Output.
    And with variable load you may want to have some feedback of the Output Voltage to be able to compensate for changes in Load.

    And last but not least:
    Plan some time for experimenting to find proper Values for your lookup table.

    If you could give us some more details we can probably come up with better solutions.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  5. #5
    andydoc's Avatar
    andydoc Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for the quick input...and really appreciate the advice. I am so new to this, I am not sure what is the best route to take...but I do know not taking some route won't get me anywhere! I am open to any ideas, like more resolution to the A/D or an external EEPROM if needed. Like I said, I am in the pre-school class of learning the world of PIcs.

    Take a look at the attached txt file (might be easier to convert it to excel) and see the data I am trying to translate.
    Attached Files Attached Files

  6. #6
    andydoc's Avatar
    andydoc Guest


    Did you find this post helpful? Yes | No

    Default

    Could anyone give me some pointers or examples as how to do a look table in Picbasic?

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    the easy way is to store them in internal EEPROM and read them after...

    Look in your manual for DATA and READ

    option 2 : use a variable array... explain in the begining of your manual.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  3. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  4. Help with final project
    By OvERKiLL in forum General
    Replies: 4
    Last Post: - 15th December 2006, 20:35
  5. Help Read negative voltage
    By gzorzi in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th October 2004, 07:42

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