This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

uart interrupt receive read

hi all, 
I want to read uart receive values. my interrupt is working. But for example when ı send 0x02, ı should light a led. 
I should understand the value. Can u help me please? 
my codes;


#include "N76E003.h"
#include "SFR_Macro.h"
#include "Common.h"
#include "Delay.h"
#include "Function_define.h"


unsigned char c;
bit riflag;
void SerialPort0_ISR(void) interrupt 4
{
if (RI==1)
{
clr_RI;
c = SBUF;
riflag =1;
}
}

void main (void)
{
P12_PushPull_Mode;
P07_Quasi_Mode;
InitialUART0_Timer1(9600);
set_ES;
set_EA;

while(1)
{
if (riflag)
{
P12 = ~P12;
riflag = 0;
}
}
}