PICBASIC Pro commands for using analog comparator module for PIC16F628


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2008
    Posts
    6

    Question PICBASIC Pro commands for using analog comparator module for PIC16F628

    I would like to use the analog comparator module so that 2 input into the comparator will result in one output from it. But I have problems with the syntax used in the PICBASIC Pro.

    Can anyone please kindly help me for the commands that i need and also any circuit diagrams in using the analog comparator that may help.

    Thanks a lot for help..

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by steng View Post
    But I have problems with the syntax used in the PICBASIC Pro.
    What problems with what syntax? Show us!

  3. #3
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default You need to manually read/write registers.

    Hi,

    First of all you need to configure your comparator modes through the CMCON register.
    Syntax : CMCON = %0x0xxxxx
    You would find the details from the datasheet about the different modes. Now if you are using the internal reference for your comparator then you need to setup the VRCON register to specify the reference voltage. Same way VRCON =

    Now in your application you need to poll the Comparator Output bit CMCON.6 for the comparator status. If you need interrupts then you need to setup the peripheral interrupt registers as well along with the PIE bit in the INTCON. Any change in the comparator status causes an interrupt.
    Regards

    Sougata

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


    Did you find this post helpful? Yes | No

    Smile

    see post #3 here for possible help

    http://www.picbasic.co.uk/forum/show...2459#post62459
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  5. #5
    Join Date
    Oct 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Smile Thanks..:)

    Thanks a lot. I'll try to read the links provided and write the commands that you all had provided. Will come back if I face any problems.

    Thanks again..

Similar Threads

  1. PicBasic Pro Demo
    By nbrucew in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th August 2009, 20:10
  2. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  3. Timing in PICBasic Pro commands
    By freelancebee in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th September 2005, 01:50
  4. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 18:15
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 22:19

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