Shop OBEX P1 Docs P2 Docs Learn Events
With the new P2 Edge has the hubset value changed? — Parallax Forums

With the new P2 Edge has the hubset value changed?

Since the new P2 edge is not connect to a crystal should the XPPPP value always be 0pf?

And all frequency should be ok without fear of jitter.

MIke

Comments

  • jmgjmg Posts: 15,175

    The Xtal pF are not needed anymore, but I doubt you'd notice the difference in a pF setting, as there is a CMOS gate driving XIN.

  • cgraceycgracey Posts: 14,208

    Yes, 0pF would be the optimal setting.

  • evanhevanh Posts: 16,039
    edited 2022-02-09 21:55

    Mike,
    If you're using Spin2 then the preferred way is to use the compile time constants, eg The below will preset to 0 pF:

    CON
        _xinfreq = 20_000_000
        _clkfreq = 160_000_000
    
        ...
    
  • evanhevanh Posts: 16,039
    edited 2022-02-09 22:35

    If you want to do runtime changes with clkset() then decoding the compiled clkmode_ constant works out really well for a generic routine to discover board config. Note, it's not _clkmode nor clkmode. I've got more detail if you're interested.

  • evanhevanh Posts: 16,039
    edited 2022-02-09 22:30

    FlexC has the equivalent of the same for board config. Place an enum in the top level source file, eg:

    enum {
        _xinfreq = 20_000_000,
        _clkfreq = 160_000_000,
    };
    

    And FlexC can import the same Spin source for runtime clkset()ing.

Sign In or Register to comment.