scasale
- 25th February 2012, 02:01
I have been all over this forum looking for a solution on how to enable the internal oscillator on a PIC16F62XA. I have always used an external clock and done some complex stuff, but this is driving my crazy. 2 days no luck. I am trying this simple hunk of code now, before I try my app. I would like to bring the clock out on a pin, CLKOUT pin, so I can put my scope on it to see if it is going.
Using Pic Basic Pro 2.43, Microcode Studio 3.0.0.5, and a WARP13A programer.
I have tried @ _config _INTOSC _OSC and others. There have been many iterations with no results. Can't be that hard, Can it? Strange that some of the PIC books I have don't spell it out either.
Here is the simple code.
Thanks
Scott C.
@ DEVICE PIC16F628A, INTOSC_OSC_CLKOUT
Define OSC 4 ' 4MHz
LED1 VAR PORTA.1
LED2 VAR PORTA.2
CMCON=7
VRCON=0
TRISA = 0
TRISB = %00000000
STARTMAIN:
LED1 = 1
LED2 = 1
PAUSE 750
LED1 = 0
LED2 = 0
GOTO STARTMAIN
END
Using Pic Basic Pro 2.43, Microcode Studio 3.0.0.5, and a WARP13A programer.
I have tried @ _config _INTOSC _OSC and others. There have been many iterations with no results. Can't be that hard, Can it? Strange that some of the PIC books I have don't spell it out either.
Here is the simple code.
Thanks
Scott C.
@ DEVICE PIC16F628A, INTOSC_OSC_CLKOUT
Define OSC 4 ' 4MHz
LED1 VAR PORTA.1
LED2 VAR PORTA.2
CMCON=7
VRCON=0
TRISA = 0
TRISB = %00000000
STARTMAIN:
LED1 = 1
LED2 = 1
PAUSE 750
LED1 = 0
LED2 = 0
GOTO STARTMAIN
END