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
1,173 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) 

why ?? 

thanks! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/sad.gif
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
469 Views

Hi, I am having the same problem from time to time.  

Usually it starts working after re-generation of the system in SOPC builder and Quartus, sometimes try changing the location of the pin in SOPC and moving it back again. Hope it will work, I would also like to know why this is happening.
0 Kudos
Altera_Forum
Honored Contributor II
469 Views

but i cannot output the data by the bidir port! 

how could it output the data?
0 Kudos
Altera_Forum
Honored Contributor II
469 Views

 

--- Quote Start ---  

originally posted by wbqyy@Dec 15 2005, 09:43 PM 

but i cannot output the data by the bidir port! 

how could it output the data? 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11598) 

--- quote end ---  

 

--- Quote End ---  

 

 

I had the same problem - no data at the output, recompilation as I described in previous post helped it...
0 Kudos
Reply