XTAL value for internal OSC 31KHz...


+ Reply to Thread
Results 1 to 15 of 15

Thread: XTAL value for internal OSC 31KHz...656 days old

  1. #1
    Junior Member canilica's Avatar
    Join Date
    Jan 2016
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    730.46 MB

    0 Not allowed!

    Default XTAL value for internal OSC 31KHz...

    What is the XTAL value for internal OSC 31Khz(or 500kHz,.....).

    XTAL=?

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.

  • #2
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,799
    Thumbs Up
    Received: 87
    Given: 34
    Total Downloaded
    4.53 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    From the Manual:
    Oscillator Frequency Declare.
    12-bit core device XTAL values:
    Declare Xtal 4, 8, 10, 12, 16, or 20.

    Standard 14-bit core device XTAL values:
    Declare Xtal 3, 4, 7, 8, 10, 12, 14, 16, 19, 20, 22, or 24.

    Enhanced 14-bit core device XTAL values:
    Declare Xtal 3, 4, 7, 8, 10, 12, 14, 16, 19, 20, 22, 24, 32 or 48.

    18F device XTAL values:
    Declare Xtal 3, 4, 7, 8, 10, 12, 14, 16, 19, 20, 22, 24, 25, 29, 32, 33, 40, 48, or 64.

    So the slowest you can expect is 3MHz.
    However if you don't use any frequency dependent functions such as serial commands, Delays and so on then it doesn't matter what you use. The compiler just needs the number when it has to calculate frequency dependent matters.
    John

  • 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
    Junior Member canilica's Avatar
    Join Date
    Jan 2016
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    730.46 MB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Dear John,
    Thanks for request. Your text is on manual. I want to run PIC on internal oscillator 31.25kHz(PIC16F1503). But when i use delayms command, timing is shifting from normal operation. How can I do. For example "don't use XTAL command", thanks for all.

  • 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.

  • #4
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,466
    Thumbs Up
    Received: 71
    Given: 29
    Total Downloaded
    6.08 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Quote Originally Posted by canilica View Post
    But when i use delayms command, timing is shifting from normal operation. How can I do. For example "don't use XTAL command", thanks for all.
    That is exactly what John pointed out. I never did it but I think that you need to use interrupt to determine your delay.
    Regards

    Joseph

  • 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
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,231
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Just to be clear if the given XTAL value is different than the actual clock (Fosc) all commands that use internal timing, Delay etc etc. will fail possibly in inexplicable ways.

    Is it vital that you use such a slow frequency? Perhaps is you describe what you are trying to acheive, an alternate way may be found.
    George.

  • 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.

  • #6
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,354
    Thumbs Up
    Received: 44
    Given: 39
    Total Downloaded
    3.36 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    I agree with George. I think the low frequency oscillator was only added to give such functions as the Watchdog timer etc.
    I don't think Microchip ever intended that the 31KHz oscillator be used as the main clock.

    Charlie

  • 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
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,799
    Thumbs Up
    Received: 87
    Given: 34
    Total Downloaded
    4.53 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Canilica,
    If the only frequency dependent command is delayms then the simplest way is to adjust the number (I'm assuming that the delay isn't super critical).
    e.g. if you had delayms 100 with no clock mentioned then you could use delayus 775
    The maths is no xtal mean the4MHz default is set by the compiler. 4000000/31000 = 129
    100/129 = 0.775 ms = 775 us
    Or generically delay_in_ms / 129 and if this is <1 then multiply by 1000 to make microsecs.

    I emphasise that this is only to be used if your program is just using delays. If you are also using other frequency dependent commands then you may have more complicated arithmetic to do so.
    John

  • 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.

  • #8
    Junior Member canilica's Avatar
    Join Date
    Jan 2016
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    730.46 MB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Thanks John,
    This solution is very good for me, congurlations.

  • 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
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,231
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    I still think it's a bad idea to run the device so slowly.
    George.

  • 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.

  • #10
    Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    134
    Thumbs Up
    Received: 8
    Given: 12
    Total Downloaded
    2.96 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Quote Originally Posted by towlerg View Post
    I still think it's a bad idea to run the device so slowly.
    Why? The datasheets I have looked at had instructions how to use this slow speed.. Why is it a bad idea?
    Flosi Guğmundsson
    Reykjavík

  • 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.

  • #11
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    487
    Thumbs Up
    Received: 59
    Given: 0
    Total Downloaded
    408.14 MB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    31khz gives an instruction time of about 128us for a single-cycle asm instruction.

    You likely won't need a 'delayms' function, that's for sure!

  • 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.

  • #12
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,231
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Why? The datasheets I have looked at had instructions how to use this slow speed.. Why is it a bad idea?
    I didn't say you can't do it, I just advise against it. As Tumbleweed says. If that frequency is central to what you are doing, (I have a vauge recollection that 31kHz ish divided down gives seconds) set up a timer interupt. Unless you are performing a trivial task everything is going to run s o o o s l o w l y
    George.

  • 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.

  • #13
    Member flosigud's Avatar
    Join Date
    Oct 2013
    Posts
    134
    Thumbs Up
    Received: 8
    Given: 12
    Total Downloaded
    2.96 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Running slowly makes your batteries last longer, which I believe is the main reason for using this option. Many PIC's have the option of running at two speeds, slow for power saving an another faster to do time consuming tasks.
    Flosi Guğmundsson
    Reykjavík

  • 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.

  • #14
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,231
    Thumbs Up
    Received: 75
    Given: 181
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Hi Flosi

    I agree that reducing the clock will reduce current consumption but there are better ways ie sleep. I suspect these low speed clock option are only included for a. 2 speed startup and b. fall back in the event of main clock failure.
    George.

  • 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.

  • #15
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    306
    Thumbs Up
    Received: 8
    Given: 1
    Total Downloaded
    6.95 GB

    0 Not allowed!

    Default Re: XTAL value for internal OSC 31KHz...

    Hi everyone,
    Maybe we're lucky and Les makes an update that can set any frequency.
    Les, thank you in advance.
    Teo

  • 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. [SOLVED !] Internal Osc control for PIC16F1847
      By Sterling101 in forum Proton Plus Compiler v3
      Replies: 25
      Last Post: 20th September 2012, 23:30
    2. Internal Osc and 19200
      By Tim in forum The Lounge
      Replies: 32
      Last Post: 15th September 2012, 17:19
    3. [SOLVED !] Internal OSC and PLL_REQ
      By peaps in forum Proton Plus Compiler v3
      Replies: 13
      Last Post: 6th March 2010, 13:42
    4. PIC16F628A Internal Osc.
      By Mohammed Tayem in forum Proton Plus Compiler v3
      Replies: 6
      Last Post: 27th February 2005, 21:21
    5. [SOLVED !] 18F4320 internal osc and bootloader
      By donomark in forum Proton Plus Compiler v3
      Replies: 1
      Last Post: 25th February 2005, 23:04

    Members who have read this thread : 47

    Actions :  (Set Date)

    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