TODOPIC

Microcontroladores PIC => Todo en microcontroladores PIC => Mensaje iniciado por: luca lavagna en 19 de Mayo de 2017, 15:09:11

Título: Problema simulacion mplab
Publicado por: luca lavagna en 19 de Mayo de 2017, 15:09:11
Hola necesito saber cual es el error que me marca Mplab para poder ensamblar y simular la programación.
Debug build of project `C:\Users\matu_\Desktop\Matias\6to Electronico\Tecnicas Digitales 2\Proyecto 1\1er trimestre.mcp' started.
Language tool versions: MPASMWIN.exe v5.51, mplink.exe v4.49, mplib.exe v4.49
Preprocessor symbol `__DEBUG' is defined.
Fri May 19 15:00:46 2017
----------------------------------------------------------------------
Clean: Deleting intermediary and output files.
Clean: Done.
Executing: "C:\Program Files (x86)\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F627A "1erTrimestral.asm" /l"1erTrimestral.lst" /e"1erTrimestral.err" /o"1erTrimestral.o" /d__DEBUG=1
Error[108]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 1 : Illegal character (/)
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 10 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 10 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 11 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 12 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 13 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 14 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 15 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 16 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 17 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 18 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 19 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 21 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 21 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 22 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 22 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 23 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 24 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 24 : Executable code and data must be defined in an appropriate section
Message[305] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 25 : Using default destination of 1 (file).
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 25 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 26 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 26 : Executable code and data must be defined in an appropriate section
Message[305] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 27 : Using default destination of 1 (file).
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 27 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 28 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 28 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 29 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 31 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 31 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 32 : Executable code and data must be defined in an appropriate section
Message[302] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 33 : Register in operand not in bank 0.  Ensure that bank bits are correct.
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 33 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 34 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 36 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 36 : Executable code and data must be defined in an appropriate section
Error[150]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 38 : Labels must be defined in a code or data section when making an object file
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 38 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 40 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 40 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 41 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 43 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 44 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 44 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 46 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 47 : Executable code and data must be defined in an appropriate section
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 48 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 49 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 49 : Executable code and data must be defined in an appropriate section
Message[305] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 50 : Using default destination of 1 (file).
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 50 : Executable code and data must be defined in an appropriate section
Error[151]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 51 : Operand contains unresolvable labels or is too complex
Error[152]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 51 : Executable code and data must be defined in an appropriate section
Error[129]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 52 : Expected (END)
Halting build on first failure as requested.
----------------------------------------------------------------------
Debug build of project `C:\Users\matu_\Desktop\Matias\6to Electronico\Tecnicas Digitales 2\Proyecto 1\1er trimestre.mcp' failed.
Language tool versions: MPASMWIN.exe v5.51, mplink.exe v4.49, mplib.exe v4.49
Preprocessor symbol `__DEBUG' is defined.
Fri May 19 15:00:47 2017
----------------------------------------------------------------------
BUILD FAILED






este es mi programa:

PORTB   equ      0x06
TRISB   equ      0x86
STATUS   equ      0x03
REG1   equ      0x21
REG2   equ      0x22
POINT   equ      0x20
PCL      equ      0x02

TABLE   ADDLW   PCL
      RETLW   b'00000001'
      RETLW   b'00000010'
      RETLW   b'00000100'
      RETLW   b'00001000'
      RETLW   b'00010000'
      RETLW   b'00100000'
      RETLW   b'01000000'
      RETLW   b'10000000'
      RETURN

MS      MOVWF   REG1
MS1      MOVLW   .250
      MOVWF   REG2
MS2      NOP      
      DECFSZ   REG2
      GOTO   MS2
      DECFSZ   REG1
      GOTO   MS1
      RETURN

START   CLRW   
      BSF      STATUS,5
      CLRF   TRISB
      BCF      STATUS,5

SERIE1   CLRF   POINT

SERIE2   MOVFW   POINT

      CALL   TABLE
      MOVWF   PORTB

      MOVLW   .100
      CALL   MS
      
      MOVLW   .9
      XORWF   POINT,W
      BTFSC   STATUS,2
      GOTO   SERIE1
      INCF   POINT
      GOTO   SERIE2
Título: Re:Problema simulacion mplab
Publicado por: KILLERJC en 19 de Mayo de 2017, 20:07:44
Basicamente no sabe donde poner todo eso....

El vector de inicio lo tenes en la direccion 0x0, seguramente te falte algo asi:

Código: ASM
  1. ORG 0x0
  2.       GOTO  START             ; Vector de Reset
  3.       ORG 0x4
  4.       RETURN                  ; Vector de Interrupcion

Si no funciona esto, entonces vamos a usar la directiva CODE

Código: ASM
  1. CODE  0x00

Esto ubicado debajo de los EQU, reemplazando al ORG 0x00

Y ahora veamos error a error

Citar
Error[108]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 1 : Illegal character (/)
Claramente dice que tenes una barra "/" en la linea 1 del programa, si intentas hacer un comentario tenes que usar el punto y coma ";"

Citar
Message[305] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 25 : Using default destination of 1 (file).
Message[305] C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 27 : Using default destination of 1 (file).
Esos son mensajes, por que las instrucciones DECFSZ, INCF entre otras debe especificarse si el resultado vuelve al mismo registro o si van a W.

Ejemplo esto:
      DECFSZ   REG2

por esto:
      DECFSZ   REG2, F

Citar
Error[129]   C:\USERS\MATU_\DESKTOP\MATIAS\6TO ELECTRONICO\TECNICAS DIGITALES 2\PROYECTO 1\1ERTRIMESTRAL.ASM 52 : Expected (END)

Le falta la directiva END que indica donde termina el archivo. Esto lo pones al ultimo, como si fuera una instruccion es decir no en la columna 1.

Citar
PORTB   equ      0x06
TRISB   equ      0x86
STATUS   equ      0x03

Por que hacer eso?, si con un include del archivo .inc de tu micro

Código: ASM
  1. include    <p16f627a.inc>

ya tenes todos los registros y no necesitas definirlos a todos.