Clocking mystery
Erlend
Posts: 612
in Propeller 1
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:
Does work:
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
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
Erlend
Anyway, I can tick the box on PLL-burning too, obviously.
Erlend
(becoming a tiny bit desperate)
-Phil
https://www.parallax.com/product/32210
I tend to agree with Peter:
but I'm not sure how that would come about.
-Phil
Erlend
http://www.digikey.com/product-detail/en/recom-power/R-78E5.0-0.5/945-1648-5-ND/2834904
-Phil
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.
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.
Erlend
Looking forward to begin soldering.
Erlend