+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008

    Default Comparator help (16F627A)

    Is it possible to use the 16F627A's on board comparator to call a subroutine?

    I would like to compare a voltage (that ranges from 3 to 0 VDC relative to ground) to the internal voltage reference set to 0.5V. If the input voltage is greater than 0.5V, I want a subroutine to be called.

    I read the datasheet, but that just made me more confused. Couldn't find any good examples on how to use the comparator with Pic Basic.

    So, what I need help with is:
    1. How do I set the internal voltage reference to 0.5V with PBP?
    2. How do I setup the PIC to get the voltage in with PBP?
    3. How do I use the VRCON register to call a subroutine with PBP?

    The PIC doesn't need to do anything if the input voltage is below 0.5V.

    Any help is appreciated!

  • #2
    Join Date
    Feb 2003
    Salt Lake City, Utah USA


    This should get you started (an oldie but a goodie - not Melanie ... her post)

    Paul Borgmeier
    Salt Lake City, UT

  • #3


    That's why I couldn't find that post on the forum! I was looking for it the other day but I didn't remember where it was. It was on the picbasic list! Thanks for finding it!

  • #4
    Join Date
    May 2008


    Yes, thanks for the link, it was exactly what I needed!

  • Similar Threads

    1. 16F627A to 16F88 conversion problem
      By PICpocket in forum mel PIC BASIC Pro
      Replies: 4
      Last Post: - 18th February 2009, 19:20
    2. Newbie need Help 16F627a
      By azmax100 in forum mel PIC BASIC Pro
      Replies: 14
      Last Post: - 21st January 2009, 07:38
    3. 16F627A portA4 problem?
      By markedwards in forum mel PIC BASIC Pro
      Replies: 1
      Last Post: - 22nd October 2005, 19:54
    4. Programmer For 16f627a
      By TONIGALEA in forum General
      Replies: 1
      Last Post: - 13th January 2005, 12:55

    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