![]() | ![]() | ![]() |
| |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
![]() |
| | Tools |
| | #1 |
|
Hi I have a problem with 16f877a. I build a PCB for this PIC component. After programming (for example I wrote blinking LED), LED is off, but when I touch XTAL, LED turned on continuously. I change XTAL several times but outcome was the same. My XTAL is 20MHz and Caps 33pF. | |
| |
| | #2 |
|
That's why the XTAL's body must be soldered to GND and ofcourse the PCB's GND must be rastered.I think this method will solve your problem. P.S. You can use oscillators insted of XTAL.They are more stabile. | |
| |
| | #3 |
|
Can you send the start of your code (where you define PIC, OSC, etc)? Do you have any 20pf caps? Maybe try swapping the 33 for something smaller. | |
| |
| | #4 | |
| Quote:
| ||
| |
| | #5 |
|
Thank you very much for your Helps and advertises, my code is written as follows: PROCESSOR 16F877A #INCLUDE "P16F877A.inc" #INCLUDE "HESAM.INC" __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC CBLOCK 0X20 HICNT LOCNT LOOPCNT ENDC ORG 0X00 BANK3 MOVLW 0X02 MOVWF ADCON1 BANK1 MOVLW 0X00 MOVWF TRISE BANK0 MOVLW 0X00 MOVWF PORTE MAIN: MOVLW 0X01 MOVWF PORTE PAUSEMS 500 MOVLW 0X02 MOVWF PORTE PAUSEMS 500 MOVLW 0X04 MOVWF PORTE PAUSEMS 500 GOTO MAIN END | |
| |
| | #6 |
|
1. you must use HS_OSC 2. Be sure you connect all VSS lines and all VDD line 3.as suggested, try something in between 15-33pF 4. be sure your MCLR pin is tied to VDD via resistor 5. Be sure you'd place capacitor (0.1uF) as close as possible of your PIC. For this one, i suggest 2, one on each side as you have VDD and VSS on both side of it. | |
| |
| | #7 |
|
As suggested, use smaller capacitors, check my tutorial hardware at http://www.winpicprog.co.uk/pic_tuto...ain3_board.htm which uses 12pF ones. You don't mention how you're building it?, but you need as short a leads as possible, both to the crystal and from the capacitors to 0V. As also suggested, it's important that you select HS_OSC, which is for high speed crystals. | |
| |
| | #8 |
|
Your problem may be that you have not disabled LVP in the configuration fuses and you have left the PGM pin 'floating'. I've seen these symptoms described many times and easily corrected by reprogramming the PIC with the LVP option in the config' fuses turned off. Regards, Mike Last edited by Mike, K8LH; 16th July 2006 at 08:33 PM. | |
| |
|
| Tags |
| pic, problem, xtal |
| Thread Tools | |
| Display Modes | |
| |