cancel
Showing results for 
Search instead for 
Did you mean: 

connect two stm32

eemboaba
Associate
Posted on February 15, 2011 at 10:13

connect two stm32

#spi #dma #spi #usart
6 REPLIES 6
Andrew Neil
Chief II
Posted on May 17, 2011 at 14:24

''I am new in Cortex M3''

 

Do you have experience with any other microcontrollers? Or with computer interfacing in general?

''the best way to connect two stm32 using DMA''

 

 

There is no such thing as ''best'' without a set of criteria by which to judge it!

What are your specific requirements for this connection?

 - data rate?

 - serial/parallel?

 - distance between the units?

 - etc, etc, etc...?

Why specifically DMA?

''One must be STM32L152 (lcd controller) and other STM32F205''

So look at the interfaces available on both of those parts - think about which of them best meet your requirements.

Nobody can help you without knowing what those requirements are!

picguy2
Associate II
Posted on May 17, 2011 at 14:25

neil.andrew is right when he says there is no such thing as ''best'' without a set of criteria by which to judge it.

Assuming your two STM32 processors are line, as opposed to battery, powered I would recommend . . .

Use USART ports with DMA.  It’s simple and has low processor overhead.  Your STM32F205 master sends a block of data every 25-50 milliseconds.  Upon receiving it the STM32L152 LCD controller writes it to the display.

This all becomes even easier if every byte in the message always affects the same pixel or character on the display.  LCD controller then outputs text to display continuously.  Or fast enough to refresh entire display in 10-100 milliseconds.  No problem when two consecutive bytes are from different sends from the master.  The master updates its send buffer as if it were a memory mapped display.

Note the charm of that last sentence again: The master updates its send buffer as if it were a memory mapped display.

jpeacock23
Associate II
Posted on May 17, 2011 at 14:25

There are a several options.  If the transfer speed is relatively low you can use the UART port, DMA fixed lenght packets.  For higher bandwidth you can switch to the SPI port instead of UART, with DMA you can easily get over 1MByte/sec transfer rate.  If that isn't enough, and you have the spare pins for an external bus, you can wire an 8 or 16 bit parallel external bus, using the write strobe to trigger an external DMA read on the other side.  That'll get you several MBytes/second, limit will be processor overhead.

  Jack Peacock

eemboaba
Associate
Posted on May 17, 2011 at 14:25

Tanks for the answers I forgot to say that I will use STM32L152 as LCD controller and  FF/PA modem, where I need fast transfer  of data, this is the reason I want use DMA control. I think the best way is use a SPI interface with DMA.

Regards

Edson

Andrew Neil
Chief II
Posted on May 17, 2011 at 14:25

What is an ''FF/PA modem'' ??

''I need fast transfer of data''

But ''fast'', like ''best'', is pretty meaningless without a specific qualification.

What, exactly, do you  mean by ''fast'' in this  context?

''this is the reason I want use DMA control''

It would be better to state what data transfer rate you actually need - then people could comment on whether DMA is likely to be necessary to achieve that...

jpeacock23
Associate II
Posted on May 17, 2011 at 14:25

To keep it simple (and fast) designate one CPU as the bus master and the other as slave, so that the clock always originates from the master where most data is located.  Wire your SPI as full duplex so you can send back status from the prior message as the master clocks out the new packet of data.  That way you don't have any line turnarounds.  You should be able to burst at least 1-2MB of data at a time with a fast clock, depending on the distance between CPUs.

An SPI transfer can move data in both directions at the same time, so take advantage of it.

  Jack Peacock