hallo;
folgende Meldung bekomme ich beim Compilieren. kann mir jemand kurz und
bündig sagen, was ich tun muss, um sie zu beheben ?
"C:\Program Files\Microchip\xc8\v2.40\bin\xc8-cc.exe" -mcpu=16F884 -c
-mdfp="C:/Program
Files/Microchip/MPLABX/v6.00/packs/Microchip/PIC16Fxxx_DFP/1.3.42/xc8"
-fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore
-xassembler-with-cpp -mwarn=-3 -Wa,-a -DXPRJ_default=default
-msummary=-psect,-class,+mem,-hex,-file -ginhx32 -Wl,--data-init
-mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits
-mno-download -mno-stackcall -mdefault-config-bits -std=c99 -gdwarf-3
-mstack=compiled:auto:auto -o build/default/production/newmain.p1
newmain.c
::: advisory: (2049) C99 compliant libraries are currently not available
for baseline or mid-range devices, or for enhanced mid-range devices
using a reentrant stack; using C90 libraries
make[2]: *** [build/default/production/newmain.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
mein Programm
1 | #include "my-configs.h"
|
2 |
|
3 | #define _XTAL_FREQ 4000000
|
4 |
|
5 | #define I2C_BaudRate 100000
|
6 | #define SCL_D TRISC3
|
7 | #define SDA_D TRISC4
|
8 |
|
9 | #define LCD_BACKLIGHT 0x08
|
10 | #define LCD_RETURN_HOME 0x02
|
11 | #define LCD_TYPE 2
|
12 | #define LCD_TURN_ON 0x0C
|
13 | #define LCD_CLEAR 0x01
|
14 | #define LCD_ENTRY_MODE_SET 0x04
|
15 |
|
16 | unsigned char i2c_add;
|
17 |
|
18 | unsigned char RS, i2c_add, BackLight_State = LCD_BACKLIGHT;
|
19 |
|
20 | void main(void) {
|
21 |
|
22 | SSPCON = 0x28;
|
23 | SSPCON2 = 0x00;
|
24 | SSPSTAT = 0x00;
|
25 | SSPADD = ((_XTAL_FREQ/4)/I2C_BaudRate) - 1;
|
26 | SCL_D = 1;
|
27 | SDA_D = 1;
|
28 |
|
29 |
|
30 |
|
31 | i2c_add = "0x4E";
|
32 |
|
33 | IO_Expander_Write(0x00);
|
34 | __delay_ms(30);
|
35 | LCD_CMD(0x03);
|
36 | __delay_ms(5);
|
37 | LCD_CMD(0x03);
|
38 | __delay_ms(5);
|
39 | LCD_CMD(0x03);
|
40 | __delay_ms(5);
|
41 | LCD_CMD(LCD_RETURN_HOME);
|
42 | __delay_ms(5);
|
43 | LCD_CMD(0x20 | (LCD_TYPE << 2));
|
44 | __delay_ms(50);
|
45 | LCD_CMD(LCD_TURN_ON);
|
46 | __delay_ms(50);
|
47 | LCD_CMD(LCD_CLEAR);
|
48 | __delay_ms(50);
|
49 | LCD_CMD(LCD_ENTRY_MODE_SET | LCD_RETURN_HOME);
|
50 | __delay_ms(50);
|
51 |
|
52 | TRISA2 = 0;
|
53 |
|
54 | while(1) {
|
55 |
|
56 | #include "my-loop.h"
|
57 |
|
58 | }
|
59 |
|
60 | return;
|
61 |
|
62 | }
|
63 |
|
64 | void IO_Expander_Write(unsigned char Data)
|
65 | {
|
66 | I2C__Start();
|
67 | I2C__Write(i2c_add);
|
68 | I2C__Write(Data | BackLight_State);
|
69 | I2C__Stop();
|
70 | }
|
71 |
|
72 | void I2C__Start()
|
73 | {
|
74 | I2C__Wait();
|
75 | SEN = 1;
|
76 | }
|
77 |
|
78 | void I2C__Wait()
|
79 | {
|
80 | while ((SSPSTAT & 0x04) || (SSPCON2 & 0x1F));
|
81 | }
|
82 |
|
83 | unsigned char I2C__Write(unsigned char data)
|
84 | {
|
85 | I2C__Wait();
|
86 | SSPBUF = data;
|
87 | while(!SSPIF); // Wait Until Completion
|
88 | SSPIF = 0;
|
89 | return ACKSTAT;
|
90 | }
|
91 |
|
92 | void I2C__Stop()
|
93 | {
|
94 | I2C__Wait();
|
95 | PEN = 1;
|
96 | }
|
97 |
|
98 | void LCD_CMD(unsigned char CMD)
|
99 | {
|
100 | RS = 0; // Command Register Select
|
101 | LCD_Write_4Bit(CMD & 0xF0);
|
102 | LCD_Write_4Bit((CMD << 4) & 0xF0);
|
103 | }
|
104 |
|
105 | void LCD_Write_4Bit(unsigned char Nibble)
|
106 | {
|
107 | // Get The RS Value To LSB OF Data
|
108 | Nibble |= RS;
|
109 | IO_Expander_Write(Nibble | 0x04);
|
110 | IO_Expander_Write(Nibble & 0xFB);
|
111 | __delay_us(50);
|
112 | }
|