SCI Problem

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

SCI Problem

2,563 Views
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
Labels (1)
0 Kudos
3 Replies

386 Views
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 Kudos

386 Views
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 Kudos

386 Views
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 Kudos