The RS485 in MQX

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

The RS485 in MQX

跳至解决方案
1,008 次查看
小勇邹
Contributor II

I want to use the example of the RS485 in

C:\Freescale\Freescale_MQX_4_1_TWRK64F120M\mqx\examples\rs485\build\iar\rs485_twrk64f120m.

But The data type is string char  data_buffer[] = "RS485 send example";

If I want to send and receive a number data with BYTE type.

For example.   0x01 0x02 0x01 0x01 0x01 0x01 0x01 0x01 0x01 0x10.

     BYTE data_buffer[10];

     data_buffer[0]=0x01;  
data_buffer[1]=0x02;      
data_buffer[2]=0x01; 

data_buffer[3]=0x01;

data_buffer[4]=0x01;  

data_buffer[5]=0x01;

data_buffer[6]=0x01; 

data_buffer[7]=0x01; 

data_buffer[8]=0x01;

data_buffer[9]=0x10;  

 

The master sends the data in the data_buffer[10] and the slaver receives the data data_buffer[10].

It is very easy to write the source code without OS. But I do not know how to do in the MQX.

How to realize it in the MQX ?

0 项奖励
回复
1 解答
832 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Robin:

I think you can transform the string into byte. you can do it in rx or tx side.


Have a great day,
Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
833 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Robin:

I think you can transform the string into byte. you can do it in rx or tx side.


Have a great day,
Daniel

0 项奖励
回复