简体   繁体   中英

Uart higher BaudRate problems in Raspberry Pi

Any idea why my native C application can't reach higher baudrates than 38400? I have exactly the same application which i successfully initialize to listen and transmit on 9600, 19200, 38400 baudes. However as soon as i set up for 57600 i get garabage out of the transmitter(receiver i don't know). I'm listening to it with a terminal so i see the garbage directly from pin header.

I use Raspbian and uart on Pin 14 and 15 of the GPIO header.

Is there any adjustment of some precission fraction which causes the problem?

Right now i just do this (and it works): cfsetispeed(&options,B38400); cfsetospeed(&options,B38400); tcsetattr(uart0_filestream, TCSANOW, &options); fcntl(uart0_filestream, F_SETFL,O_NDELAY);

TX part: int a = write(uart0_filestream, StartOfTheMessage, Length);

Thank you.

您的UART线不支持更高的波特率。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM