IMXRT1024 UART Transmit Data Packing Uncertainty

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

IMXRT1024 UART Transmit Data Packing Uncertainty

592 Views
Lukas_Frank
Senior Contributor I

Hi all,

 

I am using IMXRT1024 UART and sending my array "10101010" by using UART_TransferNonBlocking to the TX pin by selecting normal 8 bit data mode. When I observe my data packet on the oscilloscope. It seems like illustrated in the below:

Lukas_Frank_0-1628709822099.png

What I am waiting for :

(start-bit)(10101010)(stop-bit)

What it seems like:

(start-bit)(1)(0000000)(stop-bit) (start-bit)(0)(0000000)(stop-bit) (start-bit)(1)(0000000)(stop-bit) (start-bit)(0)(0000000)(stop-bit) (start-bit)(1)(0000000)(stop-bit) (start-bit)(0)(0000000)(stop-bit) (start-bit)(1)(0000000)(stop-bit) (start-bit)(0)(0000000)(stop-bit)  

Our data bits appears when we extract them from the oscilloscope signal view.

(1)(0)(1)(0)(1)(0)(1)(0)

It seems like there are redundant bits. Why it can be happen? I know that UART sends our data bit by bit. But why it is not sending my data word by word like seen below figure?

Lukas_Frank_1-1628709960271.png

Thanks and Regards.

0 Kudos
3 Replies

572 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

In the SDK example (lpuart_interrupt_transfer), a whole string is sent without issues. Could you share how are you calling the API and the input parameters?

Best Regards,
Alexis Andalon

0 Kudos

567 Views
Lukas_Frank
Senior Contributor I

Hello @Alexis_A ,

Yes, it is sending whole string without issue. The only change that I do on the code is that I defined and uint8_t Array as sending buffer and filled every index of it with the 01010101.....01

for example

 

uint8_t txBuffer[256] = {0};

int16_t iter;

for(iter=0; iter<256; iter++)
{
    txBuffer[iter] = (i % 2);
}

 

After the fill operation of my buffer with 01010101..., I am just using UART_Transfer function in the (lpuart_interrupt_transfer) example. The only change is the buffer in the example. I am just sending my buffer instead of sending default string in the example to view clear signal in the osscilloscope. What is wrong with that? Is that the characteristic behaviour of the UART_TransferSendNonBlocking method?

 

Thanks and Regards.

0 Kudos

557 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello @Lukas_Frank,

You're filling the array with (i % 2), so if the array would be something like:

txBuffer[iter] = {0,1,0,1,0,1,0,1,0,1,0...}

So if you looking to fill the array with (start-bit)(10101010)(stop-bit) that would be with:

uint8_t txBuffer[256] = {0};

int16_t iter;

for(iter=0; iter<256; iter++)
{
    txBuffer[iter] = 0xAA;
}

Best Regards,
Alexis Andalon

0 Kudos