cancel
Showing results for 
Search instead for 
Did you mean: 

Send UART hex command

Mkal.1
Associate

Hi

I'm trying use DFR0534 with STM32f446.

This module read uart command hex.

Ex. Command AA 07 02 00 08 BB

Im trying send like this

char play[6] = {0xAA, 0x07, 0x02, 0x00, 0x08, 0xBB};
HAL_UART_Transmit_IT(&huart4, play, 6);

But in uart monitor recive different command.

Could You help me?

3 REPLIES 3

What is "UART monitor"? How different command does it receive? You are transmitting binary data, is your "UART monitor" capable of displaying binary data, and is it set to that mode of display? Does the baudrate match? Do you use any level conversion between your mcu and the "UART monitor"? Do you have grounds connected? Did you observe the data on the line using oscilloscope or logic analyzer?

JW

Mkal.1
Associate

I change my code

char play[6] = {0xAA, 0x07, 0x02, 0x00, 0x08, 0xBB};
HAL_UART_Transmit_IT(&huart4, play, 6);

And now i get AA 03 00 20 08 BB instead AA 07 02 00 08 BB.

Piranha
Chief II

Looks like physical connection/grounding problems.