Search found 1735 matches

by stevestrong
Thu Nov 16, 2017 8:10 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

Do you have to do some processing on the received data? If not, then you can use the same double buffer to receive the data directly into the RGB buffer. Make the DMA buffer circular (which is actually the case in my example) and set it to the RGB buffer and forget about everything. There is no need...
by stevestrong
Thu Nov 16, 2017 1:44 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

I am not sure, but you can try to see if it works.
If not, then connect same wire to another pin, too.
by stevestrong
Thu Nov 16, 2017 1:42 pm
Forum: New users MUST post here first, and let us know a bit about you and your projects
Topic: Decoding the Gameboy LCD output.
Replies: 118
Views: 968

Re: Decoding the Gameboy LCD output.

Sorry, i was wrong, of course you're right. I was thinking on F4....
by stevestrong
Thu Nov 16, 2017 1:15 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

You could monitor the SPI and DMA stats rgisters for errors, and if any occur, then re-init the DMA.

Alternatively, you could signal the start of the frame with a nother pin to trIgger an interrpt wich resets the DMA before starting the frame, before NSS goes low.
by stevestrong
Thu Nov 16, 2017 12:02 pm
Forum: New users MUST post here first, and let us know a bit about you and your projects
Topic: Decoding the Gameboy LCD output.
Replies: 118
Views: 968

Re: Decoding the Gameboy LCD output.

I still think it is doable with the blue pill, if the OV7670 parallel data scan works with 8MHz clock, this should also work with the half 4MHz clock.
https://github.com/stevstrong/LiveOV767 ... 0stm32.ino
by stevestrong
Thu Nov 16, 2017 11:37 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

Your monitored DMA channel was wrong, it should be channel 4 , registers CCR4 and CNDTR4. But anyway, I have found a very important step missing in the setup flow, it is the enabling the SPI Rx DMA. This should be done by inserting an additional line to SPI setup: #include "libmaple/spi.h" ... void ...
by stevestrong
Thu Nov 16, 2017 6:42 am
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

The SS pin is the standard allocated one for the selected SPI interface. So for SPI 2 it is PB12, for SPI 1 is PA4. In slave mode the SPI will only receive data is SS pin is activated by the master, it is the default way of working. The DMA is only triggered when new data comes in to SPI, so this is...
by stevestrong
Wed Nov 15, 2017 7:21 pm
Forum: CubeMX and HAL
Topic: GPIO macros for CubeMX
Replies: 4
Views: 167

Re: GPIO macros for CubeMX

As a small note, the F4 BSRR register can be accessed either as 32 bit or you could divide it as for F7 like BSRRL/H and accessing it in 16 bit mode.
by stevestrong
Wed Nov 15, 2017 7:02 pm
Forum: Libraries & Hardware
Topic: Hard time to make SPI work in slave mode
Replies: 13
Views: 152

Re: Hard time to make SPI work in slave mode

Here is a simple example how to setup the SPI 2 and the corresponding DMA Rx channel 4: #include <SPI.h> #include <libmaple/dma.h> #include "libmaple/spi.h" ... /*****************************************************************************/ SPIClass SPI_2(2); /***************************************...