welcome to the forum ECaro03!
Your code is not to far but you must know the followings...
1. PIC16F684 use several oscillator config. Default setting is suppose to be 4MHZ. but it's safe to use this line at the top of your code.
OSCCON=%01100000 'define internal oscillator to 4MHZ
2. you must turn off a/d converter to read digital signal from PORTA by using
ANSEL=0 'turn off a/d
3. you also must turn off analog comparator by using
CMCON0=%00000111
now i sugest the following modify code.
Code:
OSCCON=%01100000 'define internal oscillator to 4MHZ
ANSEL=0 'turn off a/d
CMCON0=%00000111
trisa = %11111111
trisc = %00000000
portc = %00000000
left VAR PORTA.0 'define left as PORTA.0 status
loop:
if left then
portc.0 = 1
pause 2500
portc.0 = 0
endif
goto loop
what about now?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks