32khz oscillator on 18F26K22 problem


Yesterday 18:25
Forum: Proton Studio
Starter: johngb
Views: 0
Replies: 2
Yesterday 17:52
Forum: Website / Forum Issues
Starter: johngb
Views: 0
Replies: 0
Yesterday 12:57
Forum: Proton Plus Compiler v3
Starter: Les
Views: 0
Replies: 18
Yesterday 12:08
Forum: Proton Plus Compiler v3
Starter: gtv_pic
Views: 0
Replies: 8
+ Reply to Thread
Results 1 to 5 of 5

Thread: 32khz oscillator on 18F26K22 problem346 days old

  1. #1
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,251
    Thumbs Up
    Received: 77
    Given: 39
    Total Downloaded
    2.98 GB

    0 Not allowed!

    Default 32khz oscillator on 18F26K22 problem

    I have added a 32768Hz crystal to the OSC in and out pins (PORTA6,7) with 12pF to ground each side.
    I can't get it to work, I am looking at the pins with a 'scope. I am missing something but can't see what.


    Device=18F26K22
    Xtal=64

    Config_Start
    FOSC = INTIO67 ;Internal oscillator block, port function on RA6 and RA7
    PLLCFG = On ;Oscillator multiplied by 4
    PRICLKEN = On ;Primary clock is always enabled
    FCMEN = OFF ;Fail-Safe Clock Monitor disabled
    IESO = OFF ;Oscillator Switchover mode disabled
    PWRTEN = OFF ;Power up timer disabled
    BOREN = OFF ;Brown-out Reset disabled in hardware and software
    BORV = 285 ;VBOR set to 2.85 V nominal
    WDTEN = OFF ;Watch dog timer is always disabled. SWDTEN has no effect.
    WDTPS = 1 ;1:1
    CCP2MX = PORTB3 ;CCP2 input/output is multiplexed with RB3
    PBADEN = OFF ;Segments<5:0> pins are configured as digital I/O on Reset
    HFOFST = OFF ;HFINTOSC output and ready status are delayed by the oscillator stable status
    T3CMX = PORTB5 ;T3CKI is on RB5
    P2BMX = PORTC0 ;P2B is on RC0
    MCLRE = EXTMCLR ;MCLR pin enabled, RE3 input pin disabled
    STVREN = On ;Stack full/underflow will cause Reset
    LVP = OFF ;Single-Supply ICSP disabled
    XINST = OFF ;Instruction set extension and Indexed mode disabled (Legacy mode)
    Debug = OFF ;Disabled
    Cp0 = OFF ;Block 0 (000800-001FFFh) not code-protected
    Config_End

    OSCCON = Percent01110000 ;16MHz internal oscillator block
    Nop
    OSCCON2 = Perecnt 10001100 ;pre-scaler to give 64Megs
    Nop
    Set OSCTUNE.6 ;enable PLL so clock now 64MHz

    T3CON = Percent10001100 ;osc on timer 3, no prescale, no sync
    TMR3H = $80 ;set for 1 second (count of 32768)
    TMR3L = $00
    T3CON = Percent10001101 ;enable soc/timer

    While ;loop-stop
    Wend

    Tried different crystals etc, the device works otherwise.
    Any help appreciated.
    Charlie
    Last edited by charliecoultas; 7th March 2018 at 11:37.

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    407
    Thumbs Up
    Received: 79
    Given: 0
    Total Downloaded
    195.53 MB

    0 Not allowed!

    Default Re: 32khz oscillator on 18F26K22 problem

    The secondary osc (SOSC) connections are on RC0 (SOSCO) and RC1 (SOSCI).

    See datasheet sections 12.2 and 12.4

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,251
    Thumbs Up
    Received: 77
    Given: 39
    Total Downloaded
    2.98 GB

    0 Not allowed!

    Default Re: 32khz oscillator on 18F26K22 problem

    Thanks very much TW. Solved!

    Charlie

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,937
    Thumbs Up
    Received: 182
    Given: 166
    Total Downloaded
    3.27 GB

    0 Not allowed!

    Default Re: 32khz oscillator on 18F26K22 problem

    FOSC = INTIO67 ;Internal oscillator block, port function on RA6 and RA7
    Internal oscillator?

    PRICLKEN = On ;Primary clock is always enabled
    Do you want primary or secondary?
    George.

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,251
    Thumbs Up
    Received: 77
    Given: 39
    Total Downloaded
    2.98 GB

    0 Not allowed!

    Default Re: 32khz oscillator on 18F26K22 problem

    Secondary, I wanted the oscillator that you can connect a 32768 crystal to, and generate 1 second pulses (using a divide by 32768 on timer 1/3/5).
    I got confused George, mixed up but that's fairly usual nowadays. It's working fine now (but I've had to do a little knife-work on the pcb).

    Charlie

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. SSD1306 OLED driver problem with 64Mhz 18F26K22
    By Dompie in forum WIKI Discussion
    Replies: 2
    Last Post: 14th November 2016, 10:08
  2. Serout problem on 18F26k22
    By amateurtje in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 20th August 2015, 16:01
  3. HSPLL Oscillator Problem on 18F2431
    By wastrix in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 15th July 2009, 00:45
  4. Questions about 32khz crystal
    By rcurl in forum Proton Plus Compiler v3
    Replies: 12
    Last Post: 5th December 2005, 14:38

Members who have read this thread : 30

Actions :  (Set Date)

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