Autor Tema: Error de compilación con PIC 16F887 y librería LCD de MpAM  (Leído 1403 veces)

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

Desconectado ale141414

  • PIC10
  • *
  • Mensajes: 6
Error de compilación con PIC 16F887 y librería LCD de MpAM
« en: 29 de Mayo de 2016, 16:45:06 »
Hola a todos,

Estoy usando la aplicación maestro de Microchip para controlar un LCD. Cuando estaba utilizando el PIC 16F873A el programa compilaba y compila sin ningún problema. Pero ahora decidí cambiar de PIC y utilizar el 16F887. Cunado compilo con éste PIC me da el siguiente error:

Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 71 : Symbol not previously defined (XLCDInit)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 72 : Symbol not previously defined (XLCDCommand)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 73 : Symbol not previously defined (XLCDPut)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 74 : Symbol not previously defined (XLCDDelay5ms)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 75 : Symbol not previously defined (XLCDDelay100us)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 76 : Symbol not previously defined (XLCDCommandInit4bit)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 77 : Symbol not previously defined (XLCDL1home)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 78 : Symbol not previously defined (XLCDL2home)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 79 : Symbol not previously defined (XLCDClear)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 80 : Symbol not previously defined (XLCDReturnHome)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 81 : Symbol not previously defined (XLCDSendMsg)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 89 : Symbol not previously defined (XLCDIsBusy)
Error[113]   D:\MIS DOCUMENTOS\PROGRAMACIóN PIC\EN ASM\LCD 2X16\XLCD.INC 90 : Symbol not previously defined (XLCDReadData)


Éste error me lo da en las siguientes líneas de código:

    GLOBAL  XLCDInit                    ;initialize LCD
    GLOBAL  XLCDCommand                 ;instruction command
    GLOBAL  XLCDPut                       ;put content into LCD
    GLOBAL  XLCDDelay5ms
    GLOBAL  XLCDDelay100us
    GLOBAL  XLCDCommandInit4bit         ;function used only in 4 bit init by instruction
    GLOBAL  XLCDL1home                  ;Sets DDRam address to first line
    GLOBAL  XLCDL2home                  ;Sets DDRam address to second line
    GLOBAL  XLCDClear                   ;Clears DDram content and points to address 00
    GLOBAL  XLCDReturnHome              ;Sets DDRAM address 0 DDramConent remain unchanged
    GLOBAL  XLCDSendMsg
   
   
    #if XLCDMODE == 1
    GLOBAL  XLCDDelay                   ;delay to becalled after every instruction Command
    #endif
   
    #if XLCDRWPIN !=10                  ;if RW grounded
    GLOBAL  XLCDIsBusy                  ;reads the busy flag
    GLOBAL  XLCDReadData                ;readdata from DDRAM
    #endif


Mi duda es entonces porqué con un PIC el programa compila de forma correcta y con el otro me tira éste error.

Desde ya muchas gracias
Alejandro

Desconectado KILLERJC

  • Colaborador
  • DsPIC33
  • *****
  • Mensajes: 8242
Re:Error de compilación con PIC 16F887 y librería LCD de MpAM
« Respuesta #1 en: 29 de Mayo de 2016, 17:25:48 »
Claramente dice que las funciones "XLCDInit" , etc, etc ,etc se estan intentando crear como "globales", pero que jamas se definieron.

Citar
Estoy usando la aplicación maestro de Microchip para controlar un LCD. Cuando estaba utilizando el PIC 16F873A el programa compilaba y compila sin ningún problema. Pero ahora decidí cambiar de PIC y utilizar el 16F887. Cunado compilo con éste PIC me da el siguiente error:
Lo mas seguro es que sea un problema de direcciones de libreria o que este restringido a algunos PICs por lo que comentas.

Desconectado ale141414

  • PIC10
  • *
  • Mensajes: 6
Re:Error de compilación con PIC 16F887 y librería LCD de MpAM
« Respuesta #2 en: 29 de Mayo de 2016, 20:19:20 »
A que te referís con las direcciones de librería?
Si estuviese restringiendo algunos PICs, ésto decís que lo hace la librería? Creo que no lo esta haciendo.

Desconectado KILLERJC

  • Colaborador
  • DsPIC33
  • *****
  • Mensajes: 8242
Re:Error de compilación con PIC 16F887 y librería LCD de MpAM
« Respuesta #3 en: 30 de Mayo de 2016, 07:39:23 »
La directiva global hace que el simbolo aparezca dentro del proyecto sin necesidad de incluir el mismo. El cual seria algo asi:

Archivo1
Código: ASM
  1. Global Funcion1
  2.  
  3. Funcion1:        ;Tu error es como si esto no estuviera, solo el global
  4.       ;Aca instrucciones

Y para que sea usado por los demas, no es necesario "incluirlo" sino con hacer:

Archivo2
Código: ASM
  1. Extern Funcion1
  2.  
  3.       CALL   Funcion1

Ya podrias usarlo, siempre y cuando esten agregados como archivos fuentes (Source) del proyecto.

Supuse que por alguna razon que podria llegar a ser que pida algun include o algo y le este errando de ruta. A eso me referi con problemas de direcciones.
Tal ves todas esas funciones no estan en un solo archivo y hacen algo asi:

Código: ASM
  1. global Funcion1
  2.  
  3. #include Funcion1.inc  ; Donde aca esta la funcion1