UART communication with Putty

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

UART communication with Putty

Jump to solution
2,355 Views
songja
Contributor III

Hi,

I am printing 8 ADC values out to Putty and save the log file as "*.csv".

But when I checked the printed values, there are no taps between them even though I added '\t'.

for example, if the values were "1, 2 3, 4, 5, 6, 7, 8", the saved value in CSV file is "12345678".

I am using FreeRTOS  and the code is attached below.

I also tried to print all the values together with one variable. 

void uart_task(void)
{
      char TEMP[32];

      TickType_t xLastWakeTime;

      uart_config.srcclk = DEMO_UART_CLK_FREQ;
      uart_config.base = DEMO_UART;

      UART_RTOS_Init(&handle, &t_handle, &uart_config);

      

      for(;;)

      {
            xLastWakeTime = xTaskGetTickCount();

            for (int i = 0; i < NOS; i++ )

            {
                  sprintf(TEMP, "%d",OFFSET[i]-ADC_VALs[i]);
                  UART_RTOS_Send(&handle, (uint8_t *)TEMP, strlen(TEMP))

            }

      UART_RTOS_Send(&handle, "\r\n", strlen("\r\n"));
      vTaskDelayUntil(&xLastWakeTime, 20);
      }
UART_RTOS_Deinit(&handle);
vTaskSuspend(NULL);
}

Thanks,

Tags (4)
0 Kudos
1 Solution
1,920 Views
songja
Contributor III

Hi Kerry,

I was saving the data as "printable output" via Putty and I changed it to "All session output".

Moreover, saving the data as '*.csv' causes the problem as well (The format somewhat collapsed).

Once I use "All session output" and save the data as '*.txt', it works fine.

Thank you very much for your help!

Jay

View solution in original post

0 Kudos
3 Replies
1,920 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi JAEYONE SONG,

    You can change a PC serial terminal software to receive the data, whether it have the tab or not.

    I think this problem should caused by the PC putty.

    After you receive the data in the terminal, you can copy the data, then save it to the file .csv.

    Please try it again.

    If you still have problem about it, please tell me what the kinetis chip you are using now, tell me the partnumber.

    Besides, you also need to give me the PC side received data, then give me the screen shoot about your problem .csv.

   


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,921 Views
songja
Contributor III

Hi Kerry,

I was saving the data as "printable output" via Putty and I changed it to "All session output".

Moreover, saving the data as '*.csv' causes the problem as well (The format somewhat collapsed).

Once I use "All session output" and save the data as '*.txt', it works fine.

Thank you very much for your help!

Jay

0 Kudos
1,920 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Jay,

    Good!

So, if the problem is solved, please help me to mark the correct answer, just to close this case, thank you!

Have a great day,
Kerry

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos