ABOUT MM9z1_638 SCI interface

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

ABOUT MM9z1_638 SCI interface

ソリューションへジャンプ
1,680件の閲覧回数
ztzzzttt
Contributor I

i used KT9z1_638_sci_demo to run communicatinon。
try sci DEMO Driver interface
len=SCIReadCh(&cmd[0])
works OK ,i can receive a word。eg:n or  m
but try
len=SCIReadLine(&cmd[0]).eg:123   or abc
it works incorrect,received nothing。
it's len=0 always。

タグ(1)
0 件の賞賛
返信
1 解決策
1,428件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

If I understand, the SCI example code doesn’t work unless you replace the SCIReadLine function with the SCIReadCh function. Or have you somehow modified the code? The SCIReadLine function takes not only a pointer to the received buffer but its length as well.  

Regards,

Daniel

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,429件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

If I understand, the SCI example code doesn’t work unless you replace the SCIReadLine function with the SCIReadCh function. Or have you somehow modified the code? The SCIReadLine function takes not only a pointer to the received buffer but its length as well.  

Regards,

Daniel

0 件の賞賛
返信
1,428件の閲覧回数
ztzzzttt
Contributor I

Thanks for your response。

That is a mistake in cellphone writing before;

I mean that  SCIReadCh function works well、 SCIReadLine function   works incorrect,can't get the right result len=0 always。

I have connected  SCI port to PC(Serial Interface) through a  https://community.nxp.com/thread/?keyword=" style="color: #4285cc; text-decoration: none;inverter(.74lvc04), PC  received  data from MM9z1638 with Baud https://community.nxp.com/thread/?keyword=" style="color: #4285cc; text-decoration: none;rate 34800 and works well.but  MM9z1638 can't readline with SCIReadLine() function ,only can read one word with 

SCIReadCh( )function.if there something wrong with HardWare,or SCI configuration. 

Thanks for your help!

捕获.jpg

0 件の賞賛
返信
1,428件の閲覧回数
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The function actually works correctly.

There is a difference between these two functions.

The SCIReadCH function returns TRUE whenever a character has been received.

Whereas the SCIReadLine function reads the received string and returns its length only if '\n' character is received at the end of the string.

Otherwise the function returns zero.

Regards,

Daniel

1,428件の閲覧回数
ztzzzttt
Contributor I

Thank You I rewrite the receive function in Interrupt .Now ,SCI works well

0 件の賞賛
返信