16F1782 @ 80MHz clock


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2007
    Posts
    15

    Smile 16F1782 @ 80MHz clock

    Looking to get a bit more speed out of an pre-existing circuit that uses a 16F873a (max 20MHz clock), did a search for faster pin-compatible or almost pin-compatible 28-pin 16F's. Decided on the 16F1782 (32MHz internal) and put it in the circuit.
    But because of an error in my initial configuration, I discovered an undocumented mode: 80MHz clock from 20MHz external osc input on RA7/CLKIN, using the configuration below.


    Code:
     #CONFIG
        __config _CONFIG1, _FOSC_HS & _CLKOUTEN_OFF & _WDTE_ON    ;so using an external osc source, but also x4 PLL (OSCCON.7 =1)
        __config _CONFIG2, _PLLEN_OFF
     #ENDCONFIG
    
    DEFINE OSC 20		'defines clock frequency = 20MHz, but since actually clocking at 80MHz, a lot of the PBP timing will be off by factor 4.
    
    WDTCON = %00011010  '8 second watchdog
    OSCCON = %11111000  'PLL x 4, 
    INTCON = 0           'disable interrupts,
    ADCON0.0 = 0        'disables a-d converter 
    ANSELA = 0
    ANSELB = 0
    INLVLA = %00001111
    
    DACCON0.7 = 0       ' Disable DAC
    CM1CON0.7 = 0       ' Disable comparator 1
    CM2CON0.7 = 0       ' Disable comparator 2
    CM3CON0.7 = 0       ' Disable comparator 3
    
    TRISA = %11011111
    TRISB = %11100000                            
    TRISC = %11110000

    The x4 PLL is deriving the clock from the 20MHz external osc.
    Obviously, this is overclocking and outside the design specification envelope. So not for production designs without extensive reputability, reliabilty, temperature range tolerance, lifetime endurance, EMI, etc. testing.
    But good for hobby projects where you need a bit more speed from a 28-pin 16F!
    It runs cool to the touch, so not an exorbitant current drain, but I have not measured the current drawn.
    I have only used it in an pre-existing circuit that had an external 20MHz clock, not with a 20MHz HS crystal directly on the 16F1782. But that would probably work too. Have not tried it with sleep modes either.
    Runs with 5V supply, have not tried with 3V, which would probably be more critical.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    I have a few projects that I needed some more speed for using the 16F1825 and have used a 10 Mhz. resonator with 4xPLL. I haven't seen any problems as of yet. Although not to the extent you are proposing....
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    Can be same approach applied to other chips from 16F series, that support extosc ?
    Say 16F1829 ?

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    I can't say for sure, so try it? There is quite a difference between what I was trying to do (40 Mhz from 32 Mhz. processor) and what you are proposing (80 Mhz. from 32 Mhz. processor).
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    Nice What is it doing?
    I wonder how on-chip EEPROM or program memory writes go.. if supported by the chip.

  6. #6
    Join Date
    Jun 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    It's only doing a simple repetitive task - triggered on dig ip by comparators, dig ops driving at any one time one of several hard pull-up transistors in a multiple 1-wire master circuit, with retrigger (blocking) timers. It's basically doing something that could be handled quicker by a few logic gates. The 1-wire communication proper (and everything else) is handled by another on-board µC - of the 18F family.
    So the 16F1782 is not writing to EEPROM etc. I'll leave that interesting experiment @80MHz to someone else!

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 16F1782 @ 80MHz clock

    The program's I have written for the 16F1825 running at 40Mhz. (10 mHZ. 4 x PLL) work just fine writing and reading from eeprom. No issues.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. A REALLY accurate clock.
    By Charles Linquis in forum Code Examples
    Replies: 24
    Last Post: - 16th January 2012, 18:41
  2. external clock / internal clock
    By grounded in forum General
    Replies: 4
    Last Post: - 31st May 2008, 18:44
  3. Simple clock
    By Tastature in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th April 2008, 01:14
  4. Clock
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 1st February 2008, 03:23
  5. Clock Out Signal
    By KeithH in forum Serial
    Replies: 8
    Last Post: - 4th May 2007, 01:35

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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