Buffer on UART3
Posted: Fri 2. Dec 2016, 11:15
Hi,
I plug a RFID reader on the serial port (38400 baud). In my main loop I wrote a RFID_Task which read the UART3.
before I change the serial port speed to 38400.
My RFID_task function read only one bit !!!
is it possible to create a buffer on UART3 and read 8 bit ?
Thanks
Best Regards
I plug a RFID reader on the serial port (38400 baud). In my main loop I wrote a RFID_Task which read the UART3.
Code: Select all
void RFID_task()
{
static u16_t ret=0;
u8_t temp[8];
ret = UART_read(temp,8,UART3);
if(ret > 0)
{
UART_write("OK\r\n",sizeof("OK\r\n"),UART3);
UART_write(temp,8,UART3);
UART_write("\r\n",sizeof("\r\n"),UART3);
led_setPattern (LED_ON, LED_2, LED_GREEN);
Set_RFID(temp);
}
}
Code: Select all
void change_UART3()
{
// Vitesse du port a 38400
unsigned long tmp;
VICIntEnClr |= (1<<29); //Disable interrupt UART3
tmp = U3LCR;
U3LCR = 0x80 | tmp; // DLAB=1 , enable writeaccess to divisor latch register
U3DLL = 74; //UDLL
U3DLM = 0; //UDLM;
U3FDR = (12<<4) | (7&0xF); //(MulVal<<4) | (DivAddVal&0xF)
U3LCR = tmp; // DLAB=0 , disable writeaccess to divisor latch register
VICIntEnable |= (1<<29); //Interrupt Enable UART3
}
is it possible to create a buffer on UART3 and read 8 bit ?
Thanks
Best Regards