Comparator circuit thoughts....


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default 1333

    Typo in:
    TorchPin var PORTB.0
    Change to
    TorchPin var PORTB.7

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This is for comparators
    Code:
    CVRCON = 143
    you want
    Code:
    ADCON1 = %00100000 'Pin #2 is voltage reference
    The LCD lines and HSEROUT line should be something like
    Code:
    LCDOUT "TARGET VDC ", #TARGETVDC
    HSEROUT [#TorchVoltsFull]
    The divide by multiply by 256 should not be there. The 8bit ADC goes from 0 to 255. As we talked before withe the voltage divider feeding the ADC and using using the reference voltage. Well it worked pretty neat for you. The torch voltage will be the same "number" as the ADC value.

    Other than that it should do something

    Now I will toss something else at you.
    Think how fast the torch move up and down. Those few line of code before the ADC is read could mean trouble. You may want to increment the movement.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. Stable Adc Reading Routine
    By gebillpap in forum General
    Replies: 27
    Last Post: - 13th May 2015, 02:18
  2. Quick thoughts: DT Ints with encoders
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 7th January 2010, 01:01

Members who have read this thread : 0

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