PDA

View Full Version : 16F676 Really simple, stupid problem - Help!



Jayhovah
- 30th April 2008, 05:15
Okay I have a VERY strange issue.

If I set both PORTA.0 and PORTA.1 high, compile and program the chip -- Nothing works.
Here is an example:
-------------
@ DEVICE pic16F676, MCLR_OFF

LED1 VAR PORTA.0
LED2 VAR PORTA.1

loop:

HIGH LED1
HIGH LED2

PAUSE 500

Goto loop
---------------
The strange thing is, if I write the equivalent program in GCBasic, it seems to work fine. What am I missing here? Is there an environment setting that I don't know of?

mister_e
- 30th April 2008, 05:18
Have a look at the following
http://www.picbasic.co.uk/forum/showthread.php?t=561

HTH

BobK
- 1st May 2008, 02:04
Hi Jayhovah,

After you finish learning how to use PortA pins as Mister E pointed out you might want to turn the pins off after the pause statement because all you loop current does is turns the LEDs on.

loop:

HIGH LED1
HIGH LED2

PAUSE 500

LOW LED1
LOW LED2
PAUSE 500

Goto loop


BobK

Jayhovah
- 1st May 2008, 03:28
Have a look at the following
http://www.picbasic.co.uk/forum/showthread.php?t=561

HTH

Thanks! this solved it..