Forum Discussion
Altera_Forum
Honored Contributor
11 years ago- Back in Qsys, the file DE0_NANO_SOPC.qip can be added (by right clicking on Files)
- Select File > New Block Diagram, right click in the blank space > insert symbol and select de0_nano_sopc - Insert the symbol, right click it and select generate pins for symbol ports - Save as my_adc.bdf - Start Compilation - Use the Pin Planner to Assign the pins (Attachment in above post) - Start Compilation - Open Nios II and select ADC_example as the workspace - Select new > nios ii application and bsp from template - Select the DE0_NANO_SOPC.sopcinfo - File, name the project hello, select the hello world small template and click finish. Right click Hello_bsp > Nios II > BSP Editor - In the BSP Editor hit enable_small_c_library and click generate - In Nios II right click Hello and select build project - Connect your board using a USB-cable that is not too long. Open Quartus II Programmer, add file my_adc.sof (if the USB Blaster doesn't work, look here http://www.alteraforum.com/forum/showthread.php?t=28514) - Click Start to be happy to see Progress: 100% (Successful) - In Nios, right click Hello and select run as > nios ii hardware - Be happy to see 'Hello from Nios II!' in your console! - Double click hello_world.c (under Hello). Insert the C code from page 11 of the manual (ftp://ftp.altera.com/up/pub/altera_material/12.1/tutorials/de0-nano/using_de0-nano_adc.pdf). - Open the project folder and open de0_nano_sopc.html (in the folder DE0_NANO_SOPC) in your browser and find the adresses of the SOPC components. - In the C-Code, change the defined adresses of adc_addr and led_addr accordingly. - Save hello_world.c and build the project - Setup the Hardware using a (100K) potentiometer like on page 135 of the DE0_NANO_User_Manual (or page 4f of 'Using_DE0-Nano_ADC') - In Nios right click Hello and run as > nios ii hardware to see that now the binary output register is assigned to the LEDs. - Back in Nios, edit the C-Code by inserting printf("Philipp is the boss!\n"); right under int main (void){. - Save, Build Project and run as > nios ii hardware to give me thanks ;)