Forum Discussion
4 Replies
- JOHI
Contributor
Hello,
https://people.ece.cornell.edu/land/courses/ece5760/DE1_SOC/DE1-SoC-UP-Linux/Linux.pdf (see last pages)
You will need to compile a kernel module.
I would be happy to learn from your expericences, I play with the idea to do the same thing some time.
Best regards,
Johi.
- AVoye
New Contributor
Hello,
This document is very interresting but I wanted to make a C program with a main so I am going test the request_irq function.
Thanks for you answer.
Arnaud.
- Ahmed_H_Intel1
Frequent Contributor
Hi,
Please check the following document witch show how to write a simple interrupt routine.
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/an/an284.pdf
Also you can go with the VIC (Vectored Interrupt Controller)for advanced interrupt routines
Regards.
- Ahmed_H_Intel1
Frequent Contributor
BTW, The DE0 nano SOC has a SPI connection with ADC on board, use the following example to understand how to use the SPI ADC.
I have created this example before, not officially released
Here is the main code to read from the ADC (DE0_Nano_SoC)
/* * "ADC" example. * * This example gets the data of the ADC and convert it to digital to implement on LEDs * Developer: Embedded guy * Nov 2018 * DE0 Nano SoC */ #include <stdio.h> #include "system.h" #include "altera_up_avalon_adc_regs.h" #include "altera_up_avalon_adc.h" #include "altera_avalon_pio_regs.h" #include "alt_types.h" alt_up_adc_dev * ADC_DEV; unsigned int ADC_DATA=1; int main() { printf("Starting \n"); //Enable ADC auto update alt_up_adc_auto_enable(ADC_DEV); //Open the ADC device ADC_DEV= alt_up_adc_open_dev("/dev/adc_0"); if (ADC_DEV==NULL){ printf("Cannot open ADC"); } while (1){ unsigned ch=0; ADC_DATA = alt_up_adc_read(ADC_DEV,ch); printf("ADC data of CH0= %d \n",ADC_DATA); int delay=0; while (delay<5000000){ delay++; } } return 0; }Please feel free to ask for support if needed.
Regards.