The RS485 in MQX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The RS485 in MQX

Jump to solution
476 Views
小勇邹
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 Kudos
1 Solution
300 Views
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

View solution in original post

0 Kudos
1 Reply
301 Views
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 Kudos