16F88 -- weird stuff Ansel?


+ Reply to Thread
Results 1 to 6 of 6
  1. #1

    Default 16F88 -- weird stuff Ansel?

    One of those twilight zone problems going on -- not worth explaining but let me ask....

    ANSEL = 0

    CMCON = 7

    That's what I have for my 16F88.

    I need ALL pins digital. Port A and B. And just that, no ADC, no nothing but 16 inputs and outputs.

    Is there something quirky about the 16F88 I'm missing? Just simply trying to toggle an output hi/lo (along with much other code) and stumped.

    Is the ansel and cmcon setup right for what I want? thanks

  2. #2

    Default Re: 16F88 -- weird stuff Ansel?

    every ^&&% time I post a question, 5 minutes later I figure it out.

    added ADCON1 = 7


    confirm anyone? that this must be there for my 16 I/O ? working now.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,218

    Default Re: 16F88 -- weird stuff Ansel?

    Hi,
    ANSEL = 0 for sure.
    CMCON = 7 why not, but it's the default POR value so really shouldn't be needed (as long as the datasheet isn't lying to us).
    ADCON1 = 7 don't know how you came up with that value or how it would help (if it acually did). The four lower bits are unimplemented and does nothing so Writing 7 to that regiser does exactly that - nothing.

    So, as far as I can see, clear ANSEL and clear TRIS bits for your outputs should do it.

    /Henrik.

  4. #4

    Default Re: 16F88 -- weird stuff Ansel?

    yeah, I think the adcon1 addition was my imagination. still acting up. what I'm trying to do is simple look at the data output from an infrared receiver on an input pin (with a pullup) and check for a low. works fine on a breadboard (just doing that with a few lines of code in a loop) but when I try to implement it in some code which has a lot going on, it's haphazard. I've tried using a for next loop so it stays on the input pin, checking a thousand times and even tried a goto where it loops for a few seconds using a counter. (a few seconds would be more than enough to "catch" the pin going low). tried a voltage divider on the pin trying to push it lower to ground, etc. not having much luck.

    But I'll probably figure out after I post this --as always

  5. #5

    Default Re: 16F88 -- weird stuff Ansel?

    Michael I only needed to use the 'F88 for 1 project. Here is my header. I never had any trouble with the inputs or outputs.

    OSCCON = $60 'set int osc to 4mhz
    ANSEL = 0 ANALOG INPUTS NONE
    ADCON0 = 0 'AD MODULE OFF & CONSUMES NO CURRENT
    CMCON = 7 'COMPARATORS OFF (DEFAULT ON POR)

  6. #6
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    276

    Default Re: 16F88 -- weird stuff Ansel?

    If that doesn't work, post your entire code, including your CONFIGuration bits. Use [ CODE] and [/CODE] (without the spaces) to compartmentalize your code in the forum posting.

Similar Threads

  1. CANBUS Stuff
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 10th July 2017, 15:46
  2. ANSEL command
    By Samoele in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th January 2009, 16:33
  3. 18F25K20 & ANSEL = Error
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th December 2008, 03:36
  4. The green stuff on a PCB
    By The Master in forum Off Topic
    Replies: 33
    Last Post: - 16th April 2008, 12:48
  5. please help me Pwm Timing, RC Stuff
    By eddy in forum mel PIC BASIC
    Replies: 0
    Last Post: - 15th August 2007, 04:55

Members who have read this thread : 10

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