Shop OBEX P1 Docs P2 Docs Learn Events
Crystal question — Parallax Forums

Crystal question

Tom WyckoffTom Wyckoff Posts: 26
edited 2007-07-20 01:47 in Propeller 1
Actually two questions. Is the 5 Mhz crystal included with the Propeller Education Kit a series or parallel resonant type? If I use a 4.00 Mhz external crystal what, if anything, do I need to change in the serial communications driver to get the proper baud rate, other than changing the frequency setting in the spin program?

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-18 19:34
    Parallel, the header is all that needs to be changed to reflect the new crystal speed.

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

    Parallax, Inc.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-18 20:37
    Cool! Thanks. It really cracks me up to think that serial communication is easier to set up on the propeller than it is on other micros that have a built-in UART.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-19 01:14
    It's odd, but I am unable to get my propeller to run with any other crystal that I have, of any speed. Can you tell me the exact part number of the 5 Mhz crystal in the kit. It looks like an ECS crystal and I want to order some. A Digi-Key part number would be even better if you have that.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-19 01:47
    You do have to change your programs (and recompile them) to match the crystal speed otherwise they won't work. Look at the _XINFREQ and _CLKFREQ sections of the Spin Programming Guide in the Propeller Manual.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-19 05:30
    Thanks, I missed the _clkfreq section. I changed _CLKMODE & _XINFREQ to the settings for other crystals, I'll have a look at _CLKFREQ. Thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-19 05:33
    The Spin compiler computes the third value from any two of _CLKMODE, _XINFREQ, and _CLKFREQ.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-19 09:05
    I put a 4 Mhz crystal and changed _XinFREQ to 4_000_000, left _clkmode at xtal1 + pll16x.· The program compiled and loaded, but did not run.· Pressing F10 a second time also hangs up the propeller tool program.· I know I'm missing something important, but I have no idea what it might be.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-19 21:29
    Tom, 4 Mhz is on the low end of what the PLL is rated for. Try eliminating the pll16x from your _clkmode statement to determine if this is the root cause. If it runs (albeit slowly) you'll know the PLL isnt capable of locking onto 4MHz (it should be able to, but try this to eliminate the possibility).

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

    Parallax, Inc.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-20 01:20
    Give that man a cigar! I popped in an 11.05 Mhz rock and set the pll to 4x for 44 Mhz and it runs. It didn't run at all with the 4 Mhz crystal, even without the PLL in there. 4 Mhz might be on the low end of what the oscillator can do as well. I have an extra propeller chip and eeprom, but no 5 Mhz crystals which is why I was trying to make it fly with another crystal. Thanks for all the help!
  • Mike GreenMike Green Posts: 23,101
    edited 2007-07-20 01:31
    Tom,
    You might also try the different xtal1/xtal2/xtal3 settings (see the chart in the manual). They change the load capacitance and are recommended for different crystal frequencies. You should be able to run the Propeller off a 32KHz crystal (not with the PLL) for low power applications like timekeeping.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-20 01:47
    I did that Mike, but the 4 Mhz crystals I have might very well be series resonant types, I have no idea how to tell the &&$&^%*&P)*&^*& things apart and I bought them so long ago the paperwork is dust by now. I just needed an option to make a second propeller chip run, and I have it now.

    Now in an upcoming lab they would just use one of those infrared receivers to record some signals from a TV remote and re-send them so I can build an automatic channel scroller for my girlfriend. One button for start, another for stop so she don't wear out the batteries in my remote, I'll be in heaven.
Sign In or Register to comment.