Shop OBEX P1 Docs P2 Docs Learn Events
very quick crystal clcok question for prop proto boardH — Parallax Forums

very quick crystal clcok question for prop proto boardH

mikedivmikediv Posts: 825
edited 2009-08-05 23:24 in Propeller 1
Hi guys I have a bunch of Crystals that are rated at 6.856777 MHZ they work fine but I have just been using the statement
"_CLKMODE = XTAL1 + PLL16X"""""""
" XINFREQ = 6_000_000"""""

It works but I was wondering if or could I use the whole clock speed XINFREQ = 6.856777"" Would I be able to clock the prop chip faster
by using the whole clock value?? or does spin only take whole values for the crystal clock?

Comments

  • Bill HenningBill Henning Posts: 6,445
    edited 2009-08-05 02:13
    Yes, you should use 6.856777 as otherwise all the serial, video and other timing will be off by 14.27%
    mikediv said...
    Hi guys I have a bunch of Crystals that are rated at 6.856777 MHZ they work fine but I have just been using the statement
    "_CLKMODE = XTAL1 + PLL16X"""""""
    " XINFREQ = 6_000_000"""""

    It works but I was wondering if or could I use the whole clock speed XINFREQ = 6.856777"" Would I be able to clock the prop chip faster
    by using the whole clock value?? or does spin only take whole values for the crystal clock?
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheus & Mem+ Advanced dual Propeller SBC with XMM and 256 Color VGA - PCB, kit, A&T available NOW!
    www.mikronauts.com - my site 6.250MHz custom Crystals for running Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • BradCBradC Posts: 2,601
    edited 2009-08-05 06:44
    mikediv said...
    Hi guys I have a bunch of Crystals that are rated at 6.856777 MHZ they work fine but I have just been using the statement
    "_CLKMODE = XTAL1 + PLL16X"""""""
    " XINFREQ = 6_000_000"""""

    It works but I was wondering if or could I use the whole clock speed XINFREQ = 6.856777"" Would I be able to clock the prop chip faster
    by using the whole clock value?? or does spin only take whole values for the crystal clock?

    No and No are the answers to that.
    You are already clocking the Prop at the speed for that crystal (the clock speed is the physical crystal value * PLL - 16 in your case). The only thing the XINFREQ statement does is set long 0 in the propellers memory to the actual frequency calculated by XINFREQ * your requested PLL value.

    So changing that won't make the prop go any faster. As Bill said above though, a lot of the objects use that value to calculate timing information, so if your actual clock frequency is different from what you tell the propeller it's going to be, your timing will be wrong.

    You are running your Propeller at 109.7 Mhz but you are telling it you are running at 96Mhz. Your timing will all be about 14% fast.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • BADHABITBADHABIT Posts: 138
    edited 2009-08-05 08:03
    Would this method of "tricking" the timing result in a higher input frequency capability?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    BH skull.gif
  • BradCBradC Posts: 2,601
    edited 2009-08-05 13:29
    BADHABIT said...
    Would this method of "tricking" the timing result in a higher input frequency capability?

    No

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • mikedivmikediv Posts: 825
    edited 2009-08-05 23:05
    Thanks guys ,, OK so that didn't resolve anything, I tried to find answer in the prop manual but not much luck their either.

    Trying to understand what Brad is saying but if I try to use a value other than a whole number for "_CLKMODE = XTAL1 + PLL16X" that will not fly

    So short of just not using these crystals is there a way to use them or not, I don't need to.... I do have whole number crystals was just hoping I could over drive the prop with them
    Then on the other hand I have quite a few crystals I salvaged from other project boards from my past it seems lots of them used odd numbers
    I have quite a few 5.23456 and a handful of 3.5788 and even 4.2345
  • lonesocklonesock Posts: 917
    edited 2009-08-05 23:24
    mikediv said...
    Thanks guys ,, OK so that didn't resolve anything, I tried to find answer in the prop manual but not much luck their either.

    Trying to understand what Brad is saying but if I try to use a value other than a whole number for "_CLKMODE = XTAL1 + PLL16X" that will not fly

    So short of just not using these crystals is there a way to use them or not, I don't need to.... I do have whole number crystals was just hoping I could over drive the prop with them
    Then on the other hand I have quite a few crystals I salvaged from other project boards from my past it seems lots of them used odd numbers
    I have quite a few 5.23456 and a handful of 3.5788 and even 4.2345
    Just to be clear, _XINFREQ is an integer, and has units of Hertz. So you would not literally use 5.23456, you would say 5234560, or using the spacers 5_234_560. The underscores are ignored by the compiler, they are just there to allow us to make the numbers readable, or group the digits however you would like.

    Jonathan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lonesock
    Piranha are people too.
Sign In or Register to comment.