hi
i am writting a program to recieve data throuth serial port (UART) of
AT89S51 microcontroller.Using the interrupts i have wriiten the ISR as
void serial_ISR () interrupt 4 using 2
{
if(RI == 1)
{
led = on;
RI=0;
}}
the interrupt is occuring but the led do not get ON
if i write ISR like this
void serial_ISR () interrupt 4 using 2
{
led = on;
if(RI == 1)
{
RI=0;}
}
now led gets on
this means it is getting some thing but why RI == 1; is not working
do the recieve flag automatically gets clear
I posted a reply very early this AM but it is gone along with several others.
First use the # tool to place code tags around your code to make it readable.
For testing I would use 3 LEDs or breakpoints if you have run control. The serial interrupt can be set by the RX or TX. Check for both and neither which in theory should not happen. Check anyway.