Count equ 0 tells the assembler to place the variable count at location zero. It does not give it a value. Somewhere in the code it will give it a value but as you have only posted snippets we have no idea where. Post all the code and we may be able to help.
Count equ 0 tells the assembler to place the variable count at location zero. It does not give it a value. Somewhere in the code it will give it a value but as you have only posted snippets we have no idea where. Post all the code and we may be able to help.
List p=18F1320
include <p18F1320.inc>
CONFIG OSC = INTIO2, WDT = OFF, LVP = OFF
LED macro x,y
movlw x
movwf LATA
movlw y
movwf TRISA
call Delay
call Delay
call Delay
endm
Count equ 0
org 0
bsf ADCON1, 0
LED1 LED b'00000001', b'10111110'
LED2 LED b'01000000', b'10111110'
LED3 LED b'01000000', b'00111111'
LED4 LED b'10000000', b'00111111'
LED5 LED b'10000000', b'01111110'
LED6 LED b'00000001', b'01111110'
bra LED1
Delay decfsz Count, f
bra Delay
return
END
Yeah so changing count equ just changed where the variable is stored in the ram.
Adding more Decfsz increased the speed as it decremented faster. The bra as you guessed takes longer. Two instruction cycles. But you could make this faster by assinging count a value of 0F prior to calling delay.
To make it longer you can just call count again or i prefer to put it in a second loop.
So:
Count2=0
Delay2
Goto delay
Decsfz count2
Goto delay2
Endm
Error[152] D:\USERS\OLLIE FORD\DROPBOX\PIC\LED.ASM 4 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\PIC\LED.ASM 5 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\PIC\LED.ASM 6 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\PIC\LED.ASM 7 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\PIC\LED.ASM 8 : Executable code and data must be defined in an appropriate section
Mike it worked fine for me the op has a lot more lines then he posted
Debug build of project `C:\Users\burt\Documents\junk\test.mcp' started.
Language tool versions: MPASMWIN.exe v5.41, mplink.exe v4.39, mplib.exe v4.39
Preprocessor symbol `__DEBUG' is defined.
Fri Jul 29 17:10:14 2011
----------------------------------------------------------------------
Make: The target "C:\Users\burt\Documents\junk\test.o" is up to date.
Make: The target "C:\Users\burt\Documents\junk\test.cof" is up to date.
Loaded C:\Users\burt\Documents\junk\test.cof.
----------------------------------------------------------------------
Debug build of project `C:\Users\burt\Documents\junk\test.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.41, mplink.exe v4.39, mplib.exe v4.39
Preprocessor symbol `__DEBUG' is defined.
Fri Jul 29 17:10:16 2011
----------------------------------------------------------------------
BUILD SUCCEEDED
----------------------------------------------------------------------
Debug build of project `D:\Users\Ollie Ford\Dropbox\My Documents\PIC\led.mcp' started.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 08 22:14:48 2011
----------------------------------------------------------------------
Executing: "D:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe" /q /p18F1320 "led.asm" /l"led.lst" /e"led.err" /o"led.o" /d__DEBUG=1
Error[152] D:\USERS\OLLIE FORD\DROPBOX\MY DOCUMENTS\PIC\LED.ASM 4 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\MY DOCUMENTS\PIC\LED.ASM 5 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\MY DOCUMENTS\PIC\LED.ASM 6 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\MY DOCUMENTS\PIC\LED.ASM 7 : Executable code and data must be defined in an appropriate section
Error[152] D:\USERS\OLLIE FORD\DROPBOX\MY DOCUMENTS\PIC\LED.ASM 8 : Executable code and data must be defined in an appropriate section
----------------------------------------------------------------------
Debug build of project `D:\Users\Ollie Ford\Dropbox\My Documents\PIC\led.mcp' failed.
Language tool versions: MPASMWIN.exe v5.42, mplink.exe v4.40, mplib.exe v4.40
Preprocessor symbol `__DEBUG' is defined.
Thu Sep 08 22:14:49 2011
----------------------------------------------------------------------
BUILD FAILED