Need help to shut off comparators for 16f688


Closed Thread
Results 1 to 12 of 12
  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.


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


    Did you find this post helpful? Yes | No

    Default

    Jessey,

    I was just roaming the meLabs site, and it looks like the P245al.exe Patch might fix the missing register names for the 688.
    http://www.melabs.com/support/patches.htm

    Until you get a chance to upgrade
    DT

  10. #10
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Thanks for the tip

    Hi Darrel,

    Thanks for the tip. I just ordered the latest PBP upgrade v2.47 the other day and it should be here in a couple of days. I could have purchased an up-dated manual as well but the Canadian distributor I deal with didn't have any in stock. Is there an online updated version for PicBasic Pro that you know of?

    I sure like the 16f688 micro, lots of nice features, inexpensive (I purchased 30 for under $100.00 CND) and it has twice the code space as the 16f628, that's cool!! I'm surprised I don't see more people here using them. What's your overall favorite microprocessor there Darrel?

    Thanks
    jessey

  11. #11
    jessey's Avatar
    jessey Guest


    Did you find this post helpful? Yes | No

    Default Still waiting for my upgrade

    Quote Originally Posted by Darrel Taylor
    Jessey,

    I was just roaming the meLabs site, and it looks like the P245al.exe Patch might fix the missing register names for the 688.
    http://www.melabs.com/support/patches.htm

    Until you get a chance to upgrade
    Hi Darrel,

    I downloaded the patch you suggested (just to try it out) and it works great, I can now compile without any errors when using CMCON0 = 7. I also tried using your code http://www.picbasic.co.uk/forum/showthread.php?t=40 (for the first time) to get rid of "Crossing page boundary - ensure page bits are set" from coming up every time I compile and it also works great with my 688. Sounds like I owe you more than a few beers by now!

    Thanks Again
    jessey

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


    Did you find this post helpful? Yes | No

    Default

    >> I also tried using your code ...

    Good things about the Forum...
        3-1/2 years later, and it's still there.

      Bad things about the Forum...
        It took 3-1/2 years to find it.

    <hr> >> What's your overall favorite microprocessor there Darrel?

    Just about anything with an 18F in the part number.
    • Most used - 18F452 &nbsp; (44-TQFP)
    • Most Liked - 18F8680
    • Still waiting to try - (any 18F with a J in the P/N)
      If only someone would write a TCP/IP stack for PBP.
    <hr>
    Hey, I'm kinda thirsty over here. Could you send one of those Beers?
    Just pour it in your keyboard, then type in my email address.
    DT

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