Reading ADC and writing to DAC from Nios C program - examples?
Hi. First of all, thank you to Intel and Altera FPGA for the impressively extensive documentation, training lessons, and examples. :)
I am just getting started with Altera/Intel FPGA system, but I've now completed a number of the available demos, and have successfully read from buttons and controlled leds from within running NIOS2 C program, on my Max10.50 Dev. Kit. I have added an ADC, and now need to read ADC data to a variable in the C code. Although I have found just about everything else documented or covered in online training, nothing comes up when i search for examples that include the Eclipse code for simply reading from ADC. It would be great to know i have all the right elements and include files in place, read/write syntax, etc., to do a simple 1 channel read to variable, either from interrupt, or by loop in main until ADC is not 'busy'. The customer training - AD conversion in the Max10 Device - https://www.altera.com/customertraining/webex/max10_adc_toolkit_p3/presentation_html5.html - is top notch, and comes with a very helpful video walk through, to the point where ADC vales are printed to the LCD live. They skip over the compiling and any NIOS2 code required, and go straight to the finished demo showing display values. So the part they skipped over, the code for the NIOS is what i am interested in. Is there possibly a project folder for the above training, with Eclipse project? To summarize, i am wondering if there is C coding example (Eclipse project with .h etc.), that reads ADC value to a C variable, and or, writes a C variable to a DAC, or if anyone has an example handy to share. Thanks, Bob