Forum Discussion
Altera_Forum
Honored Contributor
7 years agoThat looks very helpful, benc, thanks.
I just ran across a project and code that i hope is all i need in NIOS2 for loop-back template. Just few lines of C - it's from years ago, so i am wondering if it needs to be modified, and by how much... http://www.diva-portal.org/smash/get/diva2:22246/fulltext01.pdf (NIOS code below) by José Ignacio Mateos Albiach 2006. I am not sure yet if i should expect to be able to use this same NIOS code on Max10 Dev. boards., NIOS2 Qurtus II, or Quartus Prime. But it IS a simple example to get started from, and perhaps now i can spot similar code in the demos and examples for Intel and NEEK boards, and isolate these functions. Here's the 'loop back' code from the linked DE2 project: <stdio.h> # include "system.h" # include "altera_avalon_pio_regs.h" # include "alt_types.h" int main() { alt_u32 data; int ready; int rdy; data=0; rdy=1; while(1) { ready = IORD_ALTERA_AVALON_PIO_DATA(READY_BASE); if (ready==1) { rdy=1; } if ((ready==0) & (rdy==1)) { rdy=0; data = IORD_ALTERA_AVALON_PIO_DATA(DATA_FOR_NIOSII_BASE); IOWR_ALTERA_AVALON_PIO_DATA(DACDAT_BASE, data); } } return 0; } I don't know if i can use the same functions as shown, but for Max10 NEEK board or Intel Max10 board yet, or something entirely different, but it may help. The project builds the IP it needs by the looks of it. No audio 'includes', no Quatrus library 'audio' IP cores.