- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have create a component with Qsys in Quartus and I would like send a interrupt from this component to the HPS with linux.
But I don’t hnow how my C program can received a interrupt (with request_irq(...) ?).
Can you help me with example ?
Thanks,
Arnaud
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page