Does this look right for a pic runing at 80mhz? Thanks (I appreciate it is overclocked)
DEFINE HSER_RCSTA 90h 'Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h 'Enable transmit, BRGH = 1
DEFINE HSER_CLROERR 1 'Clear overflow automatically
DEFINE HSER_SPBRG 90 '57600 Baud @ 80MHz, -0.064% (346 Decimal = $15A)
define HSER_SPBRGH 1
BAUDCON1.3 = 1 'Enable 16 bit baudrate generator
I'm also trying to set the PIC to activate the PLL wiith a 20mhz external resonator. It seems stuck at 1/4 speed.
Note the program runs fine at 64mhz with the internal oscillator and 4 xPLL but I can't seem to get the PLL enabled with an external resonator.
Code:
CONFIG RETEN = OFF ; Ultra low-power regulator is Enabled (Controlled by SRETEN bit)
CONFIG INTOSCSEL = HIGH ; High power mode during Sleep
CONFIG SOSCSEL = DIG ; Disabled RC0 & RC1 I/0
CONFIG XINST = OFF ; Disabled
CONFIG FOSC = HS2 ; External 20mhz Resonator
CONFIG PLLCFG = ON ; Enabled
OSCCON = %00000000 'External Resonator
OSCCON2 = %00000000 'Clear
OSCTUNE = %01000000 'Enable PLL x 4 = 80mhz
Comments?
Bookmarks