Shop OBEX P1 Docs P2 Docs Learn Events
FIXED! - Pressing F10 sometimes works, usually doesn't. _CLKMODE = XTAL1 + PLL1 — Parallax Forums

FIXED! - Pressing F10 sometimes works, usually doesn't. _CLKMODE = XTAL1 + PLL1

W9GFOW9GFO Posts: 4,010
edited 2007-08-07 03:42 in Propeller 1
I'm working my way through the Propeller Manual. Right now I'm on page 133 and have run
into a quirk. When I press F10 to load Blinker2 into RAM it often doesn't execute as expected.
About 1 in 4 times it works properly. The other times a couple LEDs will turn on or some will flash
or nothing will happen. This only happens at PLL16X. Same behavior happens when loaded into eeprom
and the reset button is pressed.

Is this normal?

957362584_bd4e015b45.jpg

Post Edited (W9GFO) : 8/7/2007 3:40:42 AM GMT
«1

Comments

  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-31 00:46
    What propeller setup are you using?


    Post edit - I asked this before he had the picture or code posted.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.

    Post Edited (RinksCustoms) : 7/31/2007 6:17:51 AM GMT
  • W9GFOW9GFO Posts: 4,010
    edited 2007-07-31 00:49
    I'm using the Propeller Education Kit.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-31 01:24
    as i suspected. . . Make sure the crystal is securely in the pins on the breadboard, my first propeller setup was a DIP on a breadboard. I found that the breadboard was kinda picky about how and where the crystal was plugged in. Make sure it's also as close to the propeller as possible. I was successful in running the LED programs with up to 20MHz crystals, of course any crystal above 5MHz you should adjust your _FREQIN & PLL settings accordingly - The chip isn't very stable much above 128MHz on my breadboard.

    Breadboards, especially used ones aren't terribly reliable. Parallax has designed a very robust chip with the propeller, while nothing is certain, the possibility does remain you may have gotten a defective PLL, but i have never heard of dud's in the forums.

    If you need further help, you can IM me on yahoo. The button is just under my display picture on the right <---

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.

    Post Edited (RinksCustoms) : 7/31/2007 1:35:12 AM GMT
  • W9GFOW9GFO Posts: 4,010
    edited 2007-07-31 02:17
    I checked the crystal, and moved it closer to the propeller. There is no change in the operation. I can hit F10 all day long with it set to PLL8X or lower and it all works fine, but as soon as I set it to 16X I get weird behavior. I attached my code to the original post in case someone wants to double check something.

    Thanks for looking,

    Rich H
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-31 03:01
    Try using XTAL2, since a breadboard adds alot of capacitance, see if using a lower loading capacitance will help.

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

    Parallax, Inc.
  • W9GFOW9GFO Posts: 4,010
    edited 2007-07-31 04:03
    Ok, I changed XTAL1 to XTAL2. That's the only change I made. Nothing at all happens with it set this way.

    I would appreciate an explanation as to what you think is going on. I don't quite see why the crystal could be preventing the program from executing.

    Here's what happens (only with PLL16X) in more detail;

    Apply power to breadboard, hit F10, the program runs normally. So far it always works normally the first time loaded after it powers up.
    Hit F10 again, this time nothing happens
    F10 - now the first LED is on solid
    F10 - runs normal
    F10 - first LED is blinking rapidly
    F10 - nothing
    F10 - nothing
    F10 - nothing
    F10 - LEDs 1 & 2 blinking, LED 3 solid for a second then goes out
    F10- runs normally
    and so on...
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-31 04:43
    Im not entirely sure, I thought perhaps the extra capacitance of the breadboard was loading the crystal circuit beyond the Propeller's ability use it. I will discuss your issue with both the designer of the chip and the designer of the PE kit to see if we can determine what is causing your problems.

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

    Parallax, Inc.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-07-31 05:18
    The only problem I have had was fixed with a new 9volt battery. Can't hurt.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-07-31 06:07
    Hello!

    There is one red and one black wire going to the right from the crystal. I do not see any function there. Try removing them. They , together with the tracks, add capacitance that may be too much for the crystal.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • RinksCustomsRinksCustoms Posts: 531
    edited 2007-07-31 06:14
    Skogsgurra said...
    Hello!

    There is one red and one black wire going to the right from the crystal. I do not see any function there. Try removing them. They , together with the tracks, add capacitance that may be too much for the crystal.

    Look closer, they are connected to VDD & VSS

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-07-31 06:50
    OK. The xtl legs are not spread as far as I thought. Hmm...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • OzStampOzStamp Posts: 377
    edited 2007-07-31 06:58
    Hi W9

    The input pushbuttons on the right hand side are they connected properly
    Do you have the resistors pulling the inputs low ..?
    Maybe the inputs are just floating ( not connected to anything ?
    TO me it appears that the resistors are on the wrong side of the pushbutton switch

    Cheers
    Ronald Nollet Australia
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-07-31 07:27
    Yes, that's what it looks like. But, if they are ALPS PBs, there is an internal connection between the two lower pins and the two upper pins. So it should work as connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • BergamotBergamot Posts: 185
    edited 2007-07-31 14:36
    W9GFO said...
    I checked the crystal, and moved it closer to the propeller. There is no change in the operation. I can hit F10 all day long with it set to PLL8X or lower and it all works fine, but as soon as I set it to 16X I get weird behavior. I attached my code to the original post in case someone wants to double check something.

    Thanks for looking,

    Rich H

    That sounds very similar to an issue I was having with the PE Kit. It turned out I had fried something on the Propeller; a new one fixed it.
  • W9GFOW9GFO Posts: 4,010
    edited 2007-07-31 16:06
    Fred Hawkins said...
    The only problem I have had was fixed with a new 9volt battery. Can't hurt.

    That was one of the first things I checked, the battery was reading just above 7 volts, I replaced it with a fresh one - no difference.
    OzStamp said...
    The input pushbuttons on the right hand side are they connected properly
    Do you have the resistors pulling the inputs low ..?
    Maybe the inputs are just floating ( not connected to anything ?
    TO me it appears that the resistors are on the wrong side of the pushbutton switch

    Funny you should mention that. When I first put those buttons in they weren't working right - they were floating. It turns out that the ground rail inside the breadboard was broken, that's why the black wire is there on the far right side.
  • Tom WyckoffTom Wyckoff Posts: 26
    edited 2007-07-31 16:29
    I had a similar problem, except that pressing F10 or F11 would sometimes work and sometimes totally lock up the prop tool program.· I tried all the settings xtal1, xtal2, etc.· Finally replaced the crystal with a 9.8304 mhz rock and set the PLL to 8x and no more problems.· I can put the 5 Mhz crystal back and change everything to match, it just don't run but the same crystal stuck in an Atmel STK-500 works just fine.· Looks like I just got a weak or freaky crystal.· I didn't have any 5 Mhz's on the shelf, but I had a few of the 9.8304's so I used that.
    ·
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-07-31 22:11
    I've talked with the creator of the PE kit, we tried to look at your code but you didn't include everything, you reference an object called Output that you haven't included, so there is no way for us to check your code. Please post this object so we can look at your entire program.

    Try running the attached program which is a variation of the MiltiCogExample.spin code published in the Objects lesson of the PE kit. Make sure a momentary button is connected to P23, pressing the button each time will start a LED with the blink rate of the duration between presses. Continued presses will extinguish the LEDs in reverse order. We have varified this code works properly on a PE kit we have here.

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

    Parallax, Inc.
  • ratronicratronic Posts: 1,451
    edited 2007-07-31 23:00
    This maybe a stupid reply as I don't see very well but looking at the board is the ground connected together on both sides of the pchip, I've had a problem w/ a spin stamp before and don't know if it applys to a dip pchip.

    ···· Dave



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Fix it if ain't broke·
    D Rat


    Dave Ratcliff· N6YEE
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-07-31 23:11
    And make certain your eeprom doesn't have an outdated or wrong program in it.
  • big_markbig_mark Posts: 49
    edited 2007-08-01 09:41
    Shouldn't there be capacitors between the 3.3volt and ground pins, as close to the Prop as possible? Have a look at the demoboard schematic. To the left of the chip, there is a 1uf cap. between Vss and Vdd (ground and 3.3volts).
  • cgraceycgracey Posts: 14,133
    edited 2007-08-01 09:53
    big_mark said...
    Shouldn't there be capacitors between the 3.3volt and ground pins, as close to the Prop as possible? Have a look at the demoboard schematic. To the left of the chip, there is a 1uf cap. between Vss and Vdd (ground and 3.3volts).
    Yes, this could be the problem. The Propeller usually needs some local decoupling capacitance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-08-01 10:16
    Sinking beginner feeling, glub. Can someone illustrate local decoupling capacitance?
  • BergamotBergamot Posts: 185
    edited 2007-08-01 13:33
    Chip Gracey (Parallax) said...
    big_mark said...
    Shouldn't there be capacitors between the 3.3volt and ground pins, as close to the Prop as possible? Have a look at the demoboard schematic. To the left of the chip, there is a 1uf cap. between Vss and Vdd (ground and 3.3volts).
    Yes, this could be the problem. The Propeller usually needs some local decoupling capacitance.
    Wait, isn't that what the two capacitors on the middle top are for?

    The PE Kit instructions aren't showing any other capacitors that I know of.
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-08-01 13:39
    No, those are electrolytics. No good for decoupling. Too far away from processor supply pins, too. Try putting a 68 or 100 nF directly across processor supply pins. As close as possible. This is a fast chip and wire inductance has some influence.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • BergamotBergamot Posts: 185
    edited 2007-08-01 14:46
    Skogsgurra said...
    No, those are electrolytics. No good for decoupling. Too far away from processor supply pins, too. Try putting a 68 or 100 nF directly across processor supply pins. As close as possible. This is a fast chip and wire inductance has some influence.

    Well then, why is this not in the PE Kit instructions?
  • SkogsgurraSkogsgurra Posts: 231
    edited 2007-08-01 15:08
    Good question. It is perhaps supposed to be common knowledge?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • W9GFOW9GFO Posts: 4,010
    edited 2007-08-01 16:02
    I attached Output.spin to my original post.

    I tried the MulticogObjectExample program, This program runs about 50% of the time that I hit F10, maybe less. However it doesn't seem to run as described. Each button press lights up a new led but once they are all blinking no amount of button presses extinguishes them.

    Regarding the capacitors, I can see no capacitor on the schematic, drawing or photo that is included with the PE kit. I did grab a couple small capacitors that I had lying around and put them between GND and 3.3 right next to the chip but nothing would happen with them in place. Perhaps they were the wrong value, the ones I tried were .01uf.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2007-08-01 16:47
    Ah sorry, we commented out that portion of the code, so it works as expected. What message do you get when you press F10 and it doesn't work?

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

    Parallax, Inc.
  • BergamotBergamot Posts: 185
    edited 2007-08-01 17:25
    Skogsgurra said...
    Good question. It is perhaps supposed to be common knowledge?

    Maybe, but everything else is on there.

    Here's the insert that comes with the PE Kit. There's no capacitor like what you describe anywhere on the assembly diagram or the schematic.

    If it's so important that the propeller could fail without it, that's a pretty major oversight.
  • W9GFOW9GFO Posts: 4,010
    edited 2007-08-01 17:33
    There are no messages. It downloads into RAM the same way every time.

    A couple of time it has said that no propeller is found but if I unplug and plug back in the USB it works fine. I would think that we could rule out any problems on the PC end because I can load the program into eeprom, disconnect the prop plug and the same issues pop up. This time by hitting the reset button instead of F10.

    I've tried many times both with and without a single .1uf cap accross 3.3 and GND, the only difference that I can see is that when running Blinker2.spin at PLL16X sometimes random LEDs will light up rather than just the first couple - which is what was happening before. Most often the first LED will be blinking or on solid.

    Also, today the ratio of times that it runs correctly is better than before. The other day I was getting something like 1 in 4 times that it would run, today it's about 50-50. Again, the presence of the cap had no effect on this.

    Either program, Blinker2 or MultiCog... work all the time when set to PLL8X.

    Post Edited (W9GFO) : 8/1/2007 5:50:42 PM GMT
Sign In or Register to comment.