Society of Robots - Robot Forum
Software => Software => Topic started by: winnie66 on January 20, 2010, 09:51:36 AM
-
I am struggling to use counter. My project is using pic16f684, assembly language.
my program which counted from 0 up to 7 , anybody can check for me? When I run this, feel like something wrong when the count is '011'.
clrf count
again
btfss count,2
goto B20
goto B21
B20
btfss count,1
goto B20B10
goto B20B11
B20B11
btfss count,0
goto B20B11B00 ;010
goto B20B11B01 ;011
B20B10
btfss count,0
goto B20B10B00 ;000
goto B20B10B01 ;001
B21
btfss count,1
goto B21B10
goto B21B11
B21B10
btfss count,0
goto B21B10B00 ;100
goto B21B10B01 ;101
B21B11
btfss count,0
goto B21B11B00 ;110
goto B21B11B01 ;111
B21B10B00
---
goto label
B21B10B01
--
goto label
----
label
movlw 1
addwf count,1
goto again
thanks
-
what are you trying to do?
http://ww1.microchip.com/downloads/en/devicedoc/41202D.pdf (http://ww1.microchip.com/downloads/en/devicedoc/41202D.pdf)
table 13.2
holds instructions you need to be able to do stuff.
btfsc "Bit Test f, Skip if Clear" <<<<<< whats that doing? are you shure that code counts till three?
-
:o what is this actuly doing? I can't tell and don't feel like trying to find out. blame lazyness.