Continue to Site

Welcome to

Welcome to our site! 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.

Problem with serial port interrupt in MSC1211y5

Not open for further replies.


Newbie level 1
Mar 5, 2006
Reaction score
Trophy points
Activity points
I am working with Msc1211y5, 24 bit A2D with 8051 microcontroller. In my program, I have enabled A2D and timer 0 interrupts. When I also enable serial port 0 interrutps(Both send and receive are enabled with a same flag) the speed of executing the program is reduced. This happeds also when we do not send any data to msc1211y5, and trasmitting data by msc1211y5 is done with "printf" command. It seems that TI_0 is set and program jump to serial port 0 ISR. Clearing TI_0 in ISR also cause the program not send any data to serial port and it seems the program stay in ISR. We use the Keil software to compile our programs.

Could anybody give an idea what I do so, or what i'm doing wrong.
Thank you.

You have three choices:

1. Post your program here. There are a lot of keil experts on forum (not me)
2. Get familiar with your best friend when using HLL, I call it the integrated keil debugger
3. The last and most unpleasent ones, try parsing the object code after linker's job and feel more comfortable with compiler's behaviour

I've notice you're familiar with some low level staff.
"Clearing TI_0 in ISR"
That's a must because it's not done automaticaly when exit ISR
"it seems the program stay in ISR"
Well either there is no RETI at the end of ISR or the Timer 1 it's not started to feed the internal shift register and obvious program is frozen inside ISR (well if Timer 1 isn't started you got no interrrupt, only if you force the interrupt by manual writing either TI_0 or RI_0).
"It seems that TI_0 is set and program jump to serial port 0 ISR"
TI_0 is set to indicates that data in the serial Port 0 buffer has been completely shifted out (in this case Timer 1 is running). Thus you must be able to see something coming out from serial port. When printf is performed, simply writing first byte of the string to SBUF will not raise the interrupt flag. It only start the transmission. Only when the byte is completelly shifted out the TI_0 is set at the end of the 8th bit in serial mode0 or at the begining of the stop bit in other modes and the interrupt is issued.
"Both send and receive are enabled with a same flag"
It's 8051 core, you have to figure out who is the one that request interrupt by looking at bit 0 and bit 1 of SCON SFR register.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to