Shop OBEX P1 Docs P2 Docs Learn Events
Crystal Startup ? — Parallax Forums

Crystal Startup ?

CannibalRoboticsCannibalRobotics Posts: 535
edited 2008-07-16 19:28 in Propeller 1
I have built a prototype on my own board. I have tested all of the connections to the propellor chip. The basic timing support circuit is identical to the demo board. The external memory is a Parallax supplied memory routed exactly as on the demo board.
The chip programs via the Propellor tool and responds via the prop plug.
All of the I/O pins check out and run fine as long as I do not initialize the external crystal.

Any code that uses the:

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

instructions locks up. As far as I can tell, it never executes a single instruction.
On the scope, it looks like the crystal is starting but it is sitting on a 75Hz sine wave. A capture of the wave form is attached. I've checked all of the power lines for noise and they are clean. I have changed the crystal out too.

Any ideas.... Anybody .... Anybody....
640 x 480 - 147K

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-02 18:47
    Set _clkmode to plain xtal1 or RCFAST, does it work then? If so you fried your PLL and will need to replace the Propeller.

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

    Parallax, Inc.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-04-02 22:04
    It works with RCfast but not the plain xtal1 does not?
  • LeonLeon Posts: 7,620
    edited 2008-04-02 22:41
    Replace the Propeller chip.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-04-03 00:19
    Ouch. Sorry CannibalRobotics.

    I have plans for several designs using the Propeller. I have seen problems like CannibalRobotics posted every now and again here on the forum. Is there something that can be done with external circuitry that helps to protects this failure from occuring? I assume it is occuring because of electro-static discharge or improper voltage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-04-03 00:38
    Take sensible ESD precautionssmile.gif

    If you look at the data sheet the power supply pins only take a 3kV spike which is fairly easy to get. The i/o pins however will take more than 8kV which is a lot harder to generate.

    If you could find a way of including some resistance on the power supply pins it would probably help.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-03 01:16
    OK, since people keep asking, I'll try to explain what's going on more fully and precautions which can help lessen the likelyhood of PLL failure. Inductive flyback and ground loops are the predominate causes for PLL failure. This is not a "poor design" on the part of the Propeller, rather something is done by the operator in thier design which causes abnormal conditions, and the PLL happens to be the weak point (if we strngthened it, the failure would occur somewhere else).

    If you are driving any coils, such as in a relay, be sure the coil has a reverse biased diode to sink the collapsing field and doing it on the transitor driver too doesn't hurt. Failure to do so will dump the charge onto the supply, into the Propeller and fry the PLL.

    Ground loops occur when two points which are supposed to be an equal potential (such as the ground connections on two chips) are not the same potential. First, while it not directly related, all chips whose current consumption can rapidly change (such as anything containing·logic gates, ie all digital chips) should have a bypass capacitor, this helps to remove noise on the power supplies. Second the ground connections need to have as little resistance as possible, this means wide traces (This should be done for power too), and ideally the ground is a plane (and in 4+ layer designs power are planes as well). Take a look at the back of any Parallax product, see how the entire area is filled with copper? That is the ground plane, and it is there to minimize the potential for ground loops.

    Also ALL propeller supply pins should be connected to the·other supply pins·at the Propeller (Vdd to Vdd, Vss to Vss), not doing this can cause a ground loop inside the Propeller. And never, ever use the Propeller's supply pins as a pass through (power supplied on one pin in turn supplies other components on another power pin not externally connected to the first pin, this is true for Vdd and Vss). You will be creating a ground loop if you do this.

    Also in situations where multiple boards are connected together the common ground connection should be as hefty as practical. There's also issues with seperate AC powered boards, they should get thier power from the same outlet if possible (since ground loops can happen through your house/office's electrical system as well).

    Lastly there is a phenomena with how current flows through the ground plane, it follows the path of the supply trace on the other side. Strange, but true. You should avoid breaking the path it wants to follow with any traces since it has to go around it, or at least minimize the distance it has to detour.

    We follow these design rules and thus far have never had a design where the PLL failed.

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

    Parallax, Inc.

    Post Edited (Paul Baker (Parallax)) : 4/3/2008 2:03:22 AM GMT
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2008-04-03 01:45
    Thank you Paul for the detailed response. Is this information enough to create an application note target at those designing with the Propeller? I know most of these practices adn thing to look for are standard practices in the industry, but with the market that Parallax appeals to a tutorial/application note/education material that trains users in the above could be beneficial.

    Again, thank you for clarifying and elaborating on what could be done to design a more robust system.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Timothy D. Swieter

    www.brilldea.com·- check out the uOLED-IOC, an I/O expansion for the uOLED-96-PROP
    www.tdswieter.com
    One little spark of imagination is all it takes for an idea to explode
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-03 01:57
    No problem, if you encounter PLL failure after these steps have been taken let us know. Also I added another point to the previous message I had forgotten about (the sentence starting "Lastly").

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

    Parallax, Inc.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-04-03 03:16
    Well, this is all well and good but I followed those procedures - fat power lines, beefy grounds, bypass caps on the power supply lines and finally, the power lines to the propellor don't spread out to the four pins until they are directly underneath the chip. The only two chips on the board that use the 3.3 supply are the memory and the propellor. Tomorrow is a new day, I'll let you know what happens next.
    Jim-
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-03 03:48
    Jim, send me a PM with your address and the package type and I'll send you a replacement.

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

    Parallax, Inc.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-04-03 13:00
    Thanks Paul. Look for an email subject 'Forum Discussion'
    Jim-
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2008-04-04 14:19
    Paul Baker (Parallax) said...


    1...·be sure the coil has a reverse biased diode to sink the collapsing field and doing it on the transitor driver too doesn't hurt.


    2...·all digital chips should have a bypass capacitor, this helps to remove noise on the power supplies.

    3... seperate AC powered boards, they should get their power from the same outlet if possible (since ground loops can happen through your house/office's electrical system as well).
    Paul, can I pester you for schematics to illustrate a least the first two items?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-04 19:11
    Fred,
    This is exactly the same as with the Stamps and is described in several Stamp tutorials including the Industrial Control tutorial.

    1) I use a 1N4001 50V 1A diode, but lots of others will do. The cathode (banded end) is attached to the positive supply voltage end of the coil. The anode (other end) is attached to the ground end of the coil (usually towards the I/O pin). I've also used a 1N914 diode or a 1N4148 diode for reed relay coils.

    2) This is usually a 0.1uF 50V ceramic capacitor connected between the Vdd and Vss (positive supply and ground) pins of the chip physically close to the chip Vdd and Vss pins. With small (less complex) chips like discrete logic gates, you can often get away with one capacitor shared between two physically adjacent chips.
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-04-04 21:16
    Just to clarify·that last·point that Paul made about ground planes.· DC follows the path of least resistance, while AC follows the path of least impedance.· This isn't always the same path.· In the case of AC, the return current on the ground plane follows under the trace because that is where the inductance and therefore impedance is the least.· If you break that path, the return current has to go around the obstruction and that opens an inductive loop, increasing the impedance in the ground plane.

    Although they draw low average power, CMOS devices draw rather large current spikes while switching, which adds a lot of AC to the power lines.

    Hope this makes things a little less mysterious.

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


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • PhilldapillPhilldapill Posts: 1,283
    edited 2008-04-04 21:17
    I've had this problem with a fried Propeller recently. I was using a small relay(as Paul mentioned above). The relay was to simply isolate the propeller circuit from a gate opener. The thing worked fine for about 3 months, until one day, I decided to reprogram something in it, so I took it out of the gate opener enclosure, brought it inside, and it wouldn't work. Turns out it WAS the PLL since RCFAST worked. I didn't have a diode in there with the relay, but I must have had some static discharge or something else.

    Regardless, I've installed a new chip on the demo board and added a diode. Works great again.

    Oh, and thanks again for all that helped with my problem.
  • CannibalRoboticsCannibalRobotics Posts: 535
    edited 2008-04-05 13:17
    Wow, what a response!
    The board design is pure DC driven by batteries. The only inductive load element anywhere near the system is a 6vdc power supply rail for 8 servos. I've got bypass caps on either end of that. It's physically situated near the prop but there is a ground plane separating the header and the chip. The ground plane on the bottom of the board extends roughly 1/4" inch around the outside of the prop.
    Jim-
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-04-05 18:17
    Hey Jim, can you post a picture of the front and back of your board? (Layout capture is fine if you turn the other copper layer off) I'm curious to see if I can detect if anything is up. If you don't want to publish it, you can email it to me and I won't show anyone else.

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

    Parallax, Inc.
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-05-14 12:51
    I suggest you also add a 1uF Tantalum capacitor on the supply line together with the 0.1uF capacitor, especially if you are switching high currents or inductive loads.

    All IC's should have a 0.1uF bypass on the supply line.
  • kubakuba Posts: 94
    edited 2008-07-16 18:17
    You obviously have inductive loads: all the servos are inductive and some generate quite a bit of commutator noise on the power rails. Most "cheap n' easy" voltage regulators act almost like short circuits for fast transients. You may want to look at your circuit with a good, sensitive scope, using proper probing techniques -- your goal is to see how effective the regulator is at clamping short overvoltage transients.

    Circuit behavior will also depend *a lot* on the board layout: you typically don't put parasitics on the schematic, but they are there!

    Posting reasonable pictures of the board's top/bottom would really help in assessing what may be wrong.

    Note that probing high-frequency/wideband noise requires proper techniques, which are unfortunately relatively unknown to a lot of people [noparse]:([/noparse] To get a glimpse of what may be involved, read Linear Technology's app note AN70 - A Monolithic Switching Regulator with 100mV Output Noise. That appnote is lengthy for a good reason.

    Silence is the perfectest herald of joy -- Shakespeare
  • Dave HolowiskiDave Holowiski Posts: 3
    edited 2008-07-16 18:44
    Just wanted to say thanks. I am having the exact same problem, and I found this doing a search on the forums. I breathed a sigh of relief when I realized I used a IC socket rather than soldering directly to the board!
  • Dave HolowiskiDave Holowiski Posts: 3
    edited 2008-07-16 18:58
    So much for that idea... just tried two more propeller chips - same problem. Does anyone have any more suggestions? Exact same problem, with a home built board the same as the demo board. RCSLOW and RCFAST work fine, XTAL1 does not.
  • Dave HolowiskiDave Holowiski Posts: 3
    edited 2008-07-16 19:28
    Sorry for so many posts... figured out my problem after being very patient. There is something wrong with my crystal.
    The following code causes the LED to flash at about 2hz. I think the crystal is running around 5hz instead of 5mhz!

    CON
    _CLKMODE = XTAL1 + PLL4X
    _XINFREQ = 5_000_000

    PUB Toggle
    dira[noparse][[/noparse]16]~~
    repeat
    !outa[noparse][[/noparse]16]
Sign In or Register to comment.