Guest sstandfast Posted January 10, 2003 Report Share Posted January 10, 2003 Hey, I don't really have a problem anymore I was just wondering why doing what I did solved the problem that I had.I am new to PIC's and circuits in general but have recently taken an interest in both. Â I am starting out slowly, working my way up until I feel confident enough to build the project that got me interested in PIC's; a remote control for my PC so I can remotely sort through all my .MP3's on my computer. Â But I am rambling.Anyway, when building my first test circuit, the "Hello World" for PIC's, I designed a circuit that would flash an LED on RB7 of my 16F877. Â It seamed simple enough, a couple of resistors, capacitors, an LED and my PIC and I was on my way. Â Here is a link to the schematic that I have drawn up of my simple test circuit. Â http://www.angelfire.com/my/shawnspage/flash.sch The circuit itself was simple enough to layout on my breadboard, and after finding an old power supply for a Commodore 64 I was ready to rock-and-roll.I plugged in the 5V supply and sat back and waited for that glorious moment where my sense of accomplishment would glow along with the LED. Â Well I waited and I waited and I waited and nothing happened. Â Needless to say I was disappointed. Â So I grabbed my trusty DIMM and Logic Probe and went to work trying to trace down my problem. Â I could find no hardware glitches right away. Â I had 5.21V on both MCLR and Vdd. Â I was registering 2.5V on pin OSC2/CLKOUT and 2.15V on OSC1/ClKIN. Â But RB7 was not changing like it was supposed to. Â It was remaining a constant low; I was reading 0V on that pin w/respect to ground. Â So it seamed to me that the chip was not executing the program that was programmed onto it. Â But to make a long story short, I had tried to reprogram the chip several times to no avail and was about to rebuild the circuit on the breadboard when I solved the problem.Like I said, I was about to rebuild the circuit again, just to make sure that it was wired correctly when I discovered my problem. Â What happened was, having forgotten that I still had power applied to the circuit, I simply grabbed hold of both of the capacitors that were on the crystal and yanked them out. Â I then jumped back in surprise. Â THE LED CAME ON! It went right back out again, but it came back on a half-second later. Â The LED was flashing! Â What this means, I think I know but I am unsure of and that is why I wanted to ask you guys to make sure. Â I think what was happening is that the capacitors that I was using were keeping the crystal from oscillating like it is supposed to. Â Normally I would attribute this to the caps. being to large for their purpose but they are only 0.022uF (0.022 microfarad) which is 22.0 picofarad if I’m not mistaken. Â The crystal is connected across the two OSC/CLK pins on the chip while the two caps are connected in series with each pin to ground.If anyone has any idea as to why the oscillator is working without the caps in place any information you can give will be greatly appreciated. Â Until then, I will just continue to watch as my pride turns on and off with the flash of an LED.Thanks,Shawn Quote Link to comment Share on other sites More sharing options...
Dave_Wheeler Posted January 10, 2003 Report Share Posted January 10, 2003 Hey Shawn, Well done. ::)The first step is the biggest !!!!OK. What I think is happening is that the capacitance of the stripboard between adjacent tracks is probably in the order of 30pF and can be much more on longer tracks. When you fit the capacitors 0.022uF which is actually 22000pF or 22nF there is far too high a value of capacitance. Removing the caps is giving enough from adjacent tracks for the xtal to oscilate (bad spellin !)Be very careful with capacitor values as there are 1000pF to a nF and 1000nF to a uF. Also the value of capacitors in parralell is the opposite to resistors, with caps in paralell C = C1+C2 where resistors would be 1/R = 1/R1+1/R2.Good luck and well done.Dave Quote Link to comment Share on other sites More sharing options...
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.