Below is a ticket I processed with Microchip on this issue. As well as the response I got. I am not familiar with the info (FOSC2:FOSC0) they gave me and need assistance in writing this in PBP. I have found that 31.25kHz is defined as "100" on the datasheet. I am also using INTIO2 on the programming configuration, making pins 6 & 7 as I/O ports.
Description:Using Pic Basic Pro as programming tool:
I am trying to initialize the 16F819 for:
Pins A.0, A.1, A.3, B.0, B.1, B.2, B.3, B.4, B.5 to be OUTPUT/LOW (Digital).
Pins A.7 and B.0 to be OUTPUT/HIGH (Digital).
Pins A.6, B.6, A.2, A.4 to be input pins.
I am also wanting to configure the OSC to be 31.25kHz internal. What configuration settings do I use for this?
Resolution:I'm not familiar with Pic Basic Pro but the registers that need to be configured for the I/O are below.
TRISA
TRISB
PORTA
PORTB
OSCCON
ADCON1
The MCLR pin configuration will depend on how you want to use the Pin. If you want to use it as an input you need to clear the MCLRE bit in the configuration bits register. Otherwise if it is to be used as a reset the MCLRE bit must be set to a 1.
If you want to use the Internal Oscillator as your primary clock you need to have the Fosc2:Fosc0 bits in the configuration bits register programmed as 100.
Here is the program I am using, and I get no HIGH outputs. Assistance would be greatly appreciated.
DEFINE OSC 3
OSCCON = %00001000
ADCON1=7
TRISA = %01110100
TRISB = %10100000
PORTA.0 = 0
PORTA.1 = 0
PORTA.3 = 0
PORTA.7 = 1
PORTB.0 = 1
Description:Using Pic Basic Pro as programming tool:
I am trying to initialize the 16F819 for:
Pins A.0, A.1, A.3, B.0, B.1, B.2, B.3, B.4, B.5 to be OUTPUT/LOW (Digital).
Pins A.7 and B.0 to be OUTPUT/HIGH (Digital).
Pins A.6, B.6, A.2, A.4 to be input pins.
I am also wanting to configure the OSC to be 31.25kHz internal. What configuration settings do I use for this?
Resolution:I'm not familiar with Pic Basic Pro but the registers that need to be configured for the I/O are below.
TRISA
TRISB
PORTA
PORTB
OSCCON
ADCON1
The MCLR pin configuration will depend on how you want to use the Pin. If you want to use it as an input you need to clear the MCLRE bit in the configuration bits register. Otherwise if it is to be used as a reset the MCLRE bit must be set to a 1.
If you want to use the Internal Oscillator as your primary clock you need to have the Fosc2:Fosc0 bits in the configuration bits register programmed as 100.
Here is the program I am using, and I get no HIGH outputs. Assistance would be greatly appreciated.
DEFINE OSC 3
OSCCON = %00001000
ADCON1=7
TRISA = %01110100
TRISB = %10100000
PORTA.0 = 0
PORTA.1 = 0
PORTA.3 = 0
PORTA.7 = 1
PORTB.0 = 1