PIC16F819 Problems Initializing

Discussion in 'Embedded Systems and Microcontrollers' started by ronbowalker, Nov 18, 2009.

  1. ronbowalker

    Thread Starter Member

    Jun 26, 2009
    I have been trying to get this chip to initialize properly, and I am in need of help. I am using Basic Pro, but give me what you know and i will take it from there.

    What is the proper settings for the following requirements?

    1. 31.25kHz internal oscillator (OSCCON=%00001000)?
    2. Pins 6&7 as outputs
    3. Internal Oscillator (INTIO2)?
    4. All pins to be digital (ADCON1=7)?

    Please assist me if you can, thank you.
  2. BMorse

    Senior Member

    Sep 26, 2009
    OSCCON should be b'00000000' for Internal 31.25Khz.....

    FOSC2:FOSC0 should equal 100 for INTRC oscillator; port I/O function on both RA6/OSC2/CLKO pin and RA7/OSC1/CLKI pin, these are bits 4, 1 and 0 in your Configuration word settings....

    here is the code to set all pins on PortA as digital inputs
    Code ( (Unknown Language)):
    2. BANKSEL PORTA ; select bank of PORTA
    3. CLRF PORTA ; Initialize PORTA by  clearing output data latches
    4. BANKSEL ADCON1 ; Select Bank of ADCON1
    5. MOVLW 0x06 ; Configure all pins
    6. MOVWF ADCON1 ; as digital inputs
    7. MOVLW 0xFF ; Value used to initialize data direction
    8. MOVWF TRISA ; Set RA<7:0> as inputs
    My .02