PIC16F819 Problems Initializing

Thread Starter

ronbowalker

Joined Jun 26, 2009
23
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.
 

BMorse

Joined Sep 26, 2009
2,675
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
Rich (BB code):
BANKSEL PORTA ; select bank of PORTA
CLRF PORTA ; Initialize PORTA by  clearing output data latches
BANKSEL ADCON1 ; Select Bank of ADCON1
MOVLW 0x06 ; Configure all pins
MOVWF ADCON1 ; as digital inputs
MOVLW 0xFF ; Value used to initialize data direction
MOVWF TRISA ; Set RA<7:0> as inputs
My .02
 
Top