
Originally Posted by
pk7639
My circuit uses GP3 as an input (I modified 12F508.inc) and INTRC_OSC
The second block of this code (starting with the lable ccw

loops at about 1/6th of the speed of the bit below the if statement???
Anyone seen anything like this?
Many thanks in advance
PK
OPTION_REG.5=0 'need to set this to use pin2 as an output
OPTION_REG.6=0 'this turns on the internal pull up resistors
stepDelay con 20 'delay in mS for each step
TRISIO=%01000 'set GPIO.3 as an input, all othe pins as outputs
loop: if GPIO.3=1 then ccw
GPIO=%00110
pause stepDelay
GPIO=%00101
pause stepDelay
GPIO=%10001
pause stepDelay
GPIO=%10010
pause stepDelay
goto loop
ccw: GPIO=%10010
pause stepDelay
GPIO=%10001
pause stepDelay
GPIO=%00101
pause stepDelay
GPIO=%00110
pause stepDelay
goto loop
Hi,
May be I've missed something ...
but I see here you write the state of an input pin ... Try to write each pin one after each other instead of the whole port at once !!!
or better ... During the PAUSE, place the whole port as input, write your OUTPUT pins pattern ( 1 per 1 ), and AFTER, change for needed outputs with TRISIO ...
that is what we do for having directly output pins in a certain config, at power up ...
Alain
Alain
Last edited by Acetronics2; - 21st April 2007 at 17:17.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks