MC9S12SXEP100 how to connect 2 MCU together?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12SXEP100 how to connect 2 MCU together?

Jump to solution
2,210 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,319 Views
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

 

View solution in original post

0 Kudos
Reply
5 Replies
1,319 Views
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 Kudos
Reply
1,319 Views
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 Kudos
Reply
1,319 Views
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 Kudos
Reply
1,320 Views
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 Kudos
Reply
1,319 Views
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 Kudos
Reply