Hi,
i am currently working on spi interrupts. But without success. The goal is to get an interrupt when data arrive to the slave.I have already testet following ideas:
What is the proper way to avoid a polling operation mode with SPI?
Hi,
i am currently working on spi interrupts. But without success. The goal is to get an interrupt when data arrive to the slave.I have already testet following ideas:
1)
<<code>>
extern "C" void SPI_IRQHandler() {
printf("spiSlave read IRQ - B\n\r");
if (spiSlave.receive()) {
state = spiSlave.read();
spiSlave.reply(state);
printf("spi read1: %i\n\r",state);
}
}
<</code>>
2)
<<code>>
void spiCheck(){
state = spiSlave.read();
spiSlave.reply(state);
printf("spi read1: %i\n\r",state);
}
main(){
NVIC->IntSelect &= ~(1 << SPI_IRQn);
NVIC_SetVector(SPI_IRQn, (uint32_t)&spiCheck);
//NVIC_SetPriority(SPI_IRQn, 0);
//LPC_SPI->SPINT=1;
NVIC_EnableIRQ(SPI_IRQn);
while(1);
}
<</code>>
What is the proper way to avoid a polling operation mode with SPI?
A.H are you able to get the slave SPI to work? I am not able to get it to work even in polling mode.
Can I leave slave select line unconnected?
In my setup slave select is different. I have 4 adress lines coming to my slave and we enable SPI or disable SPI based on the address on this address lines. I have to drive the slave select by software on slave itself.
Any thoughts?
A.H are you able to get the slave SPI to work? I am not able to get it to work even in polling mode.
Can I leave slave select line unconnected?
In my setup slave select is different. I have 4 adress lines coming to my slave and we enable SPI or disable SPI based on the address on this address lines. I have to drive the slave select by software on slave itself.
Any thoughts?
Hi,
SlaveSPI works with polling mode. Another workaround was to read the CS line also on a InterruptIn, so i can trigger the Read-Function to a flange of this signal.
For your problem i see only one quick solution at the moment. Set a output-pin when your adress is correct and set this output also on the CS of the spi. So you have to generate this CS-Signal by yourself.
Hi,
SlaveSPI works with polling mode. Another workaround was to read the CS line also on a InterruptIn, so i can trigger the Read-Function to a flange of this signal.
For your problem i see only one quick solution at the moment. Set a output-pin when your adress is correct and set this output also on the CS of the spi. So you have to generate this CS-Signal by yourself.
its wiered how this SPI slave interface works. It requires the CS line to be toggled everytime a byte comes in. If I keep it low(always selected) it did not work. On ST chips this is fine. anyway thanks for the input.
Regards,
Shankar
its wiered how this SPI slave interface works. It requires the CS line to be toggled everytime a byte comes in. If I keep it low(always selected) it did not work. On ST chips this is fine. anyway thanks for the input.
Regards,
Shankar
Important Information for this Arm website
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
How do I attach an ISR for SPI TXE and RXNE interrupts?
Thanks and Regards, Shankar