Newbie - Can't Swith LEDs

Started by Andy Laurence March 13, 2004
--- In , "Andy Laurence" <andy@a...> wrote:
> I've just started in the world of PICs. I have an Ad-Teknik Elvis
> programmer that does smart cards, and 18-pin PICs. I also have the
> associated MP6 programming software. I've programmed a PIC16F84A
> (http://www.andylaurence.co.uk/TEST.HEX or
> http://www.andylaurence.co.uk/TEST.ASM or
> http://www.andylaurence.co.uk/test.bas), and this should pulse A0-3
> and B0-7 high every 100ms. So, I should see 5 flashes a second
from
> the LEDs connected to the ports. I've built the circuit on a
> breadboard, and applied 5vdc. There is a single LED connected to
> RB0, but it does not light.
>
> I've checked with a multimeter, and everything appears correct,
> except there is no pulse to the pin. As this is just a test (I'm
> building myself up slowly), I'm not sure whether it's my software
or
> the circuit I've built. The program is so simple, I can't see how
it
> could be wrong, but the same for the circuit. Any help/guidance
> appreciated. If you're interested in my longer term aims, take a
> peek at http://ha.andylaurence.co.uk/lighting/index.shtml

Hmm, I haven't read the rest of the answers yet but my first guess is
this. 100mS is really fast. What might be going on is that it is
flashing but its flashing so fast that you don't see it. The LED
should be flashing 10 times per second not 5. 100mS *10 =1Second. A
voltmeter will not catch this. You need an oscilloscope to see the
signal. the other option is to slow the signal down. Have it turn on
and off every 2 seconds. My advacie is to go to e-bay and buy an
oscilloscope. I have an analog tektronix 3340a which does a good job
and only cost $250 US dollars including shipping. If you can get a
digital one even better. 20 to 60MHz should be more that enought and
a minimun of 2 probes or channels.

Anyways, what I would do is test the LED separately on a bread board.
Thenmake sure that the MRCL pin is held high through a 1K ohm
resitor. Also the watchdog timer must be off (OFF OFF OFF) THe watch
dog timer must be OFF. DI I mention thewatch dog timer should be OFF.

Go to the manufactures website and read their FAQ section, they
usually have the most common problems already answer.

Finally, I have the X1 experimenter board from melabs. and the
picprogramer from the same peope. I found that when some of the pins
are used I cannot program my PICS. I have had to disconect a few pins
from my circuit in order to program the pic then hook them back
again. I don't why this is. What I'm trying to say is program the pic
separately. test that all the circuit work properly without the pic.
Then hook up the pic. Also, you might want to look into FED PIC. This
is a compiler for pics but is in C. Its cheaer thanthe picbasic pro
and has a lot of build in tools like LCDS displays and buttons that
you can use to trouble shoot your program. A good debbuger goes a
long way for sanity check.
>
> Cheers,
> Andy
> --
> http://www.andylaurence.co.uk
> http://ha.andylaurence.co.uk