UART 250k baudrate in MarsBoard

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

UART 250k baudrate in MarsBoard

跳至解决方案
1,980 次查看
mafiawolf
Contributor II

Anyone can help me to configure UART to 250k baud rate with 2 stop bit please?
I want it to handle DMX512 signal but I cant find any solution over Internet
I am now using MarsBoard by Embest-tech with 4 UART (UART1, UART3, UART4, UART5) and using C code in Linux.

I've used this
https://jim.sh/ftx/files/linux-custom-baudrate.c

with

void DMXInit(){

int u = open("/dev/ttymxc3", )WRONLY|O_NOCTTY|O)NDELAY);

if(u< 0)

     error("....");

else

     printf(".....");

serial_open(u, 250000);

}

And I use this to send data from dmx_data[512] array.

void DMXSend(int port, uint8_t * buffer, uint32_t size){

write(port, buffer, size);

}

And connect to UART 3

..And "stty -F ttymxc3" is reply "speed 3000000 baud"

So, I dont think it work!

Anyone try this?

Please help me!

Thanks for your reading!

标签 (3)
0 项奖励
回复
1 解答
1,783 次查看
mafiawolf
Contributor II

AAAa..
I've solved this problem, just 've used termios2

:smileygrin:

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,784 次查看
mafiawolf
Contributor II

AAAa..
I've solved this problem, just 've used termios2

:smileygrin:

0 项奖励
回复
1,783 次查看
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Have you checked with a scope to verify which baudrate is configured?

That would  provide more information. It could be that it is not possible to get that baudrate with  reference clock for the UART module and that needs to be changed, or just the message output is incorrect. Which Linux version are you using?

Best Regards,

Alejandro

0 项奖励
回复
1,783 次查看
mafiawolf
Contributor II

Anyone can help?

0 项奖励
回复