Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4745

18F4680 Internal Oscillator

$
0
0
I am working with the 18F4680 and for some reason can't get the internal oscillator to work. The external works fine.
I may need to also configure config1H, but it seems everything I did to try that would result in a compile error message. Is there something else I am missing?

I tried the below and it resulted in compiler error
#CONFIG
_CONFIG _OSC_IRCIO67_1H
#ENDCONFIG



I edited the PIC18F4680.PBPINC by changing the #CONFIG section from CONFIG OSC = HS to CONFIG OSC = IRCIO67. This did compile with no error, but also wouldn't run.


This is the code which I think should work.


OSCCON = $72 ' Set internal 8Mhz OSC
'OSCCON = %11100010 ' Set internal 4Mhz OSC
#Config
CONFIG OSC = IRCIO67 ;Sets for internal oscillator
#endconfig


DEFINE OSC 8 'Sets Osc to 8MHZ




'Setup
ADCON0 = $00 'Disables A/D module
ADCON1 = $0F 'Sets inputs to digital
CMCON = $07 'Takes pins D<3:0> to digital from default PW mode

Viewing all articles
Browse latest Browse all 4745

Trending Articles