Autor Tema: Ayuda - Error en MPLAB - No reconoce las instrucciones...  (Leído 6826 veces)

0 Usuarios y 1 Visitante están viendo este tema.

Desconectado eskor_fdr

  • PIC10
  • *
  • Mensajes: 18
Ayuda - Error en MPLAB - No reconoce las instrucciones...
« en: 17 de Julio de 2012, 11:21:04 »
Buenas, me estoy iniciando en assembler del PIC, vengo de estar usando mucho C con el CCS.
Pero ahora necesito hacer unos programas en assembler con el MPLAB.
Aca dejo el codigo, al compilarlo me tira los errores que estan listados mas abajo, pensé que era un problema de tabulacion, pero al parecer no (corregi las primeras tabulaciones pero no cambia nada, sigue marcando un error a la altura de los equ).
Otro error que aparece mucho en el listado es el 113, que no me reconoce las intrucciones (movwf, clrf, etc)...

Por favor si me pueden dar una mano se lo agradeceria, hace unos días vengo buscando la solución y no doy con nada.

Los fusibles estan configurados por el mismo MPLAB, el Select Device esta correcto, finaliza con un sleep y end, probe poniendo el #include <p12c508a.inc> pero tampoco, el list es el correcto, cambie el "disable case sensivity" y tampoco.
Me da la impresión que el problema esta antes del codigo...


Pongo un pedazo del programa, si es necesario me dicen y lo pongo completo,
Código: [Seleccionar]
;*****************************************************************************************
; Defino registros y directivas

#DEFINE CARRY 03,0
#DEFINE DC 03,1
#DEFINE ZERO 03,2
#DEFINE PD 03,3
#DEFINE TO 03,4
#DEFINE PA 03,5 ;0-Page 0 1-Page 1

#DEFINE GP0 06,0
#DEFINE GP1 06,1
#DEFINE GP2 06,2
#DEFINE GP3 06,3 ;TRIS = b'011011'
#DEFINE GP4 06,4
#DEFINE GP5 06,5

BIZQ equ 08
BDER equ 04
BPAN equ 0C
BARR equ 0E

CODE1 equ 33 ;ID TX - 1 byte y medio
CODE2 equ 30 ;segunda parte en "0" para insertar "XData"

GPIO equ 06
OSCAL equ 05

xdata equ 07
num1 equ 08
num2 equ 09
timer1 equ 0A
timer2 equ 0B
cont_pulsos equ 0C
cont_8bits equ 0D


list p=12c508


;*****************************************************************************************
; Comienzo programa

RESET_VECTOR org 00
movwf OSCAL
goto inicio

;*****************************************************************************************
; Subrutinas de Retardo

timer_180 org 03
movlw d'58'
    movwf timer1
bucle_180 decfsz timer1,F
goto bucle_180
retlw 0

silencio_3ms org 08
movlw d'4'
    movwf timer2
        movlw d'227'
        movwf timer1
bucle_3ms       decfsz  timer1, F
        goto bucle_3ms
              decfsz  timer2, F
          goto bucle_3ms
return

silencio_23ms org 11
movlw d'30'
        movwf timer2
        movlw d'221'
          movwf timer1
bucle_23ms      decfsz  timer1,F
        goto  bucle_23ms
          decfsz  timer2,F
          goto  bucle_23ms
return

;*****************************************************************************************
; Programa Principal

inicio org 19
movlw b'00011111'
        option
movlw b'011011'
        tris  GPIO
clrf  xdata
        clrf  num1
          clrf  num2
          clrf  timer1 
        clrf  timer2
        movlw d'5'
        movwf cont_pulsos
          bsf    GP2 ;Enciende Led
                        ;....... continua


Estos son los errores al darle BUILD ALL...

Citar
Executing: "C:\Archivos de programa\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12C508A "TX3_CAB400.asm" /l"TX3_CAB400.lst" /e"TX3_CAB400.err" /d__DEBUG=1
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 61 : Symbol not previously defined (R)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 61 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 61 : Symbol not previously defined (equ)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 92 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 92 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 92 : Symbol not previously defined (timer1bucle_180)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 96 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 96 : Missing operator
Warning[227] C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 97 : Substituting RETLW 0 for RETURN pseudo-op
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 100 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 100 : Missing operator
Warning[227] C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 101 : Substituting RETLW 0 for RETURN pseudo-op
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 107 : Symbol not previously defined (option)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 107 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 108 : Symbol not previously defined (tris)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 108 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 109 : Symbol not previously defined (clrf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 109 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 113 : Symbol not previously defined (F)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 113 : Symbol not previously defined (goto)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 113 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 113 : Symbol not previously defined (retardo_inicio)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 115 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 115 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 116 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 116 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 116 : Symbol not previously defined (timer2pul_1)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 118 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 118 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 120 : Symbol not previously defined (movwf)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 120 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 120 : Symbol not previously defined (cont_pulsosbucle_10ms)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Symbol not previously defined (GP5)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Symbol not previously defined (call)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Symbol not previously defined (F)
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Symbol not previously defined (goto)
Error[112]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Missing operator
Error[113]   C:\MPLAB\TX3PUL_MPLAB\TX3_CAB400.ASM 121 : Symbol not previously defined (bucle_16bitssepara_bit_num1)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\mplab\TX3PUL_MPLAB\TX_3_CAB400.mcp' failed.
Language tool versions: MPASMWIN.exe v5.46, mplink.exe v4.44, mplib.exe v4.44
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 17 10:55:48 2012
----------------------------------------------------------------------
BUILD FAILED

Desconectado tapi8

  • Colaborador
  • PIC24H
  • *****
  • Mensajes: 1506
Re: Ayuda - Error en MPLAB - No reconoce las instrucciones...
« Respuesta #1 en: 17 de Julio de 2012, 13:01:32 »
Lo compile tal y como lo tienes tu y me dio solo tres errores, tengo la version v8.70

Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Users\tapi\Desktop\PRUEBAS MPLAB\error.asm.mcs".
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12C508 "error.asm" /l"error.lst" /e"error.err" /d__DEBUG=1
Warning[207] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 33 : Found label after column 1. (timer2)
Warning[207] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 35 : Found label after column 1. (cont_8bits)
Warning[227] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 67 : Substituting RETLW 0 for RETURN pseudo-op
Warning[227] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 78 : Substituting RETLW 0 for RETURN pseudo-op
Error[118]   C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 84 : Overwriting previous address contents (0019)
Error[118]   C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 84 : Overwriting previous address contents (0019)
Error[129]   C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 97 : Expected (END)
Halting build on first failure as requested.

Le suprimi en inicio:

inicio          org       19


deje solo inicio. le puse un END al final y ya compila, sin problemas.


Debug build of project `C:\Users\tapi\Desktop\PRUEBAS MPLAB\error.asm.mcp' started.
Language tool versions: MPASMWIN.exe v5.41, mplink.exe v4.39, mplib.exe v4.39
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 17 17:52:57 2012
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p12C508 "error.asm" /l"error.lst" /e"error.err" /d__DEBUG=1
Warning[207] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 33 : Found label after column 1. (timer2)
Warning[207] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 35 : Found label after column 1. (cont_8bits)
Warning[227] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 67 : Substituting RETLW 0 for RETURN pseudo-op
Warning[227] C:\USERS\TAPI\DESKTOP\PRUEBAS MPLAB\ERROR.ASM 78 : Substituting RETLW 0 for RETURN pseudo-op
Executing: "C:\Program Files\Microchip\MPASM Suite\mplink.exe" /p12C508 "error.o" /u_DEBUG /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"error.cof" /M"error.map" /W /x
MPLINK 4.39, Linker
Device Database Version 1.1
Copyright (c) 1998-2011 Microchip Technology Inc.
Errors    : 0

Loaded C:\Users\tapi\Desktop\PRUEBAS MPLAB\error.cof.
----------------------------------------------------------------------
Debug build of project `C:\Users\tapi\Desktop\PRUEBAS MPLAB\error.asm.mcp' succeeded.
Language tool versions: MPASMWIN.exe v5.41, mplink.exe v4.39, mplib.exe v4.39
Preprocessor symbol `__DEBUG' is defined.
Tue Jul 17 17:53:02 2012
----------------------------------------------------------------------
BUILD SUCCEEDED

Desconectado eskor_fdr

  • PIC10
  • *
  • Mensajes: 18
Re: Ayuda - Error en MPLAB - No reconoce las instrucciones...
« Respuesta #2 en: 17 de Julio de 2012, 15:33:18 »
SOLUCIONADO

Muchas gracias por la respuesta, con eso me di cuenta que el problema era ajeno al codigo.
Y así fue, el problema estaba en el tipo de codificacion del texto, tenia que estar seteada como UTF-8, y estaba en otra.

Copié el codigo a un editor de texto, lo guarde con formato UTF-8, lo abri con el MPLAB, y ya a simple vista cambiaron algunos caracteres... al compilar anduvo perfecto.

Gracias!