cancel
Showing results for 
Search instead for 
Did you mean: 

Multiprocessor mode on STM32

armaniake
Associate II
Posted on October 27, 2008 at 11:58

Multiprocessor mode on STM32

5 REPLIES 5
armaniake
Associate II
Posted on May 17, 2011 at 12:48

Hi,

I need to connect 6 or 7 STM32 together, with one STM32 used as a master and the other one as slaves. The flow could be half duplex or full duplex. I could use the I2C interface but I'm tempted by the intrinsic simplicity of the RS232 communication. The STM32 has a multiprocessor mode.

Did anyone of you guys implemented it? Would you have any example of comments you could share, by any chance (schematic, software)?

I'm basing my work on USART example 11 of their lib (Rev 1).

Thanks

picguy
Associate II
Posted on May 17, 2011 at 12:48

If communication is only master to slave and slave reply to master it can be very simple. Wire master Tx to all slave Rx. Wire all slave Tx to master Rx. In the latter case slaves had better put their Tx into high impedance unless they are talking. USART1 can go 4.5M baud if you need the speed. Fixed length messages and DMA make for low overhead transfers. Be sure to make timeouts – just in case....

After making a slave transmit your master node could start talking to the next slave. Just be sure that two slaves will not be talking at once.

For nodes separated by some distance consider some kind of RS-449 (is that the right number?) differential line driver. This will be half duplex

st3
Associate II
Posted on May 17, 2011 at 12:48

Quote:

I'm tempted by the intrinsic simplicity of the RS232 communication.

The intrinsic simplicity of RS232 is that it is for simple point-to-point links only - it does not support multipoint or ''bus'' communications!

The problem, as picguy says, is that you have to ensure that no 2 slaves have their outputs active at the same time - and RS232 provides no means to do that.

Some modern RS232 transmitters do have a facility to disable their outputs; so you could try to make use of that - but it would not be true, standard RS232.

For short distances, you could use a simple open-drain driver - much like I2C does...

Quote:

The STM32 has a multiprocessor mode.

Are you talking about the 9-bit mode - as found on the 8051?

st3
Associate II
Posted on May 17, 2011 at 12:48

Quote:

Are you talking about the 9-bit mode - as found on the 8051?

I have just looked at the description of ''Multiprocessor Mode'' in the Reference manual (RM0008) and it is pretty much equivalent to the 8051's 9-bit ''Multiprocessor Mode''

Basically, the idea is that you have one Master and a number of Slaves.

All the Slave receivers are connected together to the Master's transmitter; ie, they all receive exactly the same thing, simultaneously.

Every Slave receiver is in ''Mute'' mode so that it ignores everything from the Master until it sees its specific address, with the 9th bit set. This causes the receiver to ''wake-up'' and receive the message.

After receiving an addressed message, the receiver is put back into ''Mute''.

Again, your protocol needs to ensure that only one slave can ever transmit at a time. The easiest way to do this is to have Slaves only ever transmit in response to a message from the Master.

Thus the Master has to ''Poll'' the Slaves regularly to see if they have anything to send, and the Master needs to ensure that it only ever allows one slave to transmit at a time.

Update:

For some 8051 references, see:

http://www.8052.com/forum/read.phtml?id=69216

http://www.8052.com/forum/read.phtml?id=69214

[ This message was edited by: st7 on 25-10-2008 11:34 ]

armaniake
Associate II
Posted on May 17, 2011 at 12:48

Thanks guys,

My plan is indeed to use one master that polls the slaves and to use the 9bit mode similar to 8051 (all in mute). The slave will speak only if spoken to. I'm also planning to ultimately use RS485 differential lines instead of RS232. It is ''transparent'' for the software but for the driver direction bit. I will use a GPIO for that I think.

I2C is a good idea too but 400KHz will likely be too slow for my application.

Thanks for you helps guys. Much appreciated.

Regards,