Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

UART Interrupts in 8051

Status
Not open for further replies.

raghavkmr

Junior Member level 2
Joined
Nov 26, 2013
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
194
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

Regards
Raghav
 

You apparently want the 8051 to echo received characters, but didn't yet code the respective action?
 

Hi,

UART problems: Baud rate, comm parameters, RS232 conversion, wiring.
With your given informations we can not verify this.

Klaus
 

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.

Regards
 

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    		
}
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top