--- Quote Start ---
You are correct with your assumption.
The FPGA will be part of a device that performs specific tasks and will be remotely controlled via SPI form a different device.
So we implemented a SPI interface with the new Qsys and configured it to behave as a SPI Slave device.
I have taken a look in the guide before but I am afraid I need more guidance.
My specific Problem is this:
The FPGA will receive a Command String from another device telling it what to do.
I need to understand how I can activate the SPI interrupt in C, so that everytime a transmission is started the interrupt handler can do what I need it to do. I believe I need to register the interrupt or something and define the handler.
SO far I tried this:
Initialising:
void init_spi{
/* Enable SPI read-ready interrupt */
alt_irq_register(SPI_0_IRQ, (void*) &spi_context, handler_spi_isr);
}
handler:
static void slave_spi_isr(void* context, alt_u32 id)
{
printf("Works, yay!\n");
}
I put that in the Hello_World example and it compiles okay.
But an spi command send to the fpga does not trigger the
handler. What's weird though, when I did the same inside the
NIOS 2 Debugging enviroment, there was an error message
telling me "target faild to interrupt".
I am sorry, if my questions or my confusion seems stupid,
but I am more used to 8-bit architectures, where I can look
up the internal register structure of a given processors
hardware and where I know every Register by heart.
--- Quote End ---
Hi Trixter,
I am trying to do the same (The FPGA will receive a Command String from another device telling it what to do) as you have tried sometime back.
My applications needs SPI slave to raise the interrupt after receiving certain number of bytes (for example say 4 bytes). I did not find much information in Altera Forum on SPI slave.
I would like to ask if you have found solution for your problem. Could you please share any information or link or document which could help me to implement the SPI slave.
Thanks in advance.
Regards
pavan