18F26K80 Serial setting sanity check and 4xPLL.


Results 1 to 21 of 21

Threaded View

  1. #1

    Default 18F26K80 Serial setting sanity check and 4xPLL.

    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?
    Last edited by retepsnikrep; - 27th July 2022 at 16:24.

Similar Threads

  1. Bytes roll over sanity check
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th October 2020, 07:23
  2. Setting RTC by Serial input
    By jamie_s in forum Code Examples
    Replies: 1
    Last Post: - 26th November 2015, 13:57
  3. timer0 10ms setting check
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st July 2015, 10:36
  4. looking for a quick sanity check
    By cncmachineguy in forum Serial
    Replies: 13
    Last Post: - 13th November 2010, 18:53
  5. Block Check on Serial Comms.
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th June 2005, 09:27

Members who have read this thread : 14

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts