Shop OBEX P1 Docs P2 Docs Learn Events
Simple program hangs up when I add Xfreq and clkmode — Parallax Forums

Simple program hangs up when I add Xfreq and clkmode

PotatoPotato Posts: 18
edited 2009-08-05 19:25 in Propeller 1
The simple program:

'' File RP_Servo1.spin

CON

_xinfreq = 5_000_000
_clkmode = xtal1+pll16x


PUB LedON 'method declaration

dira :=1 'set P4 as output pin
outa :=1 'turn on LED

repeat 'endless loop



When I add the three lines:
CON
_xinfreq = 5_000_000
_clkmode = xtal1+pll16x

the Propeller seems to just not work, ie will not execute and turn on the led.

If I comment out _xfreq and _clkmode the program runs and turns on the led.

Any ideas?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-04 20:43
    You haven't said what your configuration is. Which board are you using? Do you have a 5MHz crystal attached to XI and XO?

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-04 20:44
    Jon,

    I think the bracketed "4" disappeared and caused the font to change size.

    -Phil
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-08-04 20:53
    Aren't this the symptoms of a killed PLL? Read about that in other thread - so long did not have this problem myself. But in case you did something wrong with the power supply, you can kill the PLL. This Prop then will only work in buildin RC-mode.

    So, if you are sure that the crystal works, this might be the reason.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-08-04 21:28
    MagIO2,

    It sounds suspicious, but I didn't want to bring that up before I knew more about his configuration. Hopefully, it's something more benign.

    -Phil
  • SRLMSRLM Posts: 5,045
    edited 2009-08-04 22:23
    When a program seems to hang for no reason, I always check to make sure that I haven't lost the crystal.
  • PotatoPotato Posts: 18
    edited 2009-08-05 00:18
    OK, Found the problem. I am using a breadboard, 40 pin dip Prop chip with 5 MHz crystal. something on the breadboard is flakey.
    When you put me on the trail of the PLL, I changed the PLL setup to PLL8X and the code works.
    Somehow the sloppy wiring of the breadboard prevents the PLL16X from working.
    I took the same code and ran it on a Parallax demo board and it works fine.
    Thanks to all who answered.
    Potato
  • MagIO2MagIO2 Posts: 2,243
    edited 2009-08-05 19:25
    Maybe PLL16X would work with other XTAL settings then? My understanding is that the XTAL defines which internal capacitors to use. If your breadboard adds some parasite capacitance, then another XTAL setting might work.
Sign In or Register to comment.