Search found 21 matches

by castortiu
Sun Nov 19, 2017 8:17 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

Great, I'll give a try today. I'm running overclocked at 128Mhz since I needed to get good refresh rate for the RGB matrix and programming with a ST-LINK V2, so I'm using USART1 for debugging, USART2 is used by the RGB Matrix, also PB10 (USART3) is used by the OE of the matrix however I can move tha...
by castortiu
Sat Nov 18, 2017 1:54 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

The steps above works great and everything is working as expected, I have double buffer enabled, low memory footprint, and the RGB display is refreshing at 250Hz 128w32h12bpp, had to do a few tricks on the RGB matrix to swap the buffers depending if dma filled the first or second half of the videobu...
by castortiu
Thu Nov 16, 2017 9:46 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

I don't have any processing on the slave, however I need to call matrix.SwapBuffer() every time a full frame has been received to tell the display to make the switch to use the backbuffer as frontbuffer and the frontbuffer as backbuffer to update the screen without tearing. I think I got what you ar...
by castortiu
Thu Nov 16, 2017 2:35 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

Yea, connecting to other pin might work too, since my problem was that the ESP8266 runs out of pins easily, however still have a few left on the STM. I'm almost there, I fixed the code on Master and Slave and it works like a dream master sending the frames and slave consuming them in real time, howe...
by castortiu
Thu Nov 16, 2017 1:31 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

Can I attach an interrupt to the falling edge of the SS pin?

On the master I could give several microseconds as a time buffer after SS go LOW and start to transmit the data, that time should be enough for the slave to get the SS IRQ and init the DMA buffer, that way I would not need an extra pin.
by castortiu
Thu Nov 16, 2017 1:06 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

It works !!! Thanks a lot, now I'll start to fix all mess in code changes I did in master and slave trying o figure out. One more question, how transmission errors are handled? For example I expect 6144 (6x1024) bytes, however if for some reason not all of the bytes are coming the buffer won't be to...
by castortiu
Thu Nov 16, 2017 7:36 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

I don't know what I'm missing I can't make the IRQ to trigger. Checked the SPI2 PB12 -> CS PB13 -> CLK PB14 -> MISO PB15 -> MOSI I have the oscilloscope and the analyzer in the bus and everything looks fine, I simplified the master code just to send in repetition 32 bytes with the "Hello There" cont...
by castortiu
Thu Nov 16, 2017 1:21 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

Tonight I'll try this code, however where is the SS setup in the STM? SPI on the master talk to a SD card and also to the STM, so the SPI bus is busy talking different slaves, I want to make sure that the DMA channel on the STM32 will be collecting the frame from the bus only when the SS (NSS2/PB12)...
by castortiu
Wed Nov 15, 2017 8:24 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Re: Hard time to make SPI work in slave mode

That is awesome, I'll try and let you know.

Thanks!!!
by castortiu
Wed Nov 15, 2017 2:55 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 16
Views: 230

Hard time to make SPI work in slave mode

I'm having a hard time to make the blue pill SPI work on slave mode. I just found two samples which use two SPI as input/ output to a SD card, I'm trying to modify the samples however I can't make it work for what I need https://github.com/stevstrong/Audio-sample/blob/master/stm32/STM32_ADC_Host.ino...