K60 serial communication gets() scanf()

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K60 serial communication gets() scanf()

922件の閲覧回数
smaschy
Contributor II

Hey Guys,

I'm trying to communicate with my twr-k60d100m via the uart3.

From uC to PC everything is fine but I'm not able to send a line from the PC to the uC.

I can send and receive single chars but i get some trouble when I'm trying to receive a whole line from the PC.

My Project: The uC sends every second some data to the PC but sometime I need to send some Numbers like "15" or "5000" from the PC to the uC to configure some delay time of the uC.

char str[10];
gets(str);
printf("%s",str);

with this code the uC get stucked.

Can someone help me to solve my problem? 

Is there a good example for UART interrupts (bare metal) for the twr?

Thanks 

KDS 3

SDK 1.3 

bare metal code

タグ(3)
0 件の賞賛
1 返信

467件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Smaschy,

   If you want to receive strings from the uart, you can use the uart interrupt to receive it.

  About the bare metal driver, you can refer to this post:

UART transmition in isr for k60 

Cano Cano already share the uart bare metal driver.

Wish it helps you!


Have a great day,
Kerry

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

0 件の賞賛