Please help, 2 different SPI libraries not getting along with one another....

themindfactory
Posts: 58
Joined: Mon Mar 26, 2018 7:57 pm

Please help, 2 different SPI libraries not getting along with one another....

Postby themindfactory » Mon Aug 13, 2018 9:22 pm

I had to use 2 different SPI libraries because the SD class needs SPIClass and my WS2812 controller needed another so it could support the continuos sending of data with no breaks, it did this by ways of DMA, DMA was not required by me, but this is how it did it....

If I could make SPI Class send a continuous stream of bits over SPI then I could use one, but I can not, have tried.... there is always a time gap from one transmission to the next.

I have attached 2 files that support the DMA continous stream....

I would get error messages that said spiwp pin not defined... which is very odd, then it would crash and reset, it would give this message when it was executing this... E (7793) spi: spicommon_bus_initialize_io(146): spiwp pin required.

mySPI.begin(MOSI_PIN, MISO_PIN, SCLK_PIN, 12 * nLEDS);
mySPI.addDevice(SPI_MODE, SPI_CLOCK, CS_PIN, &spiDevice);

it would happen during the .addDevice phase....

Decoding stack results
0x4010001d: spi_bus_add_device at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/driver/spi_master.c line 385
0x400e8505: __SPI::addDevice(unsigned char, unsigned int, int, spi_device_t**) at C:\Users\Richard\AppData\Local\Temp\arduino_build_517973\sketch\spi.cpp line 96
0x400e389a: releaseSD() at E:\Documents\projects\CDStick\current\cdstick_2/cdstick_2.ino line 3900
0x400e39b9: testSD() at E:\Documents\projects\CDStick\current\cdstick_2/cdstick_2.ino line 3943
0x400e3c2e: setup() at E:\Documents\projects\CDStick\current\cdstick_2/cdstick_2.ino line 853
0x40174b42: loopTask(void*) at C:\Users\Richard\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32\main.cpp line 15

I am using the new 1.0.0 version with Arduino 1.8.5

RichardS
Attachments
spi.hpp
(6.39 KiB) Downloaded 789 times
spi.cpp
(7.6 KiB) Downloaded 803 times

Who is online

Users browsing this forum: megaTheBIKE and 73 guests