Bruce,
i tried setting the OSCCON value and the OSCTUNE bit as well but i'm not getting the higher speed. here's my test code:
'use the following when using the MPASM assembler
@ __CONFIG _CONFIG1H, _OSC_INTIO67_1H
@ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOREN_OFF_2L
@ __CONFIG _CONFIG2H, _WDT_OFF_2H
@ __CONFIG _CONFIG3H, _MCLRE_ON_3H
@ __CONFIG _CONFIG4L, _LVP_OFF_4L & _DEBUG_OFF_4L & _XINST_OFF_4L
@ __CONFIG _CONFIG5L, _CP0_ON_5L & _CP1_ON_5L
DEFINE OSC 32
clear
OSCCON=%11111110 'SLEEP mode, 8MHz internal osc, no startup but use primary, primary has stablized, select internal osc block
OSCTUNE.6=1 'enables PLL 4x speed multipler for the internal OSC
ADCON1=%00001111 'turns all AD pins to digital and tells module to use Vdd and Vss
ADCON0.0=0 'disables AD module
TRISB=%00000000 'PortB.4 => Heartbeat LED pin set to output
HBLED var PORTB.4 'alias for heartbeat LED
;------------------------------------------------------------------------
Main:
toggle hbled
pause 500
GOTO Main
;------------------------------------------------------------------------
when i use DEFINE OSC 8 the LED flashes as expected. when use DEFINE OSC 32 it flashes slowly which leads me to think i've not successfully activated the x4 PLL.
-=drew
Bookmarks