Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

how to set i/O

Altera_Forum
Honored Contributor II
949 Views

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)http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif  

why ?? 

thanks!
0 Kudos
0 Replies
Reply