Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/03/03 10:45
Read: times


 
#42834 - Printf getchar getkey
Hi,

encountered a problem.

How can I receive serial data by interrupt and still have the fun of printf?

I see no interrupt on my device (or response).

serial communications works great for

- printf("troela");
- getkey();

but the 'getkey()' holds the program execution. I need a buffered style input.

The printf is only for debug info. No further use in the final application.


Thanks.



void SerialS0 (void) interrupt 4 using 1
{
if (RI != 0)
{
RI = 0;
LED_GREEN ^= 1;
}

if (TI != 0)
{
TI = 0;
}
}


void InitSerialPort()
{
INT_DISABLE;
TI = 0;
TR1 = 0;
ET1 = 0;
PCON |= 0x80;
SCON = 0x50;
TMOD &= ~0xF0;
TMOD |= 0x20
TH1 = 0xEF; 4800 Baud 16 Mhz
TR1 = 1;
SM0 = 0; SM1 = 1;
SM2 = 0;
REN = 1;
TI = 1;
}


List of 9 messages in thread
TopicAuthorDate
Printf getchar getkey            01/01/70 00:00      
   RE: Printf getchar getkey            01/01/70 00:00      
      RE: Printf getchar getkey            01/01/70 00:00      
   RE: Printf getchar getkey            01/01/70 00:00      
   RE: Printf getchar getkey            01/01/70 00:00      
      RE: Printf getchar getkey            01/01/70 00:00      
   RE: Printf getchar getkey            01/01/70 00:00      
   RE: Printf getchar getkey            01/01/70 00:00      
      RE: Printf getchar getkey            01/01/70 00:00      

Back to Subject List