Hello.
I'm trying to build a system to be used as a slave device on Maple mini.
I was able to communicate successfully communication master device to a Maple Mini slave device.
However, in case of multiple slave devices(almost MapleMini), MapleMini slave device will start the communication all connected MapleMini slave devices, Or initiate communication at the same time other slave device even if trying to communication, this can not properly.
SPI interrupt is NSS pin MapleMini slave device is not working properly.
Or processing SPI interrupt not using the NNS pin .
Do you know how to resolve?
-------------------------------------------------------------------------------------------
#include <spi.h>
byte sendResult = 0;
void setup()
{
SPI.beginSlave(MSBFIRST,SPI_MODE_3);
pinMode(BOARD_SPI2_NSS_PIN, INPUT);
spi_irq_enable(SPI2, SPI_RXNE_INTERRUPT);
}
void loop()
{
digitalWrite(BOARD_LED_PIN, LOW);
}
extern "C"
{
void __irq_spi2(void)
{
digitalWrite(BOARD_LED_PIN, HIGH);
SPI.transfer(sendResult);
sendResult++;
if(sendResult < 100) sendResult = 0;
}
}