SCI Problem

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

SCI Problem

3,389件の閲覧回数
martyseb63
Contributor I
Hello,

I wanted to know how can we receive data with serial port on the MC9S08GT60.

In SMAC, there is a file nammed SCI.h.

For send a message, there is no problem, but to receive, I don't know how to do.

I tried SCIgets(...) but it doesn't work.

Can you tell me how can I do.

Thank for your help
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,212件の閲覧回数
alex_spotw
Contributor III
Hi:

You should check for the RDRF flag in the Register SCI1S1. Something like this:

char Wait_for_RxCharacter()
{
while(!SCI1S1_RDRF);
return SCI1D;
}

Regards,

Alex
0 件の賞賛
返信

1,212件の閲覧回数
mjcoury
Contributor I
If you look at the SCI.c and vectortable.c the example code (i.e. accelerometerV2) uses an interrupt to capture data recieved on UART1... you have to be careful though the example code has recieved bits from UART1 and UART2 call the same ISR interrupt void Vscirx() and only clears UART1....
0 件の賞賛
返信

1,212件の閲覧回数
hamid166262
Contributor I
Hi,

I have same problem to use SCIgets()

Can anyone put some sample code here that uses SCIgets() to read from serial port?
It's an urgent need. please help me!

Regards

Hamid
0 件の賞賛
返信