Shop OBEX P1 Docs P2 Docs Learn Events
Help: New to propeller chip. set clock, set pll, timer function. — Parallax Forums

Help: New to propeller chip. set clock, set pll, timer function.

DarkGFXDarkGFX Posts: 17
edited 2013-11-12 09:54 in Propeller 1
Hello, I'm totally new to the propeller chip, and hope someone could help me with my first project.

I'm programming the propeller in C using SimpleIDE.

I'm looking for a way to manually set the clock frequency, and to configure the PLL to max settings.
Using a 5MHz crystal, and want the chip to run at 80MHz.
Have been playing around with the clkset(mode,frequency) command with no success. It wont compile!

I'm also wondering about a good timer function.
because I want 7 cogs to send my main cog the time when they got trigged, with the best accuracy possible.

Hope someone could help.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2013-11-11 17:51
    CON
            _clkmode = xtal1 + pll16x                                               'Standard clock mode * crystal frequency = 80 MHz
            _xinfreq = 5_000_000
    

    This will do it.

    Oops, didn't see the part about C. Sorry bout that.
  • DarkGFXDarkGFX Posts: 17
    edited 2013-11-11 23:05
    Thats ok!
    I fugured it out late last night why the compiler did't compile!

    clkset(0b01101111,80000000); command needs to be in the main function, or another function. I tried to declare it together with the global variables.

    Still need a really good timer function, so hope people can help =P
  • jazzedjazzed Posts: 11,803
    edited 2013-11-12 09:54
    Propeller GCC uses board config files to set the clock parameters. Parameters are set by the loader.

    The idea is that you can run the same code without any changes on different boards.
Sign In or Register to comment.