MC9S12SXEP100 how to connect 2 MCU together?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MC9S12SXEP100 how to connect 2 MCU together?

ソリューションへジャンプ
2,209件の閲覧回数
efoda
Contributor I

Dear all,

I'm a newbie ...

my application requires 2 MCU units, I want to connect them together,

I thought about using SPI to interface between them, as SCI is for remote CPU's ?

please correct me if I 'm wrong

ラベル(1)
0 件の賞賛
返信
1 解決策
1,318件の閲覧回数
bigmac
Specialist III

Hello Engy,

 

To clarify one point - both SCI modules must never simultaneously be in master mode - only one at a time.  If the SS input should ever become active whilst the SPI module is in master mode, a mode fault will occur.  For a multi-master situation, I would also recommend the inclusion of small current limiting resistors, maybe 470R, in case a conflict should ever occur.

 

Depending of the series resistor value , this might reduce the maximum clock rate, but normally you might use the highest clock rate available for fastest data transfer.

 

Regards,

Mac

 

元の投稿で解決策を見る

0 件の賞賛
返信
5 返答(返信)
1,318件の閲覧回数
bigmac
Specialist III

Hello, and welcome to the forum.

 

If the two MCUs are within the same equipment, the use of the SPI module would be a good choice.  This will potentially operate at a higher speed than the SCI module.  You could also use IIC (I2C), but this is more complex to use, and relatively slow.

 

To keep the operation simple, you would need to allocate one MCU as the master, and the other MCU as the slave.  Depending on the data transfer requirement, you may need to allow for an additional "handshake" interconnection, so that the slave can signal the master that it has data to send.

 

Another possible arrangement is for each MCU to default to slave mode, and to become a master only when it needs to send data.  You might still require the additional handshake to prevent a conflict should both MCUs simultaneously attempt to become masters.

 

Regards,

Mac

 

0 件の賞賛
返信
1,318件の閲覧回数
efoda
Contributor I

Dear Mac,

thank you v. much for your reply, it's highly appreciated & v. useful

I think I'll go for the arrangement of which both can be masters simultaneous, as each will need at an instant to initiate the transfer  

 

but I wonder what would be the best baud rate & baud rate divisor if the both MCU's are MC9S12XEP100?

 

Thank you v. much for your help

 

Regards,

Engy

0 件の賞賛
返信
1,318件の閲覧回数
VickLiui
Contributor I

i think the CAN bus will be a good choice if the distance of the two chip is very close. 1Mbps , 29bits ID , 8Byte package.

0 件の賞賛
返信
1,319件の閲覧回数
bigmac
Specialist III

Hello Engy,

 

To clarify one point - both SCI modules must never simultaneously be in master mode - only one at a time.  If the SS input should ever become active whilst the SPI module is in master mode, a mode fault will occur.  For a multi-master situation, I would also recommend the inclusion of small current limiting resistors, maybe 470R, in case a conflict should ever occur.

 

Depending of the series resistor value , this might reduce the maximum clock rate, but normally you might use the highest clock rate available for fastest data transfer.

 

Regards,

Mac

 

0 件の賞賛
返信
1,318件の閲覧回数
efoda
Contributor I

thanks Mac v. much, ur help is highly appreciated

 

thanks VickLiui for ur reply,but I found CAN v. hard as a newbie!!

0 件の賞賛
返信