Altera_Forum
Honored Contributor
20 years agohow to set i/O
i have set one i/o pin to bidirectional(tri-state) I/O port,and finished the hardware compile.
but in the nios II IDE ,how to set the bidirectional(tri-state) I/O port to out por ! the following is my code (the name of pio is ADATA) int main() {//dir=0; //IOWR_ALTERA_AVALON_PIO_DATA(LEVELCONTROL_BASE,1); IOWR_ALTERA_AVALON_PIO_DIRECTION(ADATA_BASE,0XFFFF); //alt_irq_register(TIMER_0_IRQ,0, handle_Timer0_interrupts); //IOWR_ALTERA_AVALON_TIMER_PERIODL(TIMER_0_BASE, 0X1F40); //IOWR_ALTERA_AVALON_TIMER_CONTROL(TIMER_0_BASE, 7); IOWR_ALTERA_AVALON_PIO_DATA(ADATA_BASE, 0XFFFF); while (1) {;} }! but when i test the value of the pio ,there is no value(even i set IOWR_ALTERA_AVALON_PIO_DATA(ADATA_BASE, 0) why ?? thanks! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif