Need help to shut off comparators for 16f688


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    jessey's Avatar
    jessey Guest

    Default Need help to shut off comparators for 16f688

    Hello,

    I'm trying to shut off the comparators on my 16f688 and can't seem to accomplish it, as a result I can't get RA0 or RA1 to function as expected. When I use CMCON0 = 7 or CMCON0 = %00000111 and try to compile, I get an error message saying there is a syntax error.

    I'm using PicBasic Pro Ver 2.45, MPASM Ver 3.60 with MicroCode Studio 2.1.0.7 and EPIC Version 2.46 beta programmer with a PIC16F688-20/P.

    Would anyone have any suggestions on why it won't compile? I looked at the data sheet and CMCON0 = %00000111 is a valid command and I've also seen this used in code examples while looking in the archives.

    Any help would be very much appreciated.

    Thanks
    jessey

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default A long shot

    Hi Jessy,

    Do you have the right chip selected in MicroCodeStudio?

    I believe you also need to clear the corresponding bits in the ANSEL register to make the pins digital.

    /Henrik Olsson.

  3. #3
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Henrik,

    Thanks for your reply. Yes I have selected the 16f688 in the MicroCode Studio drop down list and I'm also using ANSEL = %00000000.

    Any other ideas?

    Thanks
    jessey

  4. #4
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jessey
    When I use CMCON0 = 7 or CMCON0 = %00000111 and try to compile
    use : CMCON = 7

  5. #5
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default

    Hi savnik,

    When I try and compile using CMCON = 7 I get an error saying 'Symbol not previously defined (CMCON)'. I checked the data sheet and the only reference it makes to CMCON is in a, Modified Comparator C1 Output Block Diagram in figure 7-4 and 7-5.

    Thanks
    jessey

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Hi Jessey,

    I have both PBP 2.45 and 2.46

    In 2.45 I get the same error you described. With 2.46 I don't.

    But without upgrading, you might try

    POKE $19, 7

    HTH,
    DT

  7. #7
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Works like a charm

    Hi Darrel,

    That's great, it works like a charm now. I'll have to upgrade to the newest version. I'm in your debt once again.

    Thanks a million
    jessey

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Thumbs up

    No need to be in debt.


Similar Threads

  1. Using Comparators
    By Short_Circuit in forum Code Examples
    Replies: 4
    Last Post: - 25th November 2009, 13:57
  2. Comparators on 18F4520
    By RacerX10 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 27th August 2009, 23:33
  3. Comparators - like descrite components?
    By kevj in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th October 2007, 18:17
  4. I shut this guy down
    By T.Jackson in forum Off Topic
    Replies: 5
    Last Post: - 25th May 2007, 03:27
  5. 16F88 using comparators AND the adc
    By jpeakall in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th May 2005, 01:08

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