Hey, I am trying to read some data from a chip. I use SPI. But it seems overflow. My speed is 2Mhz. I need to store 16224 bit. I guess I need to use DMA, But I have no idea about it.
How could I use it?
Here is my code.
#include <SPI.h>
int i=0;
void setup() {
pinMode (50, OUTPUT);
pinMode (52, OUTPUT);
SPI.begin();
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV2);
SPI.setDataMode(SPI_MODE1);
}
void loop() {
SPI.transfer(9);
SPI.transfer(0);
}
And this is the code for Maple to read data
HardwareSPI spi(1);
int i;
void setup() {
spi.beginSlave(MSBFIRST, 1);
}
void loop() {
byte response = spi.read();
SerialUSB.println(response, BIN);
}
Thanks,