External oscillator not working
joshrl
Posts: 10
Hi,
I'm having a problem getting an external oscillator to work with my prop. I am able to run programs with the internal clock fine, but when I switch to the external clock (by setting _clkmode, and _xinfreq) the program doesn't seem to run (LED's don't light). I've tested the oscillator on the propeller demo board and it works fine so I don't think its the oscillator. If its important, the oscillator I am using is the 5.00C5X from Digikey. I've also tried several other oscillators with no luck. Here is the source code and a picture of the curcuit.
Is it possible there is something wrong with the prop. chip?
Thanks,
Josh
I'm having a problem getting an external oscillator to work with my prop. I am able to run programs with the internal clock fine, but when I switch to the external clock (by setting _clkmode, and _xinfreq) the program doesn't seem to run (LED's don't light). I've tested the oscillator on the propeller demo board and it works fine so I don't think its the oscillator. If its important, the oscillator I am using is the 5.00C5X from Digikey. I've also tried several other oscillators with no luck. Here is the source code and a picture of the curcuit.
CON _clkmode = xtal1 + pll16x 'comment out these 2 lines and the program runs fine _xinfreq = 5_000_000 Delay = 3_000_000 PUB Toggle dira[noparse][[/noparse]16]~~ dira[noparse][[/noparse]17]~~ dira[noparse][[/noparse]18]~~ repeat !outa[noparse][[/noparse]16] waitcnt(Delay + cnt) !outa[noparse][[/noparse]17] waitcnt(Delay + cnt) !outa[noparse][[/noparse]18] waitcnt(Delay + cnt)
Is it possible there is something wrong with the prop. chip?
Thanks,
Josh
Comments
I couldn't find that part on DigiKey's website. But your photo shows a crystal, not an external oscillator. A crystal should work, though, as long as it has some built-in capacitance (15 -20pF should be enough). It might also be that there's too much internal capacitance and cross-coupling in your wireless breadboard. Breadboards are often unsuitable for things like oscillation circuits for that reason. If all else fails, you could try bending the Propeller's crystal leads upward and soldering the crystal directly to them.
-Phil
Nothing wrong with your code, but you do need current limiting resistors of at least 100 Ohms for your LED's.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I tried setting _clkmode to %0_1_1_00_111 but I get a compile error: "Invalid _clkmode specified". xtal1 + pll16x does work on the demo board which seems to be using an external crystal, so not exactly sure why it would be a problem. thanks.
I don't see any bypass caps in your photo. You need at least one of 0.1uF or more right next to the Propeller. Cut the leads short. It would be best to connect the Vdd and Gnd pins on both sides, too, with a cap on each side. While you're at it, bypass the EEPROM supply as well.
-Phil
-josh
Your aluminum electrolytics, while certainly helpful, don't really qualify as bypass caps. What you need are some 0.1uF ceramic caps inserted into the breadboard right next to the Propeller chip — not out on the supply rails. Be sure to cut the leads as short as possible. I can't say that this will solve your oscillator problem, but it is good practice and will eliminate that variable.
Which regulator are you using, BTW? Most regulators require an output cap placed very near the regulator for stability. Check the regulator's data sheet for the value and type. It will specify two things: capacitance and ESR (equivalent series resistance). In most cases, a 10uF tantalum will satisfy both requirements.
Finally, be sure to try Mike's suggestion to increase the crystal drive, in case breadboard capacitance is the issue.
-Phil
The 0.1uF ceramic caps are intended to handle very very short power surges on the order of microseconds to nanoseconds so lead length is important.
-Phil
thanks for all your help.
-josh
Can you check to be sure that your 3.3V supply is steady? It would be good to look at it on a scope and be sure that the voltage does not dip down when the crystal is engaged. This might be tripping the brownout detector which·resets the chip. Also, try connecting BOEn high and putting a 10K resistor between RESn and VDD. That will disable the brownout detector and pull RESn high.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
From your picture, it looks like there is no cap connected to the output of the 3.3V TO-220 regulator. It needs to go between the GND and Vout pins. Also, an input cap might help to (between Vin and GND).
These caps need to plug into the same contacts that the regulator uses - right next to it!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Post Edited (Chip Gracey (Parallax)) : 10/17/2006 8:01:50 PM GMT
Unfortunetly, we have no scope but we did add 10k resistors b/w RESn and VDD. We also did the same for BOEn, not sure if this is what you meant though. Finally, we also added the 10uF Cap to Vout on regulator. Still no go.
Since you circuit seems to work fine with the internal 12MHz the only other problem could be:
a) the crystal itself
b) poor regulation at higher current/frequency (decoupling caps!!!)
c) Does pin 40 (RxD) need a pullup resistor in the absence of a signal to drive it? (I see a bare header)
d) dunno
This is just a guess mind you.
*Peter*
The output voltage may be difficult to measure without a scope. If it's a CMOS oscillator, you can probably just attach a voltmeter and double the reading to estimate the value for "high". If it's a TTL oscillator, that might not work, since the "low" may be higher than zero.
-Phil
Graham
*Peter*