Altera_Forum
Honored Contributor
13 years agoNIOS II PIO Data read problem
Hi All.
I have some problems with data processing, based on NIOS core. My FPGA project includes external interface, strobe line (NIOS Internal interrupt or just Flag), 8 bit data input port and FIFOed UART (as stdout). I try to read PIO data from Port, but i see that they are wrong (I have ana another external UART for Debug, included before the NIOS Port). I have no Idea, what is wrong. Please, tell me... Source code: while(1) { do { edge = IORD_ALTERA_AVALON_PIO_DATA(STROBE_BASE); IOWR_ALTERA_AVALON_PIO_EDGE_CAP(STROBE_BASE, 0x0); } while(edge & 1); data = IORD_ALTERA_AVALON_PIO_DATA(DATA_BASE); printf("0x%02X ",data); IOWR_ALTERA_AVALON_PIO_EDGE_CAP(DATA_BASE, 0x0); do { edge = IORD_ALTERA_AVALON_PIO_DATA(STROBE_BASE); IOWR_ALTERA_AVALON_PIO_EDGE_CAP(STROBE_BASE, 0x0); } while((edge & 1) == 0); } Thank you...