Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 29th July 2004, 12:04 PM   #1
Default Testing a crystal oscillator in circuit

Hi, I just posted a question about a related problem in the General Chat lounge, but I also have a question on programming/running a PIC16F627.
I am trying to rule out problems on a Velleman kit board, I am able to program a chip on it and read/verify the data, but on selecting RUN with a switch, the chip fails to function.
Is the oscillator on OSC1 / OSC2 required during the programming phase? I removed the OSC, and was able to program the chip, but I wonder whether the crystal is faulty.

The circuit diagram is available at the following URL:
http://www.velleman.be/Downloads/0/Manual_K8048_UK.pdf Page 10.
Any guidance?
McGuinn is offline  
Old 29th July 2004, 12:48 PM   #2
Default

The oscillator is not required for programming...

-Did you verify the program (read it back out and compare to the original) , to see if it was programmed correctly?
-Did you place the correct jumpers on the board to connect the crystal to the right socket where your 16f627 is installed (JP3 - JP4)...
-Did you set the switch to PGM when programming and to RUN when running the software?
-Are you sure the program you uploaded to the pic is without bugs ?
-Did you set the configuration word to the right oscillator (XT) ?

To test your oscillator you could always set the 16f627 oscillator to use the internal 4Mhz oscillator (be sure to disconnect the crystal if you try this)
Exo is offline  
Old 29th July 2004, 01:24 PM   #3
Default

Quote:
Originally Posted by Exo
The oscillator is not required for programming...

-Did you verify the program (read it back out and compare to the original) , to see if it was programmed correctly?
The programs were provided by Velleman, so I am making an assumptions that it is OK. It compiles OK in MicroChip's HEX compiler. 3 other programs don't work either.
Quote:
-Did you place the correct jumpers on the board to connect the crystal to the right socket where your 16f627 is installed (JP3 - JP4)...
Yes, jumpers are OK.
Quote:
-Did you set the switch to PGM when programming and to RUN when running the software?
Yes. (thats basic!!!)
Quote:
-Are you sure the program you uploaded to the pic is without bugs ?
No bugs that a verify picks up...

Quote:
-Did you set the configuration word to the right oscillator (XT) ?
Not sure, I only saw the configuration code late last night. I do remember XT appearing in one section.
Quote:
To test your oscillator you could always set the 16f627 oscillator to use the internal 4Mhz oscillator (be sure to disconnect the crystal if you try this)
What is the reference to change this? INT-OSC??? (guessing)

I have a feeling that there is an electrical issue on the board. I have an LED which fails to light intermittantly, it's LD9 on the circuit diagram. It is a flashing LED, but only lights up fully, or not at all... I will replace it with another LED as it may be a misnomer.
I have double checked the resistor values/transistors/etc, and have checked for bridges between solder joints. As I said, programming is OK, RUN is not...

EXO... thanks for your assitance on this and the other query...
McGuinn is offline  
Old 29th July 2004, 01:42 PM   #4
Default

Yes, INT-OSC is the pics internal oscillator...

LD9 seems to be a special led with a 'blinker' build in... It's not required for normal circuit operation , its just an indiation power is on and you should not remove the pic.
You can just remove the led and give it a try if you think the led's to blaim.

once a pic is programmed it needs very little to run. when in run check there is 5V on pin 14 and pin 4.
Exo is offline  
Old 29th July 2004, 02:23 PM   #5
Default

Exo, they are the points I chose to test also. I'll complete this tonight.
I suspect the LED is damaged as it never worked correctly, it is supposed to flash but doesn't. It has it's own current limiter built in, so I'll install a resistor and standard LED in it's place.
McGuinn is offline  
Old 29th July 2004, 05:39 PM   #6
Default

Don't forget MCLR, did you use a resistor to +V or tie it up internally?
lavenatti is offline  
Old 30th July 2004, 02:56 PM   #7
Default

Hi guys, I tested the board last night.
I found that all the voltages are OK (5v to Vpp and Vcc when in RUN).
I then loaded another program, (supplied by Velleman for the kit) and noticed that it lit one LED. It's supposed to be a running LED display...
I managed to edit one part of the code to change the light display, and it worked... So now I know that the problem is code related...

I'll work to correct it, and let the guys at Velleman know.
That's three faults I have found with the kit so far.

Thanks for assistance.
McGuinn is offline  
Reply

Tags
circuit, crystal, oscillator, testing

Thread Tools
Display Modes




All times are GMT. The time now is 03:08 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker