void SerialPort1_ISR(void) interrupt 15
{
if (RI_1==1)
{ /* if reception occur */
clr_RI_1; /* clear reception flag for next reception */
UART_BUFFER[u16CNT] = SBUF_1;
u16CNT ++;
riflag =1;
}
if(TI_1==1)
{
clr_TI_1; /* if emission occur */
}
}
void main (void)
{
P12_PushPull_Mode; // For I/O toggle display
#if 0
//for Simple use UART1 transmit out
InitialUART1_Timer3(115200);
while(1)
Send_Data_To_UART1(0x55);
#else
// For interrupt setting check receive
InitialUART1_Timer3(115200);
set_ES_1; //For interrupt enable
set_EA;
while(1)
{
if (riflag)
{
P12 = ~ P12; //Receive each byte P12 toggle, never work under debug mode
riflag = 0;
}
}
#endif
}
|