I am trying to make a code to send the binary through the UART instead of the ASCII through the UART. Is there any function I can call with for the application?
I am not sure i get the question, when you send data over the UART they are just binary data, zeros and ones, how you interpret them results to hex numers or ascii.
For example, if we want to use the "data=0x08; printf_byte(data);" to send in ascii, we will get two bytes, 0x30 and 0x38 then it displays as "0" and "8". If I send through the data link it will cost more bandwidth, so I want to directly to send "0x08" in hex instead.
If you are using the common_uart functions i assume that you are using the an example from the peripheral examples projects, so you could use the uart2_write() directly in order to do what you want, since the printf_byte converts the data in hex format.
Hi liuluan002,
I am not sure i get the question, when you send data over the UART they are just binary data, zeros and ones, how you interpret them results to hex numers or ascii.
Thanks MT_dialog
For example, if we want to use the "data=0x08; printf_byte(data);" to send in ascii, we will get two bytes, 0x30 and 0x38 then it displays as "0" and "8". If I send through the data link it will cost more bandwidth, so I want to directly to send "0x08" in hex instead.
Hi liuluan002,
If you are using the common_uart functions i assume that you are using the an example from the peripheral examples projects, so you could use the uart2_write() directly in order to do what you want, since the printf_byte converts the data in hex format.
Thanks MT_dialog