Comparator help (16F627A)


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2008
    Posts
    5

    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. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

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

    http://list.picbasic.com/forum/messages/3064/3607.html?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3


    Did you find this post helpful? Yes | No

    Default

    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. #4
    Join Date
    May 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    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 : 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