Buenas, estoy trabajando con el compilador XC8 y me esta dando un error en la libreria de usart
:0: error: (500) undefined symbols:
_baudUSART(dist/default/production\Prueba.X.production.obj) _OpenUSART(dist/default/production\Prueba.X.production.obj) _putsUSART(dist/default/production\Prueba.X.production.obj)
(908) exit status = 1
Estoy tratando de hacer una comunicacion Uart
mi codigo es el siguiente:
#include <xc.h>
#include <config_USB.h>
#include <plib/delays.h>
#include <plib/usart.h>
#include <pic18f4550.h>
void main(void) {
//definicion de señales de control del puerto paralelo centronic
TRISDbits.RD0 = 0; //defino Busy como salida
TRISDbits.RD1=1; //defino Strobe como entrada
UART_Init();
Delay10TCYx(50);
LED_ERR = 0;
LED_USB = 0;
LED_USB = 1; //si el USB esta presente enciendo led
// char *String;
char dato;
// String = dato;
while (1){
if (STB == 0){
Busy = 1; //levanto busy para frenar los datos
dato = receive_char();
putsUSART((char *)dato);
//WriteUSART(dato);
Busy = 0; //Bajo busy para el proximo dato
}
break;
}
}
void UART_Init(void){
unsigned char config=0;
unsigned int spbrg=0;
unsigned char baudconfig=0;
CloseUSART(); //turn off usart if was previously on
//-----configure pin USART -----
TRISCbits.RC7=1; //defino RX como entrada
TRISCbits.RC6=0; //defino TX como salida
RCSTAbits.CREN = 1; // Habilitamos el Port Serial
RCSTAbits.SPEN = 1; // Habilitamos el Port Serial
TXSTAbits.TXEN = 1;
// RCSTAbits.RX9 = 0; //habilita recepcion de 8 bits
// TXSTAbits.SYNC = 0; //asynchronous mode
//------establezco la configuracion------
config = USART_TX_INT_OFF | USART_RX_INT_OFF | USART_ASYNCH_MODE | USART_EIGHT_BIT |
USART_CONT_RX | USART_BRGH_LOW;
//-----SPBRG needs to be changed depending upon oscillator frequency-------
spbrg = 6; //At 4Mhz of oscillator frequency & baud rate of 9600.
OpenUSART(config, spbrg); //API configures USART for desired parameters
baudconfig = BAUD_8_BIT_RATE | BAUD_AUTO_OFF;
baudUSART (baudconfig);
}
Desde ya muchas gracias.