Shop OBEX P1 Docs P2 Docs Learn Events
Clocking mystery — Parallax Forums

Clocking mystery

Putting together a circuit using the PropStickUSB it suddenly started behaving very strange. The code that ran and executed fine yesterday, does not execute today. To see if the P was still operational, I added code (from Examples to be sure) to switch on P0 powering a LED. Did not light up - but if I load the naked blinker code only, it blinks. After some more variant tests it appears that the code works only when there is no 5 MHz parameterization.

Does not work:
CON

          _clkmode = xtal1 + pll16x
          _xinfreq = 5_000_000                                      'use 5MHz crystal
        
          clk_freq = (_clkmode >> 6) * _xinfreq                     'system freq as a constant
          mSec     = clk_freq / 1_000                               'ticks in 1ms
          uSec     = clk_freq / 1_000_000                           'ticks in 1us     (80 ticks)

PUB Toggle
  dira[0]~~
  repeat
    !outa[0]
    waitcnt(3_000_000 + cnt)

Does work:
PUB Toggle
  dira[0]~~
  repeat
    !outa[0]
    waitcnt(3_000_000 + cnt)

Beats me. Have I burned the crystal maybe? I seem to be in a blue smoke period.
Is there a 'examine yourself and report' piece of code somewhere?

Erlend

Comments

  • BTW, I tried to replace the crystal, it had no effect.

    Erlend
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-05 13:21
    You have managed to damage the PLL, probably through excessive ground currents due to improper wiring of the load. You have to replace the chip I'm afraid. You could try running slower at pll8x for the moment, it might work. Could you describe how you have this hooked up?
  • I am not sure if it is LM2940 acting up, or it is myself, but I am reaching an impressive 'burn rate' at present. I have the required capacitors at both input and output of the chip, but it's cobbled together on a proto-board. I have definitely a very low self esteem right now, as regards beeing capable of soldering together a stable PSU. Historically, it is with PSU design I tend to get into trouble. Seem to remember that the 7805 never was any trouble, though.

    Anyway, I can tick the box on PLL-burning too, obviously.

    Erlend
    (becoming a tiny bit desperate)
  • If you're using an LM2940, be sure to follow the guidelines for input and output caps to the letter -- not only capacitance, but ESR values. It's not as forgiving as a 7805.

    -Phil
  • I'm not sure if the posters know that this is a complete module, designed by Parallax. All caps are on board.

    https://www.parallax.com/product/32210

    I tend to agree with Peter:
    You have managed to damage the PLL, probably through excessive ground currents due to improper wiring of the load.

    but I'm not sure how that would come about.

  • Publison wrote:
    I'm not sure if the posters know that this is a complete module, ...
    You're right: I missed that detail in the first post. So forget my post about caps.

    -Phil
  • ErlendErlend Posts: 612
    edited 2017-02-05 19:03
    You are both right. The module comes with a 5V->3.3V regulator, but to take the voltage down from 13.6V to 5V I needed to make my own regulator. That's the one acting up. I will buy some 7805s to use from now on. Alternatively, I'd like to buy something like the power circuitry that sits on the PDBoard, it is generously sized and takes a high input voltage with no problems (LM1086), providing solid 5V and 3.3V.

    Erlend
  • That's a large voltage drop for a linear regulator. Save yourself some grief and use one of these instead:

    http://www.digikey.com/product-detail/en/recom-power/R-78E5.0-0.5/945-1648-5-ND/2834904

    -Phil
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-02-05 22:16
    LDOs are great for "low dropout", being able to work to less than a volt input/output differential so there is never any need to use them for much larger input voltages where a regular regulator :) will do. However switching reg modules are cheap these days and are the way to go, the R-78E Phil mentioned is a 3-pin 7805 pin compatible device, no heatsink required.

    IMO only hobby designs try to use linear regulators where they should/need to use switching regulators. If your circuit needs 200ma at 3.3V then the switching regulator will only take around 70ma or so from the 12V instead of wasting all that extra power as heat like a linear regulator. You might get by with a linear reg but as soon as current demand increases it can put a strain on the linear reg which will shut-down on thermal overload but also ends up charring the board and prematurely drying out the electrolytics over time.
  • Cluso99Cluso99 Posts: 18,069
    Agreed, I use the R-78E5.0-0.5 too!
  • Here's another consideration about the PropStickUSB...

    Whilst there is an on-board LDO with the required capacitors, the Propeller chip itself does NOT have any bypass caps. These should be added at the breadboard, as close as possible where the PropStickUSB module plugs in. Not having these bypass caps in place (or having them with an unreliable connection, ie. breadboard wobble), could well explain having PLL issues as was suggested earlier.

    There is a pdf here which shows the connections- check page 2, titled "Improve PE Kit Supply Voltage Stability". Although this is for another kit, the circuit and benefit is the same for PropStickUSB : https://www.parallax.com/sites/default/files/downloads/32305-PEKit-40-PinDIP-Enhancements-v1.0.pdf

  • VonSzarvas wrote: »
    Here's another consideration about the PropStickUSB...

    Whilst there is an on-board LDO with the required capacitors, the Propeller chip itself does NOT have any bypass caps. These should be added at the breadboard, as close as possible where the PropStickUSB module plugs in. Not having these bypass caps in place (or having them with an unreliable connection, ie. breadboard wobble), could well explain having PLL issues as was suggested earlier.

    There is a pdf here which shows the connections- check page 2, titled "Improve PE Kit Supply Voltage Stability". Although this is for another kit, the circuit and benefit is the same for PropStickUSB : https://www.parallax.com/sites/default/files/downloads/32305-PEKit-40-PinDIP-Enhancements-v1.0.pdf

    I find that incredible that this pcb was done without bypass caps for the Prop on the pcb. No wonder with those huge HC49 crystals that continue to be used. If whoever designed the board put a tiny smd crystal of 6MHz or 10Mhz in there or even a 5Mhz oscillator like this cheap little 2.5mm x 2mm component, then there would be room for bypass caps. Even so, at least pads could be made available on the underside even if Parallax didn't want to handle this as a double-side assembly.

  • Sounds like R-78E5.0-0.5 is going to be my pain saver going forward. Thanks for the good advice. Thanks also for the tip about adding caps to the PropStick.

    Erlend
  • Wow, I did not realize that such a powerful and capable regulator could go into such a tiny package!
    Looking forward to begin soldering.

    R78E.jpg

    Erlend
Sign In or Register to comment.