PDA

View Full Version : simple LED Blinking project



koossa
- 10th December 2004, 11:48
Hi Picers

I have developed a few Pic projects without any problems in the past, but
now I'm struggeling with a simple LED Blinking project.

I have double check my circuit and replaced every component, but without any
luck.
The voltage on the MCLR pin is there, but the LED pin is dead, which tell me
that the pic did not start.

Attached is my PCB or it can be viewed at http://www.rieme.co.za/Question/PCB.gif.

Here is my code:
_________________________________________________
Include "Modedefs.bas"

DEFINE OSC 20 ' Set the Xtal frequency to 20mHz
MYLED Var PORTB.7 '

ADCON1 = 7
Main:
High MYLED
Pause 1000
Low MYLED
Pause 1000
goto Main
end
__________________________________________________

Thank you
Koos

Dwayne
- 10th December 2004, 14:16
You probably need
TRISA=00000000

this tells your chip that all your pins are outputs.


Dwayne

Ingvar
- 10th December 2004, 15:45
Hmmm, deja vu, i've been answering your messages on the mailing list.

1. Check that your LED isn't the wrong way around.
2. Make sure that you set HS oscillator in your programmer.

/Ingvar

koossa
- 10th December 2004, 16:02
Thank you for your feedback

I have found the problem.
The Pic run at 20Mhz and I'm designing everything on a breadboard.

The copper tracks inside the Breadboard generate it's own capactance and when putting 15pf caps on the Crystal, it does not run.
If I remove the Caps it run.
What I did is put the Pic in a 40 Pin IC Socket, cut the 2 pins on the IC Socket for the crystal and directly connect the crystal and 2 caps to the pins on the IC Socket (and not through the breadboard's wholes)

Now it is running smoothly.

NavMicroSystems
- 11th December 2004, 01:25
Originally posted by Ingvar
Hmmm, deja vu, i've been answering your messages on the mailing list.
/Ingvar

... I had the same feeling.

regards

Ralph