Forum Discussion
Altera_Forum
Honored Contributor
17 years agoEasy nios design with buttons
Hello, I am a newbie with Quartus II and Nios II and I have been trying to do an easy nios design in order to light on a led when pressing a button. I am working on the Altera Cyclone III EP3C2...
Altera_Forum
Honored Contributor
17 years agoHello,
I've been doing some other stuff and I am now back to my button design. I checked my pin assignments (they are fine) and my base addresses for PIOS in SOPC and the ones in "system.h" matches. I tried the easy program below and when I press the button, nothing happens. It seems that there is still another connection problem but I don't know which one. int alt_main (void) { alt_u8 button = 0x2; while(1){ button = IORD_ALTERA_AVALON_PIO_DATA(PIO_0_BASE); if (button==0x01) printf("button 1"); } return 0; } Thanks for your patience, Myriam