PortA.4 not working on 16F690


Results 1 to 11 of 11

Threaded View

  1. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by modifyit View Post
    I am having trouble getting my 16F690 pin AN4 working as a digital output. No matter what I try the pin seems to float between high and low and creates an approx 2.6 volts using a multimeter.

    I think I have all the typical items covered like the ANSEL and ANSELH registers and the comparator registers.

    Here is the code, any thoughts are appreciated:

    [/code]
    'defines
    OSCCON=%01110101
    define OSC 8
    DEFINE SHIFT_PAUSEUS 100
    'end defines
    data 0,0
    'includes
    'end includes

    ' Config Fuses
    @ __config _INTRC_OSC_NOCLKOUT & _CPD_ON & _CP_ON & _BOR_ON & _MCLRE_ON & _PWRTE_ON & _WDT_ON & _IESO_OFF & _FCMEN_OFF
    ' PICBASIC PRO program to show button press on LED

    ANSEL = %00000000 ' Set all pins digital
    ANSELH = %00000000
    WPUA = %00000011 ' Enable pullups for buttons
    WPUB = %00000000
    OPTION_REG.7 = 0
    CM1CON0.0=0
    CM2CON0.0=0

    TRISA = %11001111 ' Set PORTA.4,5 (LEDs) to output


    loop:
    PORTA.4 = 1 ' Turn on 1st LED
    pause 1000
    goto loop

    [code/]
    Read the datasheet, page 59, read the grayed note in the block right above example 4-1 on the right side of the page....then read your code again...you'll laugh, you'll cry, you'll hurl!


    Ok, just rechecked the datasheet. Unless I'm reading it wrong, page 59 (as described above) and page 60, paragraph 4.2.1 contradict each other.

    Also, which one is it? RA4 or AN4?
    Last edited by skimask; - 8th February 2007 at 05:44.

Similar Threads

  1. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 04:36
  2. LOW PORTA cause serin2 not working.
    By mikewen in forum Serial
    Replies: 7
    Last Post: - 28th August 2009, 05:18
  3. LCD Display not working - PIC heating...
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 24th September 2006, 08:35
  4. PBP & 16F690 bug?
    By Ron Marcus in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 30th May 2006, 00:18
  5. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 13:25

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