PIC18F25K42 UART issue
Posted: Wed Oct 14, 2020 12:27 pm
Hi Friends,
I am new to embedded programing.
I tried to develop and implement a simple task with PIC18F25K42 and PIC45K42.
Input1: Switch Output1: generally LED off and blinks if SW_ON. Actual LED status update through UART1.
Input2: Pot Output2: Periodically measures voltage and update value through UART2.
I got simulation result without any issues. But while i tried to compile to HEX, i got warnings and errors which i can't able to understand. Kindly let me know either the mistake i did or steps need to be follow for generating HEX file for implementation.
Note: HEX file successfully created without UART.
Error Message:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Init_1()
398: TXSTAbits.BRGH = 1;
^ (192) undefined identifier "TXSTAbits"
^ (196) struct/union required
401: SPBRG = (((4000000 / (9600)) - / 16);
^ (192) undefined identifier "SPBRG"
402: RCSTA = 0;
^ (192) undefined identifier "RCSTA"
413: RCSTAbits.SPEN = 1;
^ (192) undefined identifier "RCSTAbits"
^ (196) struct/union required
416: TXSTAbits.TXEN = 1;
^ (196) struct/union required
419: RCSTAbits.CREN = 1;
^ (196) struct/union required
427: PIE1bits.RCIE = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S151
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Uninit_1()
698: RCSTA = 0;
^ (192) undefined identifier "RCSTA"
699: TXSTA = 0;
^ (192) undefined identifier "TXSTA"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Send_1()
778: TXREG = nChar;
^ (192) undefined identifier "TXREG"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Receive_1()
891: regcheck = (PIR1bits.RCIF);
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
volatile union S178 -> unsigned char
^ (181) non-scalar types can't be converted to other types
939: regcheck = (RCSTAbits.FERR);
^ (192) undefined identifier "RCSTAbits"
^ (196) struct/union required
942: dummy = RCREG;
^ (192) undefined identifier "RCREG"
949: regcheck = (RCSTAbits.OERR);
^ (196) struct/union required
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: 952: too many errors (21)
(908) exit status = 1
(908) exit status = 1
Error returned from [xc8.exe]
C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1
Thanks in advance Hand.
I am new to embedded programing.
I tried to develop and implement a simple task with PIC18F25K42 and PIC45K42.
Input1: Switch Output1: generally LED off and blinks if SW_ON. Actual LED status update through UART1.
Input2: Pot Output2: Periodically measures voltage and update value through UART2.
I got simulation result without any issues. But while i tried to compile to HEX, i got warnings and errors which i can't able to understand. Kindly let me know either the mistake i did or steps need to be follow for generating HEX file for implementation.
Note: HEX file successfully created without UART.
Error Message:
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Init_1()
398: TXSTAbits.BRGH = 1;
^ (192) undefined identifier "TXSTAbits"
^ (196) struct/union required
401: SPBRG = (((4000000 / (9600)) - / 16);
^ (192) undefined identifier "SPBRG"
402: RCSTA = 0;
^ (192) undefined identifier "RCSTA"
413: RCSTAbits.SPEN = 1;
^ (192) undefined identifier "RCSTAbits"
^ (196) struct/union required
416: TXSTAbits.TXEN = 1;
^ (196) struct/union required
419: RCSTAbits.CREN = 1;
^ (196) struct/union required
427: PIE1bits.RCIE = 0;
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
int -> volatile union S151
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Uninit_1()
698: RCSTA = 0;
^ (192) undefined identifier "RCSTA"
699: TXSTA = 0;
^ (192) undefined identifier "TXSTA"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Send_1()
778: TXREG = nChar;
^ (192) undefined identifier "TXREG"
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: FC_CAL_UART_Receive_1()
891: regcheck = (PIR1bits.RCIF);
^ (255) not a member of the struct/union ""
^ (182) illegal conversion between types
volatile union S178 -> unsigned char
^ (181) non-scalar types can't be converted to other types
939: regcheck = (RCSTAbits.FERR);
^ (192) undefined identifier "RCSTAbits"
^ (196) struct/union required
942: dummy = RCREG;
^ (192) undefined identifier "RCREG"
949: regcheck = (RCSTAbits.OERR);
^ (196) struct/union required
C:\ProgramData\MatrixTSL\FlowcodeV8\CAL\PIC\PIC_CAL_UART.c: 952: too many errors (21)
(908) exit status = 1
(908) exit status = 1
Error returned from [xc8.exe]
C:\Program Files (x86)\Flowcode\Common\Compilers\pic\batch\pic_xc8_comp.bat reported error code 1
Thanks in advance Hand.