Newbie help: 16F690


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    OK, I followed your link. I followed the instructions but there is a compile error stating that "undefined symbol: CMCON". Here is my new code:
    ----------------------------
    CMCON = 7

    main:

    if PORTA.3 = 1 then pressed
    goto main

    pressed:
    high PORTC.3
    pause 250
    low PORTC.3
    Pause 250

    goto main
    -----------------------------

    Any help is appreciated!

    -Mike

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Sure it will never work as there's no CMCON register for that PIC. BTW internal comparator are disabled at POR. Your problem is more with the ADCs.

    ANSEL=0 ' disable ADCs
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Ok, well I guess that wasn't the best advice for the chip you are using.

    On a 16F690, PORTA.3 is the MCLR/VPP pin, and it defaults to the "Master Clear" (MCLR). In order to use it as a digital input, MCLR must be disabled.

    If using PM as the assembler then use this...
    Code:
    @ DEVICE MCLR_OFF
    or if using MPASM..
    Code:
    @  __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF
    But you'll need to modify the 16F690.INC file in the PBP folder for it to work.

    Also, PORTC.3 is multiplexed with the A/D converter, the Comparators, and the ECCP module. To use this pin as a digital output ...
    Code:
    ANSEL = 0
    ANSELH = 0  ; for ANS8-11
    The 16F690 is a very complex chip as far as PIC's go. And the datasheet is very confusing, to say the least. Wouldn't really recommend it for a first time user.

    HTH,

    P.S. Steve, I found the ANSELH from one of your previous posts.
    DT

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor
    P.S. Steve, I found the ANSELH from one of your previous posts.
    Hehe, was it the Ron Marcus Thread

    It's an interesting PIC so far. I have few of them here but never found time to play with. mmm, this is why the Comparator latches reminded me something when surfing fast in the datasheet.

    The 16F690 is a very complex chip as far as PIC's go. And the datasheet is very confusing, to say the least.
    At least i'm not the only one to say that
    Last edited by mister_e; - 18th September 2006 at 04:33.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    >> Hehe, was it the Ron Marcus Thread

    PBP & 16F690 bug?
    http://www.picbasic.co.uk/forum/show...ghlight=16F690

    That's the one!

    Saved me from another hour or two of searching through that awful datasheet.

    Thanks!
    <br>
    DT

Similar Threads

  1. HSERIN / SERIN Problem with 16f690
    By rborsuk in forum Serial
    Replies: 24
    Last Post: - 5th February 2010, 04:51
  2. 16f690 crashes
    By Lincoln S. in forum Serial
    Replies: 8
    Last Post: - 26th November 2008, 08:32
  3. Newbie: Temperature measurements
    By Budda in forum General
    Replies: 10
    Last Post: - 30th March 2007, 09:56
  4. PIC Newbie
    By azmax100 in forum Schematics
    Replies: 7
    Last Post: - 23rd February 2007, 04:52
  5. request for a newbie forum
    By nimonia in forum Forum Requests
    Replies: 1
    Last Post: - 20th May 2006, 09:01

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