SCI Problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

SCI Problem

3,393 次查看
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,216 次查看
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,216 次查看
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,216 次查看
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 项奖励
回复