Error con programa en ASM

hola a todos espero se encuentre bien....

bueno resulta que navegando por ahi me encuentro un circuito con PIC que quise simular pero el programa esta en ASM, intente pasarlo a HEX con el MPASM pero me aparece esto



y me genera unos archivos menos el (HEX) ahora pongo el programa

;Programa para generar la banda base de un transmisor
; para RadioControl de 7 canales

;Cada canal corresponde al mismo bit del PORTB (1:1, 2:2...)
;Bit 0 de PORTA es la salida
;Bit 3 de PORTA, carga del capacitor

; Cristal de 10MHz


#include <p16f628.inc>

; Variables
Channel equ 20h
CounterA equ 21h
TempW equ 22h
TempStatus equ 23h


org 00h ; Vector de Reset
goto Start ; ir al inicio del programa

org 04h ; Vector de interrupciones

bcf INTCON,GIE ; Deshabilito las interrupciones
movwf TempW ; Guardo W en TempW
swapf STATUS,W ; Guardo el registro STATUS en W
movwf TempStatus ; Guardo W en TempStatus

btfsc PIR1,CMIF ; Chequeo si hubo interrupcion del comparador
goto NextChannel ; si la hubo, continuo desde "NextChannel"
btfss PIR1,TMR2IF ; Chequeo si hubo interrupcion del Timer2
goto FinishInterrupt ; si no hubo interrupcion, voy al final de las interrupciones

FrameTimeOut ; continuo aqui, si hubo interrupcion del Timer2
bcf T2CON,TMR2ON ; Desactivo el Timer2, (para que se resetee)
bcf PIR1,TMR2IF ; Borro el flag, que indica interrupcion del Timer2
movlw b'11111101'
movwf Channel ; Cargo Channel con el valor de W
movlw b'00001001'
iorwf PORTA,F ; Hago altas las salidas 0 y 3 del puerto A
bsf T2CON,TMR2ON ; Activo el Timer2
call Delay
call Delay
nop ; Tiempo de espera (500 us, cuando cambia el puerto A)
movlw b'11110110'
andwf PORTA,F ; Hago bajas las salidas 0 y 3 del puerto A
bcf PORTB,1 ; Hago bajo el bit 1 del puerto B
movf Channel,W ; Cargo W con el valor de Channel
bsf STATUS,RP0 ; Paso al banco de memoria 1
tris TRISB ; Bit 1 del puerto B como salida, el resto como entrada (W al TRISB)
bcf STATUS,RP0 ; Paso al banco de memoria 0
goto FinishInterrupt ; Ir al final de las interrupciones

NextChannel
bsf STATUS,C
rlf Channel,F ; Roto hacia la izquierda Channel, y lo guardo en si mismo
movlw b'00001001'
iorwf PORTA,F ; Hago altas las salidas 0 y 3 del puerto A
nop
call Delay
call Delay
nop ; Tiempo de espera (500 us, cuando cambia el puerto A)
movlw b'11110110'
andwf PORTA,F ; Hago bajas las salidas 0 y 3 del puerto A
movf Channel,W ; Cargo W con el valor de Channel
movwf PORTB ; Llevo el valor de W al puerto B (en bajo solo el bit que este en 0)
bsf STATUS,RP0 ; Paso al banco de memoria 1
tris TRISB ; Llevo el valor de W al TRISB (puerto B como salida, solo el bit que este en 0)
bcf STATUS,RP0 ; Paso al banco de memoria 0

FinishInterrupt
bcf PIR1,CMIF ; Borro el flag que indica interrupcion del comparador

swapf TempStatus,W
movwf STATUS ; Recupero el valor original de STATUS
swapf TempW,F
swapf TempW,W ; Recupero el valor original de W
retfie ; Retorno de la interrupcion, se habilitan nuevamente

;--------------------rutina de retardo----------------------------
Delay
movlw .206
movwf CounterA

DelayLoop
decfsz CounterA,F
goto DelayLoop
return
;-------------------fin de la rutina de retardo-------------------

Start
clrf PORTA ; Todo el puerto A en 0
clrf PORTB ; Todo el puerto B en 0
movlw b'00000101'
movwf CMCON ; Habilito el comparador 2 solamente
bsf STATUS,RP0 ; Paso al banco de memoria 1
movlw b'11100110'
tris TRISA ; Configuro el puerto A; Bits 0, 3 y 4 salidas, el resto entrada
movlw b'11111111'
tris TRISB ; Configuro el puerto B; todos los bits como entrada
movlw b'11000111'
movwf OPTION_REG
movlw b'01000010'
movwf PIE1 ; Habilito las interrupciones del Timer2 y del comparador
movlw .195
movwf PR2 ; Llevo el valor decimal 195 al registro PR2
bcf STATUS,RP0 ; Paso al banco de memoria 0
movlw b'11010000'
movwf INTCON ; Habilito las interruciones
movlw b'01111011' ; Pre y Pos Scaler del Timer2 en 16
movwf T2CON ; Configuro el Timer2
bsf T2CON,TMR2ON ; Activo el Timer2

MainLoop
nop
nop
goto MainLoop ; Ciclo cerrado, que no hace nada
end


y los errores



MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 1


LOC OBJECT CODE LINE SOURCE TEXT
VALUE

00001 ;Programa para generar la banda base de un transmisor
00002 ; para RadioControl de 7 canales
00003
00004 ;Cada canal corresponde al mismo bit del PORTB (1:1, 2:2...)
00005 ;Bit 0 de PORTA es la salida
00006 ;Bit 3 de PORTA, carga del capacitor
00007
00008 ; Cristal de 10MHz
00009
00010
00011 #include <p16f628.inc>
00001 LIST
00002 ; P16F628.INC Standard Header File, Version 1.01 Microchip Technology, Inc.
00261 LIST
00012
00013 ; Variables
00000020 00014 Channel equ 20h
00000021 00015 CounterA equ 21h
00000022 00016 TempW equ 22h
00000023 00017 TempStatus equ 23h
00018
00019
0000 00020 org 00h ; Vector de Reset
0000 2838 00021 goto Start ; ir al inicio del programa
00022
0004 00023 org 04h ; Vector de interrupciones
00024
0004 138B 00025 bcf INTCON,GIE ; Deshabilito las interrupciones
0005 00A2 00026 movwf TempW ; Guardo W en TempW
0006 0E03 00027 swapf STATUS,W ; Guardo el registro STATUS en W
0007 00A3 00028 movwf TempStatus ; Guardo W en TempStatus
00029
0008 1B0C 00030 btfsc PIR1,CMIF ; Chequeo si hubo interrupcion del comparador
0009 281E 00031 goto NextChannel ; si la hubo, continuo desde "NextChannel"
000A 1C8C 00032 btfss PIR1,TMR2IF ; Chequeo si hubo interrupcion del Timer2
000B 282D 00033 goto FinishInterrupt ; si no hubo interrupcion, voy al final de las interrupciones
00034
000C 00035 FrameTimeOut ; continuo aqui, si hubo interrupcion del Timer2
000C 1112 00036 bcf T2CON,TMR2ON ; Desactivo el Timer2, (para que se resetee)
000D 108C 00037 bcf PIR1,TMR2IF ; Borro el flag, que indica interrupcion del Timer2
000E 30FD 00038 movlw b'11111101'
000F 00A0 00039 movwf Channel ; Cargo Channel con el valor de W
0010 3009 00040 movlw b'00001001'
0011 0485 00041 iorwf PORTA,F ; Hago altas las salidas 0 y 3 del puerto A
0012 1512 00042 bsf T2CON,TMR2ON ; Activo el Timer2
0013 2033 00043 call Delay
0014 2033 00044 call Delay
0015 0000 00045 nop ; Tiempo de espera (500 us, cuando cambia el pue
rto A)
0016 30F6 00046 movlw b'11110110'
0017 0585 00047 andwf PORTA,F ; Hago bajas las salidas 0 y 3 del puerto A
0018 1086 00048 bcf PORTB,1 ; Hago bajo el bit 1 del puerto B
0019 0820 00049 movf Channel,W ; Cargo W con el valor de Channel
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 2


LOC OBJECT CODE LINE SOURCE TEXT
VALUE

001A 1683 00050 bsf STATUS,RP0 ; Paso al banco de memoria 1
Warning[224]: Use of this instruction is not recommended.
Error[126] : Argument out of range (0086 not between 0005 and 0007)

001B 0066 00051 tris TRISB ; Bit 1 del puerto B como salida, el resto como entrada (W al TR
ISB)
001C 1283 00052 bcf STATUS,RP0 ; Paso al banco de memoria 0
001D 282D 00053 goto FinishInterrupt ; Ir al final de las interrupciones
00054
001E 00055 NextChannel
001E 1403 00056 bsf STATUS,C
001F 0DA0 00057 rlf Channel,F ; Roto hacia la izquierda Channel, y lo guardo en si mis
mo
0020 3009 00058 movlw b'00001001'
0021 0485 00059 iorwf PORTA,F ; Hago altas las salidas 0 y 3 del puerto A
0022 0000 00060 nop
0023 2033 00061 call Delay
0024 2033 00062 call Delay
0025 0000 00063 nop ; Tiempo de espera (500 us, cuando cambia el puerto A)
0026 30F6 00064 movlw b'11110110'
0027 0585 00065 andwf PORTA,F ; Hago bajas las salidas 0 y 3 del puerto A
0028 0820 00066 movf Channel,W ; Cargo W con el valor de Channel
0029 0086 00067 movwf PORTB ; Llevo el valor de W al puerto B (en bajo solo el bit que
este en 0)
002A 1683 00068 bsf STATUS,RP0 ; Paso al banco de memoria 1
Warning[224]: Use of this instruction is not recommended.
Error[126] : Argument out of range (0086 not between 0005 and 0007)

002B 0066 00069 tris TRISB ; Llevo el valor de W al TRISB (puerto B como salida, solo
el bit que este en 0)
002C 1283 00070 bcf STATUS,RP0 ; Paso al banco de memoria 0
00071
002D 00072 FinishInterrupt
002D 130C 00073 bcf PIR1,CMIF ; Borro el flag que indica interrupcion del comparador
00074
002E 0E23 00075 swapf TempStatus,W
002F 0083 00076 movwf STATUS ; Recupero el valor original de STATUS
0030 0EA2 00077 swapf TempW,F
0031 0E22 00078 swapf TempW,W ; Recupero el valor original de W
0032 0009 00079 retfie ; Retorno de la interrupcion, se habilitan nuevamente
00080
00081 ;--------------------rutina de retardo----------------------------
0033 00082 Delay
0033 30CE 00083 movlw .206
0034 00A1 00084 movwf CounterA
00085
0035 00086 DelayLoop
0035 0BA1 00087 decfsz CounterA,F
0036 2835 00088 goto DelayLoop
0037 0008 00089 return
00090 ;-------------------fin de la rutina de retardo-------------------
00091
0038 00092 Start
0038 0185 00093 clrf PORTA ; Todo el puerto A en 0
0039 0186 00094 clrf PORTB ; Todo el puerto B en 0
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 3


LOC OBJECT CODE LINE SOURCE TEXT
VALUE

003A 3005 00095 movlw b'00000101'
003B 009F 00096 movwf CMCON ; Habilito el comparador 2 solamente
003C 1683 00097 bsf STATUS,RP0 ; Paso al banco de memoria 1
003D 30E6 00098 movlw b'11100110'
Warning[224]: Use of this instruction is not recommended.
Error[126] : Argument out of range (0085 not between 0005 and 0007)

003E 0065 00099 tris TRISA ; Configuro el puerto A; Bits 0, 3 y 4 salidas, el resto entrada
003F 30FF 00100 movlw b'11111111'
Warning[224]: Use of this instruction is not recommended.
Error[126] : Argument out of range (0086 not between 0005 and 0007)

0040 0066 00101 tris TRISB ; Configuro el puerto B; todos los bits como entrada
0041 30C7 00102 movlw b'11000111'
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0042 0081 00103 movwf OPTION_REG
0043 3042 00104 movlw b'01000010'
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0044 008C 00105 movwf PIE1 ; Habilito las interrupciones del Timer2 y del comparador
0045 30C3 00106 movlw .195
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0046 0092 00107 movwf PR2 ; Llevo el valor decimal 195 al registro PR2
0047 1283 00108 bcf STATUS,RP0 ; Paso al banco de memoria 0
0048 30D0 00109 movlw b'11010000'
0049 008B 00110 movwf INTCON ; Habilito las interruciones
004A 307B 00111 movlw b'01111011' ; Pre y Pos Scaler del Timer2 en 16
004B 0092 00112 movwf T2CON ; Configuro el Timer2
004C 1512 00113 bsf T2CON,TMR2ON ; Activo el Timer2
00114
004D 00115 MainLoop
004D 0000 00116 nop
004E 0000 00117 nop
004F 284D 00118 goto MainLoop ; Ciclo cerrado, que no hace nada
00119 end
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 4


SYMBOL TABLE
LABEL VALUE

ADEN 00000003
BRGH 00000002
C 00000000
C1INV 00000004
C1OUT 00000006
C2INV 00000005
C2OUT 00000007
CCP1CON 00000017
CCP1IE 00000002
CCP1IF 00000002
CCP1M0 00000000
CCP1M1 00000001
CCP1M2 00000002
CCP1M3 00000003
CCP1X 00000005
CCP1Y 00000004
CCPR1H 00000016
CCPR1L 00000015
CIS 00000003
CM0 00000000
CM1 00000001
CM2 00000002
CMCON 0000001F
CMIE 00000006
CMIF 00000006
CREN 00000004
CSRC 00000007
Channel 00000020
CounterA 00000021
DC 00000001
Delay 00000033
DelayLoop 00000035
EEADR 0000009B
EECON1 0000009C
EECON2 0000009D
EEDATA 0000009A
EEIE 00000007
EEIF 00000007
F 00000001
FERR 00000002
FSR 00000004
FinishInterrupt 0000002D
FrameTimeOut 0000000C
GIE 00000007
INDF 00000000
INTCON 0000000B
INTE 00000004
INTEDG 00000006
INTF 00000001
IRP 00000007
MainLoop 0000004D
NOT_BO 00000000
NOT_BOD 00000000
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 5


SYMBOL TABLE
LABEL VALUE

NOT_BOR 00000000
NOT_PD 00000003
NOT_POR 00000001
NOT_RBPU 00000007
NOT_T1SYNC 00000002
NOT_TO 00000004
NextChannel 0000001E
OERR 00000001
OPTION_REG 00000081
OSCF 00000003
PCL 00000002
PCLATH 0000000A
PCON 0000008E
PEIE 00000006
PIE1 0000008C
PIR1 0000000C
PORTA 00000005
PORTB 00000006
PR2 00000092
PS0 00000000
PS1 00000001
PS2 00000002
PSA 00000003
RBIE 00000003
RBIF 00000000
RCIE 00000005
RCIF 00000005
RCREG 0000001A
RCSTA 00000018
RD 00000000
RP0 00000005
RP1 00000006
RX9 00000006
RX9D 00000000
SPBRG 00000099
SPEN 00000007
SREN 00000005
STATUS 00000003
SYNC 00000004
Start 00000038
T0CS 00000005
T0IE 00000005
T0IF 00000002
T0SE 00000004
T1CKPS0 00000004
T1CKPS1 00000005
T1CON 00000010
T1OSCEN 00000003
T2CKPS0 00000000
T2CKPS1 00000001
T2CON 00000012
TMR0 00000001
TMR1CS 00000001
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 6


SYMBOL TABLE
LABEL VALUE

TMR1H 0000000F
TMR1IE 00000000
TMR1IF 00000000
TMR1L 0000000E
TMR1ON 00000000
TMR2 00000011
TMR2IE 00000001
TMR2IF 00000001
TMR2ON 00000002
TOUTPS0 00000003
TOUTPS1 00000004
TOUTPS2 00000005
TOUTPS3 00000006
TRISA 00000085
TRISB 00000086
TRMT 00000001
TX9 00000006
TX9D 00000000
TXEN 00000005
TXIE 00000004
TXIF 00000004
TXREG 00000019
TXSTA 00000098
TempStatus 00000023
TempW 00000022
VR0 00000000
VR1 00000001
VR2 00000002
VR3 00000003
VRCON 0000009F
VREN 00000007
VROE 00000006
VRR 00000005
W 00000000
WR 00000001
WREN 00000002
WRERR 00000003
Z 00000002
_BODEN_OFF 00003FBF
_BODEN_ON 00003FFF
_CP_50 00002BFF
_CP_75 000017FF
_CP_ALL 000003FF
_CP_OFF 00003FFF
_DATA_CP_OFF 00003FFF
_DATA_CP_ON 00003EFF
_ER_OSC_CLKOUT 00003FFF
_ER_OSC_NOCLKOUT 00003FFE
_EXTCLK_OSC 00003FEF
_HS_OSC 00003FEE
_INTRC_OSC_CLKOUT 00003FFD
_INTRC_OSC_NOCLKOUT 00003FFC
_LP_OSC 00003FEC
MPASM 5.03 PPM_PIC_SLS.ASM 5-18-2012 22:04:19 PAGE 7


SYMBOL TABLE
LABEL VALUE

_LVP_OFF 00003F7F
_LVP_ON 00003FFF
_MCLRE_OFF 00003FDF
_MCLRE_ON 00003FFF
_PWRTE_OFF 00003FFF
_PWRTE_ON 00003FF7
_WDT_OFF 00003FFB
_WDT_ON 00003FFF
_XT_OSC 00003FED
__16F628 00000001


MEMORY USAGE MAP ('X' = Used, '-' = Unused)

0000 : X---XXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX ---------------- ---------------- ----------------

All other memory blocks unused.

Program Memory Words Used: 77
Program Memory Words Free: 1971


Errors : 4
Warnings : 4 reported, 0 suppressed
Messages : 3 reported, 0 suppressed

de antemano gracias... espero me puedan ayudar disculpen el haber puesto todo este pero me parece importante poner el programa completo en ambos casos.
 
Última edición:
Saludos.
Corregí los errores del programa que pegaste, compílalo ahora y te debe dar 0 errores.
Te adjunto el programa dentro del archivo SLS.rar

Suerte.
 

Adjuntos

  • SLS.rar
    1.4 KB · Visitas: 7
Atrás
Arriba