Crystal-less operation


Today 08:45
Forum: The Lounge
Starter: normnet
Views: 0
Replies: 2
Yesterday 15:38
Forum: Proton Plus Compiler v3
Starter: gdesantis
Views: 0
Replies: 4
+ Reply to Thread
Results 1 to 9 of 9

Thread: Crystal-less operation349 days old

  1. #1
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,857
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Crystal-less operation

    Has anyone successfully used a 18F2xJ50 to run fs USB without an external crystal? If so could you post the CONFIG?

    I had a google around but nothing jumped out.
    George

  2. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,857
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Re: Crystal-less operation

    This is most confusing. Table 3-5 shows FS on internal clock but the remark in 3.4 seems to disprove it
    bla bla will allow the application to meet low-speed USB signal rate specifications.
    George

  3. #3
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,090
    Thumbs Up
    Received: 102
    Given: 23
    Total Downloaded
    1.51 GB

    0 Not allowed!

    Default Re: Crystal-less operation

    USB more or less requires a crystal since the internal oscillator is not accurate enough. Though, according to the datasheet, for this device INTOSC is accurate enough, but only for low speed USB.

  4. #4
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,857
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Re: Crystal-less operation

    I'm sure you are correct but what about the table 3-5 second from bottom, 8MHz?
    Last edited by towlerg; 3rd January 2018 at 05:22.
    George

  5. #5
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,090
    Thumbs Up
    Received: 102
    Given: 23
    Total Downloaded
    1.51 GB

    0 Not allowed!

    Default Re: Crystal-less operation

    Low speed USB only (24 MHz)

  6. #6
    Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    385
    Thumbs Up
    Received: 71
    Given: 0
    Total Downloaded
    154.34 MB

    0 Not allowed!

    Default Re: Crystal-less operation

    It 'works' for USB FS, but spec-wise it's not guaranteed, esp. across temperature and voltage.
    The int osc typ spec is 0.15% which is good enough, but the max is 1% which is way too large (USB FS requires 0.25%).

    I wouldn't use it in a commercial application, but here's the settings if you want to play around:
    Code:
       OSC = INTOSCPLL,
       PLLDIV = 2,              // 8MHz/2 (need 4MHz -> 96MHz PLL)
       CPUDIV = OSC1,           // no cpu divider... 1:1 (CPU clock=48MHz)
       CFGPLLEN = ON,
       LS48MHZ = SYS48X8
    You may have to adjust the freq using the OSCTUNE register (Set REFOCON = $A0 and you can monitor the clock output on RB2).

    AFAIK, the only 18F series w/an int osc accurate enough for FS are the K50 and J94 devices.

  7. #7
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,857
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Re: Crystal-less operation

    Thanks all, think I'll go with the 25K50. Pity about the J though, it looks so good on paper (dual serial and PPS), I could just use a crystal of course. Will post clock, ACT and TUNE code if I get it working.
    Last edited by towlerg; 3rd January 2018 at 13:29.
    George

  8. #8
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,214
    Thumbs Up
    Received: 18
    Given: 0
    Total Downloaded
    614.99 MB

    0 Not allowed!

    Default Re: Crystal-less operation

    Hi George, I am not sure if line 2 comments are correct but this worked for me on an 18F25K50 on intosc


    Code:
      PLLSEL = PLL3X    ;3x clock multiplier 3 x 16 = 48
      CFGPLLEN = On     ;PLL Disabled (firmware controlled)
      CPUDIV = NOCLKDIV    ;CPU uses system clock (no divide)
      LS48MHZ = SYS48X8    ;System clock at 48 MHz, USB clock divider is set to 8
      FOSC = INTOSCIO   ; internal oscillator, no clock out on RA6
    '  FOSC = INTOSCCLKO    ;Internal oscillator, clock output on RA6 OSC2
      PCLKEN = On    ;Primary oscillator enabled
      FCMEN = OFF    ;Fail-Safe Clock Monitor disabled
      IESO = OFF    ;Oscillator Switchover mode disabled
    My RAM is failing

  9. #9
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,857
    Thumbs Up
    Received: 163
    Given: 162
    Total Downloaded
    3.24 GB

    0 Not allowed!

    Default Re: Crystal-less operation

  10. Following on from See_Mos's post, happy to report fs seems to work quite happy crystal-less. The built-in USB version works out of the box but due to a register change a small mod is needed to new stack, USBSystem.inc, change

    Code:
        IPR2bits_USBIP = 0              ' Yes. So USB Interrupt Priority set to Low
    Code:
        $if _device = _18F25K50 Or _device = _18F24K50 Or _device = _18F45K50
          IPR3bits_USBIP = 0              ' Yes. So USB Interrupt Priority set to Low
        $else
          IPR2bits_USBIP = 0              ' Yes. So USB Interrupt Priority set to Low
        $endif
    I can post CONFIG and clock initialize if anybody needs it.
    George

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. explaining Hser operation
    By Mr Anderson in forum Absolute Beginners Section
    Replies: 8
    Last Post: 15th February 2017, 23:05
  2. Boolean Operation
    By johngb in forum Proton 24
    Replies: 6
    Last Post: 14th February 2017, 22:24
  3. [SOLVED !] String Operation
    By mazlan in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 27th November 2007, 02:16
  4. Timer operation? (and FSK operation)
    By shunt010 in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 5th November 2005, 16:59

Members who have read this thread since 5th December 2018, 05:25 : 1

Actions :  (Set Date)  (Clear 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