Main Site Documentation

CAN performance


#1

Hi,

I have tested how fast it’s possible to read CAN data.
The fastest read speed I got on the Embedded Master is 6ms/frame when I send frames at 1ms/frame from CANalyzer.

I need to have at least 1ms/frame in readtime.

Have anyone been able to read faster than 6ms/frame?


#2

Are you reading one message or multiple messages from the driver? Can you show some code?


#3

I am reading only one message, this to be able to set at timestamp when I recieved the message.


        public LogData Read()
        {
            if (_canHandler.GetRxQueueCount() > 0)
            {
                _splitTime = (int)((DateTime.Now.Ticks - _startTime) / 10000);
                // Timestamp in milliseconds 
                if (_lastTimeStamp != 0)
                    _logData.TimeStamp = _splitTime - _lastTimeStamp;
                else
                    _logData.TimeStamp = 0;

                _lastTimeStamp = _splitTime;

                _canHandler.GetMessages(_canMsgList);
                _logData.Id = _canMsgList[0].ArbID;
                _logData.Length = _canMsgList[0].DLC;
                _logData.Rtr = _canMsgList[0].isRTR;
                _logData.Extended = _canMsgList[0].isEID;

                for (_index = 0; _index < 8; _index++)
                {
                    if (_index < _logData.Length)
                        _logData.Data[_index] = _canMsgList[0].data[_index];
                    else
                        _logData.Data[_index] = 0;
                }
            }
            else
                _logData.Length = 0;

            return _logData;
        }


#4

That is why!

TimeStamp is one of the things GHI will add in the new CAN drivers.

Here is a new post and lets get the new CAN drivers ready http://www.tinyclr.com/forum/6/2047/


#5

Do you mean that the CAN driver is slow because I read one message at a time?

But even if I read more than one message the buffert in the CAN driver must be able to read more than 1 frame/ms.

I found that the GC mess up the reading alot and timestamp.


#6

What you are trying to do has to be done on the driver side. How soon you must have the new CAN drivers?


#7

I am evaluating both the USBizi and Vinculum-II chip.

But I like to go for the USBizi because of the NETMF.

So answer to your question: Next week would be great.


#8

I’m also waiting (already for a month now) for the new CAN driver before implementing my protocol. I’ll use it on the FEZ Cobra.


#9

Does Vinculum compare to USBizi?! Maybe to the raw LPC23xx processor but not USBizi.

We will not have new CAN driver for about 4 weeks but you can use the existing driver for now (with its known limitations). I hope this will not slow you down.


#10

In my point of view it’s possible to compare them, they both have hardware driver libraries for CAN and USB host.

Flash update on the “field” and some more equal functions.