Shop OBEX P1 Docs P2 Docs Learn Events
Counter application question — Parallax Forums

Counter application question

BTXBTX Posts: 674
edited 2008-06-27 00:24 in Propeller 1
Hi all.
I want to generate a clock of 24Mhz with the pchip.
Using counter in NCO mode, that signal at output will have jitter, cause the value of FRQA <> 2**N.
So, how much jitter ? Could be the signal generated usefull for clocking another processor/FPGA ?
Or, should I use another method for this ?
I need a relative stable 24Mhz, clock, 48Mhz clock, and maybe a 25Mhz clock too.
Just only for some tests... in my FPGA board.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards.

Alberto.

Comments

  • LeonLeon Posts: 7,620
    edited 2008-06-26 21:29
    Why not use a standard oscillator module with the FPGA's PLL (assuming it has one)?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • BTXBTX Posts: 674
    edited 2008-06-26 21:35
    Thanks Leon.
    But my FPGA has only one, and I'm using it.
    And I'm needing about two external clks more.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-06-26 22:26
    Wrt 24 and 48 MHz, the easiest way of producing clean signals is to swap out the 5MHz crystal with a 6MHz crystal. That way for a 96 MHz system clock, a 24MHz signal will flip the state every other clock cycle (clkfreq/4), and a 48 MHz signal will flip the state every clock cycle (clkfreq/2).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • RaymanRayman Posts: 14,233
    edited 2008-06-26 23:05
    I was thinking you could use the cog's counter and PLL to generate a wide range of freqs...
  • RaymanRayman Posts: 14,233
    edited 2008-06-26 23:35
    Upon further reflection, I see the problem... Still, with a dedicated cog, I think you can make those frequencies...

    If you put a number like 5000 in PHSA and put the counter in NCO mode and then have the cog monitor the MSB of FRQA and reset FRQA to 0 (or some number) when a toggle is detected, I think you can make more stable frequencies...
  • BTXBTX Posts: 674
    edited 2008-06-27 00:24
    Yes, yes !! thank you guys .
    Paul idea is easy, just put my frqa := $4000_0000 for 24Mhz and/or frqa := $8000_0000 for 48Mhz with 6MHz xtal.

    @Ray. Your idea sounds very good too !! Just only a little bit of programming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
Sign In or Register to comment.