Shop OBEX P1 Docs P2 Docs Learn Events
run time PLL change not affecting clkfreq — Parallax Forums

run time PLL change not affecting clkfreq

Bobb FwedBobb Fwed Posts: 1,119
edited 2009-02-13 16:48 in Propeller 1
I am trying (for the first time) to change the PLL on the fly (using xtal) to adjust clock speed, but it doesn't change clkfreq which means that anything based on that stops working correctly (like anything to do with serial information). Is there some way to set it? Or do I have to do some messy conversions off of CLKMODE and alter the existing objects?

Comments

  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2009-02-13 16:46
    oh..nermind. Duh, the second parameter sets the current frequency, not the xtal frequency.
    I got that part figured out.

    But, FullDuplexSerial doesn't seem to update. I re-ran the start method after I changed the frequency. Whatelse do I need to do?
  • Bobb FwedBobb Fwed Posts: 1,119
    edited 2009-02-13 16:48
    And again...I figured it out (typo)...disregard this whole thread.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-13 16:48
    CLKFREQ is just the long word at location 0 (0-3 actually). If you use the CLKSET function in Spin (see the manual) to change the clock mode, it will update location 0 for you.

    FullDuplexSerial, like many time-sensitive I/O drivers, does its timing calculations in its initialization method only. Some Spin-only objects use CLKFREQ directly and may be able to adjust without reinitializing. Basic_I2C_Driver, for example, only uses CLKFREQ for its timeouts and doesn't precalculate the time.

    Post Edited (Mike Green) : 2/13/2009 4:55:06 PM GMT
Sign In or Register to comment.