piglet 14 Posted October 17, 2012 Share Posted October 17, 2012 Hi, I'm new to the forums, the MSP430 range - and electronics generally, so please be gentle with me I have a nicely working circuit and code based around an MSP430G2553 with a 32K crystal and some shift registers to display output. I've moved the MCU from the TI Launchpad to a breadboard - and am now trying to work out how to (mains) power it and am hitting problems I cannot work out how to fix. The issue: When I use a mains powered transformer the crystal does not oscillate. Symptoms: 1) It works perfectly when powered from my PC's USB, into the launchpad and 3.3V pins to the breadboard. 2) It works perfectly when directly powered from a couple of AA rechargable batteries in series. 3) The crystal does NOT start when powered from a 5V usb hub power supply, into the launchpad and 3.3V pins to the breadboard. 4) The crystal does NOT start when powered from a reasonable quality 3.4V regulated mains power supply to the breadboard. 5) The crystal does NOT start when powered from a A1117-3.3 based 12V to 3.3v MB102 Breadboard Power Supply on the breadboard. With both 3) and 4) the crystal does start, and the circuit runs for about 3 seconds on residual power when the PSU is switched off and the circuit is draining the PSU Caps! Turning back on again before the juice stops...the crystal stops again. In each case 3 to 5 everything else works. The MCU reacts to button presses, and controls the shift registers as expected. The only thing that isn't happening is the clock "tick". Things I've tried to see if I can kick the crystal into life: I've tried three different crystals (of the same type). All work as described above. I tried telling the microcontroller to use 10pF caps rather than 12.5pF - the crystal still works with PC power, not with hub power. I reverted to 12.5pF caps for the following tests. I've tried a 10pF capacitor from XIN to GND - no apparent difference - the crystal still works with PC power, not with hub power I've tried a large resistance from +v to XIN (5*470K in series ~= 2.35M as this is the largest my little electronics kit had!) - the crystal still works with PC power, not with hub power. I've tried putting large and small electrolytic capacitors across the power inputs in an attempt to smooth the power, with no apparent effect. I really am stumped. As I'm going to be running a reasonable number of bright LEDs all the time I do want to power this from a mains adapter. As I'm a new user the forum will not let me link to the crystal and breadboard power supply circuit: w w w emartee com Attachment.php?name=41960.pdf - breadboard PSU circuit w w w maplin co uk timing-crystals-480 - the crystal I'm using Please can you give any help to get this working? Thanks in advance. Quote Link to post Share on other sites
gordon 229 Posted October 17, 2012 Share Posted October 17, 2012 Um, how do you know what load capacitance does this particular crystal need? May be my junk filter or something, but I can see zero technical info on this Maplin page. Also, what's the physical arrangement of things on your breadboard? A photo would be nice. Does the rest of your kit work when the crystal doesn't? Also try the osc fault indicator thingy in various arrangements (I think it was on Justin's blog last I remember?), what does it suggest? Quote Link to post Share on other sites
piglet 14 Posted October 17, 2012 Author Share Posted October 17, 2012 Hi Gordon, Yes, everything else is working fine when the crystal isn't. The buttons do what they should, the lights light up like they should. All that doesn't occur is the crystal's interrupt . I'll see if I can find that blog. *edit* I can't find it - please could you point me in the right direction (I'm new to the site and don't know my way around!) The crystal specs are there on the "Specification" tab. Nothing too interesting. It doesn't give an ESR. It also doesn't paste well into here! 3.2768MHz Divide by 2n, 16 times for 50Hz Freq Can Adjust Temp Load Style Tol Stability Cap 32.768kHz TC38 Quote Link to post Share on other sites
cubeberg 540 Posted October 17, 2012 Share Posted October 17, 2012 Could you connect the power to an ADC pin and take measurements? You should be able to see a difference in the measurements. I've got a MaxADCLite which might do the job - you can get one for free from maxim. Quote Link to post Share on other sites
piglet 14 Posted October 17, 2012 Author Share Posted October 17, 2012 I failed the intelligence test on that site. Clicking on "Request your Free MAXADCLite Evaluation Kit, NOW!" takes me to a page with no option to get one that I can see. Quote Link to post Share on other sites
gordon 229 Posted October 17, 2012 Share Posted October 17, 2012 http://justinstech.org/2010/07/msp430-l ... t-how-too/ Try this in various arrangements. Given that you said you had put in bypass caps, I don't really think power is your problem, I rather wager physical arrangement. Crystals don't pay particularly nice with breadboards and like to fault in all curious ways if load capacitance is thrown off even by a tiny bit... Trim your crystal legs such that they are the shortest possible, put it in the breadboard as close to the MCU as possible, and avoid any wiring anywhere close (for a very generous definition of "close") to it (under, over, near, etc.). It probably wouldn't hurt to ground the can either with an as short as possible wire -- lay the crystal flat, if the can reaches over the breadboard power lines, don't run power on that side just ground, and ground the can there. And variations thereupon. Quote Link to post Share on other sites
piglet 14 Posted October 17, 2012 Author Share Posted October 17, 2012 Thanks. I've just got home and tried on a bare launchpad. Nothing attached but the MCU and the can, and the onboard 1.0 LED. It again works when launchpad is powered from PC usb, and not when powered from a 5v mains adaptor. The two methods of powering both result in identical voltages at the launchpad 3.3v pins. I'm still stumped, but at least it rules out the rest of the circuit and the breadboard. Standard "Test your crystal" code from the web: #include #define LED BIT0 void main(void) { int i; // internal counter WDTCTL = WDTPW + WDTHOLD; // turn WDT off P1OUT = 0x00; P1DIR = LED; BCSCTL3 |= XCAP_3; // xtal has 12.5 pF caps TACCR0 = 16383*2; // f_xtal / 2 - 1 gives 2 Hz TACTL = TASSEL_1 + MC_1 + TACLR; // ACLK + Up Mode + Clear timer for (; { while ((TACTL & BIT0) == 0) { // wait for timer to reach TACCR0 } TACTL &= ~BIT0; // reset TAIFG P1OUT |= LED; // LED on for (i=0; i<0x314; i++) { // short delay } P1OUT &= ~LED; // LED off } } // main Quote Link to post Share on other sites
piglet 14 Posted October 17, 2012 Author Share Posted October 17, 2012 Hurrah! I found a 12v 6A quality PSU which used to power my NAS. That hammer to crack a nut gives a supply that the crystal likes when plugged into the breadboard 12v->3.3v thing. That's what I call overkill. There's something about lower quality supplies that the crystal objects to. Quote Link to post Share on other sites
touch 34 Posted October 17, 2012 Share Posted October 17, 2012 I've seen some cheap power supply's that have no isolation or use half wave rectification, both of which could cause problems. Stay away from the cheap Chinese supply's, they're junk. Quote Link to post Share on other sites
cde 334 Posted October 18, 2012 Share Posted October 18, 2012 That, or use a set of decoupling caps. (1uf, 0.1uf, 0.01uf) This helps at multiple frequencies. Also, how are you wiring it on the breadboard? Breadboards and crystals tend not to get along (alot of stray capacitance). Quote Link to post Share on other sites
piglet 14 Posted October 18, 2012 Author Share Posted October 18, 2012 As I put in my previous post I get the same thing on the launchpad directly - so it's definitely a power supply issue. The "failing" ones I was using were fairly weighty ones bought with brand-name switches, routers, and usb hubs. I'd have expected more than the usual cheap knock-off psu's with them - if for no other reason than it'd mean they'd get fewer returns & support issues that way which would cost them more money! Quote Link to post Share on other sites
jsolarski-backup 22 Posted October 18, 2012 Share Posted October 18, 2012 most power supplies are cheap.... even for name brand equipment, I found out the hard way when making an amplifier, 7 out of the 10 wall warts that I tried (from netgear, linksys, ericson, HP and some unknown brands from other equipment) had horrible noise on them...both switched and un-switched.....My thought is that most equipment builds in its filters for cheap power supplies. Quote Link to post Share on other sites
G0XAR 19 Posted November 11, 2012 Share Posted November 11, 2012 I guess the problem power supply you had did not deliver a high enough voltage for the voltage regulator to output the voltage required by your processor. You should check the data sheet for the device. I have a lot of success using mobile phone chargers especially from a reliable brand, e.g. Sony, Motorola. Quote Link to post Share on other sites
roger430 12 Posted November 21, 2012 Share Posted November 21, 2012 I recently purchased some watch crystals from China. I ordered 10 they sent me 60. Anyway, they have the following specifications: Load Capacitance: 12.5pf Equivalent Resistance: 35K Frequency Tolerance: 20 ppm Operating Temp Range: -20C to +70C I breadboarded up a test circuit using a MSP430G2553 and could not get the oscillator to start. I used two AA batteries for power, an excellent 3.3v mains power supply and a cheap charger type power supply with a 3.3v regulator (LM1117T) to no avail. To get the oscillator to start, I had to place a 10M resistor in parallel with the crystal. It then worked with the AA batteries and the 3.3v mains power supply. It did not startup with the El Cheapo charger until I added a 100mfd 25v capacitor across the charger output. The circuit now runs with all three power supplies and is dead on accurate and stable (32768HZ) according to my Frequency meter. Quote Link to post Share on other sites
Wide 0 Posted June 20, 2013 Share Posted June 20, 2013 As I put in my previous post I get the same thing on the launchpad directly - so it's definitely a power supply issue. The "failing" ones I was using were fairly weighty ones bought with brand-name switches, routers, and usb hubs. I'd have expected more than the usual cheap knock-off psu's with them - if for no other reason than it'd mean they'd get fewer returns & support issues that way which would cost them more money! I had exactly the same problem when trying to run my application on an own build PCB with an usual Power supply. Then i decidet to give it an try and i used an Professional supplay and evrything worked as it should. i have to say Thx Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.