- Messaggi: 45
- Ringraziamenti ricevuti 0
Files .c
8 Anni 5 Mesi fa #1
da Guido72
Files .c è stato creato da Guido72
Ciao a tutti,
primo tentativo con un LCD ed il 18F4550.
Ho scaricato le librerie Laurtec ed ho copiato l'esempio "Hello World" per fare un test ma ...niente.
Premetto che non ho la scheda collegata ma ottengo numerosi warnings alla compilazione.
Il primo problema è che il compilatore non "vede" i file .c come il "delay.c" e il "LCD_44870.c".
Ho inizialmente copiato i files all'interno della cartella del mio main.c , successivamente ho provato a linkare il percorso al compilatore ma non ottengo risultati.
Dove sbaglio ?
Guido
primo tentativo con un LCD ed il 18F4550.
Ho scaricato le librerie Laurtec ed ho copiato l'esempio "Hello World" per fare un test ma ...niente.
Premetto che non ho la scheda collegata ma ottengo numerosi warnings alla compilazione.
Il primo problema è che il compilatore non "vede" i file .c come il "delay.c" e il "LCD_44870.c".
Ho inizialmente copiato i files all'interno della cartella del mio main.c , successivamente ho provato a linkare il percorso al compilatore ma non ottengo risultati.
Dove sbaglio ?
Guido
Si prega Accedi o Crea un account a partecipare alla conversazione.
- Guido72
- Autore della discussione
- Senior Member
Riduci
Di più
8 Anni 5 Mesi fa #2
da Guido72
Risposta da Guido72 al topic Files .c
Aggiungo di seguito le warnings
:: advisory: (1233) Employing 18F4550 errata work-arounds:
:: advisory: (1234) * Corrupted fast interrupt shadow registers
:: warning: (1273) Omniscient Code Generation not available in Free mode
LCD_44780.c:74: warning: (520) function "_LCD_home" is never called
LCD_44780.c:84: warning: (520) function "_LCD_shift" is never called
LCD_44780.c:98: warning: (520) function "_LCD_shift_cursor" is never called
LCD_44780.c:136: warning: (520) function "_LCD_goto_xy" is never called
LCD_44780.c:194: warning: (520) function "_LCD_write_string" is never called
LCD_44780.c:210: warning: (520) function "_LCD_write_integer" is never called
delay.c:102: warning: (520) function "_delay_s" is never called
LCD_44780.c:139: warning: (752) conversion to shorter data type
LCD_44780.c:236: warning: (752) conversion to shorter data type
:0: error: (499) undefined symbol:
_board_initialization(dist/default/production\LCD.X.production.obj)
(908) exit status = 1
nbproject/Makefile-default.mk:119: recipe for target 'dist/default/production/LCD.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/LCD.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 19s)
:: advisory: (1233) Employing 18F4550 errata work-arounds:
:: advisory: (1234) * Corrupted fast interrupt shadow registers
:: warning: (1273) Omniscient Code Generation not available in Free mode
LCD_44780.c:74: warning: (520) function "_LCD_home" is never called
LCD_44780.c:84: warning: (520) function "_LCD_shift" is never called
LCD_44780.c:98: warning: (520) function "_LCD_shift_cursor" is never called
LCD_44780.c:136: warning: (520) function "_LCD_goto_xy" is never called
LCD_44780.c:194: warning: (520) function "_LCD_write_string" is never called
LCD_44780.c:210: warning: (520) function "_LCD_write_integer" is never called
delay.c:102: warning: (520) function "_delay_s" is never called
LCD_44780.c:139: warning: (752) conversion to shorter data type
LCD_44780.c:236: warning: (752) conversion to shorter data type
:0: error: (499) undefined symbol:
_board_initialization(dist/default/production\LCD.X.production.obj)
(908) exit status = 1
nbproject/Makefile-default.mk:119: recipe for target 'dist/default/production/LCD.X.production.hex' failed
make[2]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [dist/default/production/LCD.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 19s)
Si prega Accedi o Crea un account a partecipare alla conversazione.
- Guido72
- Autore della discussione
- Senior Member
Riduci
Di più
- Messaggi: 45
- Ringraziamenti ricevuti 0
8 Anni 5 Mesi fa #3
da Guido72
Risposta da Guido72 al topic Files .c
Dunque ,
inizialmente al posto di "Hello World 1" e "Hello World 2" avevo scritto "Pippo"
Ora , ho scritto esattamente come nell'esempio (Hello World 1 e 2) ed il programma "build successfull" tuttavia con una serie di warnings , come segue
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LCD_44780.c:74: warning: (520) function "_LCD_home" is never called
LCD_44780.c:84: warning: (520) function "_LCD_shift" is never called
LCD_44780.c:98: warning: (520) function "_LCD_shift_cursor" is never called
LCD_44780.c:136: warning: (520) function "_LCD_goto_xy" is never called
LCD_44780.c:194: warning: (520) function "_LCD_write_string" is never called
LCD_44780.c:210: warning: (520) function "_LCD_write_integer" is never called
delay.c:102: warning: (520) function "_delay_s" is never called
LCD_44780.c:139: warning: (752) conversion to shorter data type
LCD_44780.c:236: warning: (752) conversion to shorter data type
Memory Summary:
Program space used 40Bh ( 1035) of 8000h bytes ( 3.2%)
Data space used 1Ch ( 28) of 800h bytes ( 1.4%)
Configuration bits used 7h ( 7) of 7h words (100.0%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
ID Location space used 8h ( of 8h bytes (100.0%)
Data stack space used 0h ( 0) of 7A0h bytes ( 0.0%)
You have compiled in FREE mode.
Using Omnicient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See www.microchip.com/MPLABXCcompilers for more information.
make[2]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
make[1]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
BUILD SUCCESSFUL (total time: 26s)
Loading code from C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X/dist/default/production/LCD.X.production.hex...
Loading completed
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mentre il programma é :
#include <xc.h>
#include "PIC18F4550_config.h"
#define LCD_DEFAULT
#include "LCD_44780.h"
#include "LCD_44780.c"
#include "delay.h"
#include "delay.c"
#define FRASE_1 "Hello World 1"
//void board_initialization (void);
int main(void) {
//board_initialization ();
LATA = 0x00;
TRISA = 0xFF;
LATB = 0x00;
TRISB = 0xFF;
LATC = 0x00;
TRISC = 0b11111101;
LATD = 0x00;
TRISD = 0b00000001;
LATE = 0x00;
TRISE = 0xFF;
LCD_initialize (20);
LCD_backlight (TURN_ON_LED_LCD);
LCD_write_message (FRASE_1);
LCD_goto_line (2);
LCD_write_message ("Hello World 2");
while (1) {
// return;
}
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Come è possibile notare , ho inizializzato i pin direttamente e non , come nell'esempio usando "board_initialization () poichè , mi da errore.
inizialmente al posto di "Hello World 1" e "Hello World 2" avevo scritto "Pippo"
Ora , ho scritto esattamente come nell'esempio (Hello World 1 e 2) ed il programma "build successfull" tuttavia con una serie di warnings , come segue
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
LCD_44780.c:74: warning: (520) function "_LCD_home" is never called
LCD_44780.c:84: warning: (520) function "_LCD_shift" is never called
LCD_44780.c:98: warning: (520) function "_LCD_shift_cursor" is never called
LCD_44780.c:136: warning: (520) function "_LCD_goto_xy" is never called
LCD_44780.c:194: warning: (520) function "_LCD_write_string" is never called
LCD_44780.c:210: warning: (520) function "_LCD_write_integer" is never called
delay.c:102: warning: (520) function "_delay_s" is never called
LCD_44780.c:139: warning: (752) conversion to shorter data type
LCD_44780.c:236: warning: (752) conversion to shorter data type
Memory Summary:
Program space used 40Bh ( 1035) of 8000h bytes ( 3.2%)
Data space used 1Ch ( 28) of 800h bytes ( 1.4%)
Configuration bits used 7h ( 7) of 7h words (100.0%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
ID Location space used 8h ( of 8h bytes (100.0%)
Data stack space used 0h ( 0) of 7A0h bytes ( 0.0%)
You have compiled in FREE mode.
Using Omnicient Code Generation that is available in PRO mode,
you could have produced up to 60% smaller and 400% faster code.
See www.microchip.com/MPLABXCcompilers for more information.
make[2]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
make[1]: Leaving directory 'C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X'
BUILD SUCCESSFUL (total time: 26s)
Loading code from C:/Users/kj2/Desktop/MPLAB/Progetti/LCD.X/dist/default/production/LCD.X.production.hex...
Loading completed
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mentre il programma é :
#include <xc.h>
#include "PIC18F4550_config.h"
#define LCD_DEFAULT
#include "LCD_44780.h"
#include "LCD_44780.c"
#include "delay.h"
#include "delay.c"
#define FRASE_1 "Hello World 1"
//void board_initialization (void);
int main(void) {
//board_initialization ();
LATA = 0x00;
TRISA = 0xFF;
LATB = 0x00;
TRISB = 0xFF;
LATC = 0x00;
TRISC = 0b11111101;
LATD = 0x00;
TRISD = 0b00000001;
LATE = 0x00;
TRISE = 0xFF;
LCD_initialize (20);
LCD_backlight (TURN_ON_LED_LCD);
LCD_write_message (FRASE_1);
LCD_goto_line (2);
LCD_write_message ("Hello World 2");
while (1) {
// return;
}
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Come è possibile notare , ho inizializzato i pin direttamente e non , come nell'esempio usando "board_initialization () poichè , mi da errore.
Si prega Accedi o Crea un account a partecipare alla conversazione.
- Guido72
- Autore della discussione
- Senior Member
Riduci
Di più
- Messaggi: 45
- Ringraziamenti ricevuti 0
8 Anni 5 Mesi fa #4
da Claudio_F
Risposta da Claudio_F al topic Files .c
Per i Warning devi mettere il Warning Level del Linker XC8 a 0 invece di -3, come indicato in altre occasioni da Mauro
Si prega Accedi o Crea un account a partecipare alla conversazione.
- Claudio_F
- Premium Member
Riduci
Di più
- Messaggi: 130
- Ringraziamenti ricevuti 11
8 Anni 5 Mesi fa #5
da Guido72
Risposta da Guido72 al topic Files .c
Ciao Claudio,
ok proverò a fare in questo modo....Grazie
Guido
ok proverò a fare in questo modo....Grazie
Guido
Si prega Accedi o Crea un account a partecipare alla conversazione.
- Guido72
- Autore della discussione
- Senior Member
Riduci
Di più
- Messaggi: 45
- Ringraziamenti ricevuti 0
Moderatori: Mauro Laurenti, Pinna, StefA, Matteo Garia
Registrati al sito
Accedi a tutte le risorse e articoli non visibili pubblicamente, puoi registrarti con pochi passi.