Hi i am using 8051 microcontoller with uart interrupts
I am using minicom (in Ubuntu ) as hyperterminal for serial console (uart) of 8051
When i give an input using keyboard , i cannot see what i entered on minicom terminal,but the code works ,as i can see the correct output on minicom
How to see what i entered
I can see the text entered by using loopback option of minicom ,but what if i don't wanna use that
Hi,
I coded a printf inside interrupt service routine to echo the characters ,but it slows down the interrupt process and I miss some characters that I enter through keyboard.
How to echo without this problem
Regards
Sameer
- - - Updated - - -
Baud Rate : 115200 , yes there is RS232 to USB conversion
because I am getting the correct output from 8051 to minicom terminal for a given keyboard input ,so I am supposing that wiring and comm parameters are correct.
A prinf function is not needed to echo back a character. Just put the received character in the UART transmitter buffer. ( An example below for an AT89C51ED2 microcontroller)
Code:
void serial_interrupt_handler(void) __interrupt 4 __using 1 // sdcc serial interrupt name
{
if (RI == 1)
{ // if reception occured
RI = 0; // clear reception flag for next reception
sdata = SBUF; // Read received data
SBUF = sdata; // Echo data to uart
}
else // if transmission occured
TI = 0; // clear transmission flag for next transmission
}