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

hello dear all,
i am working on a project about uart interrupt. I want to send a hex file or number and show that on my LCD but i can't show any thing on my LCD i dont know whats my problem. i write my code, main part. i dont have example for uart interrupt and i hope you can help me.

_irq void UART2_IRQHandler(void){

unsigned s[8]; int i=0; char temp; do { temp = UART2_GetChar() ; s[i]=temp; i++;
} while(i<9);
return;}

main part:

int main (void)
{ int i=0; int j=0;
unsigned char lcd_buf[8];unsigned char s[8];

SystemInit(); UART0_Init(); UART2_Init(); LCD_Init(); NVIC_EnableIRQ(UART2_IRQn);

Load_Drow_Dialog(); while(1){

sprintf(lcd_buf,"counter: %d %d %d %d %d %d %d",s[0],s[1],s[2],s[3],s[4],s[5],s[6]); LCD_ShowString(0,30,lcd_buf );
i++; Delay(4000); }
}

0