View previous topic :: View next topic |
Author |
Message |
Bart
Joined: 12 Jul 2005 Posts: 49
|
How to check Xtal oscilator ? |
Posted: Thu Jul 28, 2005 8:44 am |
|
|
As newbee in PIC's I have some basic questions.
As I tryed to program my first pic (with a LVP kabel) and after re-applying the 5 Volts to me PIC, my led on RA0 won't blink. (I am, after reading lot of forum messages, pretty sure of my program.)
So, or my programming wen't wrong, or me xtal won't osilate.
Question 1:
Will an xtal (20Mhz) osilate on a not programmed PIC16F877 (installed with cap's and 5 V applyed) ?
Question 2:
If you have a 20 Mhz xtal connected at the PIC, can you still use the internal oscilator with the xtal connected ?
Thanks in advance for reply's.
Greetings from belgium. _________________ I like Skype (www.skype.com), my username is BplotM |
|
|
Ttelmah Guest
|
|
Posted: Thu Jul 28, 2005 8:59 am |
|
|
For part1, 'probably not'. Most of the registers default to '1' from the factory, and this is the 'RC' oscillator mode.
The 16F877. does not have an 'internal oscillator'. It has the components to 'build' an oscillator with external parts, but cannot generate a clock at all without these parts. This differs from some other chips, where there is a tuned internal RC oscillator available. There is no oscillator available without external components. The best way to test is to apply a clock to the CLKIN pin. This will operate whatever the oscllator mode is set to.
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Thu Jul 28, 2005 5:09 pm |
|
|
A couple of thoughts:
1) 20MHz is the top of the XTAL spec. Do you have any lower fequency crystals? If you have something between 1MHz and 5MHz there may be more margin for error.
2) PICs are graded for speed. Not all PICs sold will run at the highest speed. Look carefully at the part number printed on the chip to see if it should run at 20MHz.
3) How are you wiring the crystal and caps to the PIC? DO NOT try to use one of those white plastic tile solderless breadboards at 20MHZ. They have horrible parasitics. I wouldn't use them for any mounting any uP chip.
4) Do you have any external oscillator you can use? Or could you use the RC oscillator mode for a test? That would isolate a clock problem from a programming problem. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Thu Jul 28, 2005 9:35 pm |
|
|
Getting a scope for this kind of problems, life is easier.
If you canīt borrow a scope, a PMS (poor man solution) is to get a frequency counter.
If you canīt afford a frequency counter, a VPMS (very poor man solution) is to build your own.
http://lea.hamradio.si/~s57nan/ham_radio/fc_led_2/fcl2.html
Best wishes,
Humberto |
|
|
Bart
Joined: 12 Jul 2005 Posts: 49
|
Tested with full oscilator. |
Posted: Sat Jul 30, 2005 3:17 pm |
|
|
Hello
Thanks for replying.
In the meantime i did some test with lower freq. xtals (as supposed in the replys) and I removed some real oscillators from old boards (this one : http://www.foxonline.com/PDFS/f1100e.pdf )
The fox xtal is an 16 MHz. with I mounted on a real small board so I could apply GND and 5V to it and inject the OUT on pin 13 CLKIN of the 16F877.
I verified also the 16 Mhz. oscillator with my scope and it worked.
So now I am pretty sure that my PIC isn't programmed.
I think I will look for a better (low cost) LVP programmer.
Thanks for all replys.
Best greetings. _________________ I like Skype (www.skype.com), my username is BplotM |
|
|
|