cancel
Showing results for 
Search instead for 
Did you mean: 

CANBus, Ethrnet and RS232 on the same MCU

GunkutA
Senior

Hello for a project I will be using Ethernet, CANBus and RS232. Now the maximum frequency for CANBUS is 1 Mbit per seconds, for RS-232 that is 20 k baud and for Ethernet I think it is again 1 Mbit per seconds. So with a MCU that has at least 2 MHz clock freq. that looks doable. But I have few questions about it.

1) Would it be a best approach to use 1 MCU and handle all communications in there. Or to use at least 2 MCU's.

2) Since RS232 is pretty slow compared to CAN or Ethernet. During an RS-232 call, I can get 500 datas from CAN network! Same for the ethernet. What would happen in this case? Would setting ethernet and CAN to higher priority solve this issue? ( But in this case rs-232 comm. could never get finished I believe.)

What would be my best bet in this case? I need some guidance in here. Thanks beforehand.

3 REPLIES 3

>>1) Would it be a best approach to use 1 MCU and handle all communications in there. Or to use at least 2 MCU's.

Perhaps just pick an IC that integrates the functionality. CAN and Ethernet need a transceiver, and a crystal derived clock.

>>Same for the ethernet. What would happen in this case?

You'd get overrun with data a some point. You can buffer data short term if data comes in bursts that can be averaged out. For continuous data where you'll never be able to keep up, you'll need to discard messages, perhaps in a managed way.

>>Would setting ethernet and CAN to higher priority solve this issue?

No. It is really a matter of balance, unless you have some way to control or throttle data from the source(s) you're going to have to take and process what you can.

Perhaps you have a colleague or supervisor who can help you think through the actual requirements and expectations.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
GunkutA
Senior

Thanks for the answer! Now actually that looks doable with one MCU. Do you think it would work in a way I won't need to discard any messages? Also you said CAN and Ethernet needs a crystal derived clock. Why is that? Wouldn't using a MCU with high speed clock be enough?

Well if you've got a significant disparity in the input/output rates how exactly do you thing that would be managed?

Buffering can provide some elasticity if the average in/out rates are about the same, but you sometimes get bursts.

Ethernet, and CAN have tight timing requirements in how the signals are sent and received, if the clocks used at different ends of the connection are sufficiently divergent you will either not get reception, or the error rates will be excessive.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..