Altera_Forum
Honored Contributor
13 years agoRS232C Packet Loss
Hello,
I am working with my custom board, and having problem communicating via RS232C. In very rare occasion, commands seems to be ignored, lost, or thrown away. My C code is somewhat like below:===int main() { char cmd[100]; alt_ic_isr_register(CUSTOM_FPGA_CONTROLLER_ID,CUSTOM_FPGA_IRQ, func, NULL, NULL); while(1) { scanf(%s, cmd); printf("packet received\n"); } } alt_isr_func func() { // disable irq here, // do something here, // enable irq here. return 0; } ===== packet loss I mean here is that chararcters "packet received" won't be returned when I send characters to the board. I inserted debug codes and found out that the packet loss occurs when interrupt from custom FPGA and packet receiving (probably rs232c interrupt) happens simultaneously. Is there any way to avoid this problem, or am I missing something important? Evironment : Quartus:11.0sp1 Web Edition NIOS II: 11.0sp1 for Eclipse FPGA: CycloneIII Any advice appreciated, Thanks.