Main Site Documentation

CAN buffert


#1

Hi,

How big is the internal CAN buffert for UZBizi??

When I try to read CAN frames at 500kbit/s at a rate of 1000msg / s I get overrun after some seconds.


#2

I assume you are using latest SDK.
overrun or overflow?
What else are you using in your program? I mean OneWire, SPI…etc?
Try our CAN example as-is with these bitrates. Do you get any problems?


#3

Yes I am useing the latest SDK, and running the CAN example as is.

I get “CAN.Error.RXOver”.

I use a Embedded Master Dev. Board (Rev 2.4A) to test the code.


#4

I removed all Debug.Print calls and now it handles 100% busload at 500kbits ;D


#5

I am now trying to use the CAN data that I get from the event.

But there is a problem, every time a try to copy or move the CAN.Message data to another container I get an RXOver error.

This happens when the busload is 50% or more.

Even a litle operation as copy the timestamp while make the buffert go RXOver.

I need a way to put the incomming CAN.Messages into a que that will process the data in another thread without getting the lost of messages.

In the constructor there is an paramter for buffert size, if I set this to 1000. Will the CAN driver have to fill these 1000 elemts before giving me an RXOver?

What I understand there is only 3 internal CAN bufferts on the MCU.

Is the CAN controller configured with Fast interrupt Request?


#6

You can increase the receive buffer size in the constructor and use filters so you don’t get all messages. See this:
http://www.ghielectronics.com/downloads/NETMF/Library%20Documentation/html/d2f107a4-a6fb-58bf-f847-4ec15aa14496.htm


#7

The thing is that I need to take care of all messages on the bus.

I will try to se if I can make some smart code to get full performance out of the USBizi.

Do you think to performance is reduced when running in debug mode ( no breakpoints set) compare to if I deploy it direct to the target?

For next release it would be nice if the CAN channel number was included in the DataReceivedEvent.


#8

AT 100% bus load then things can be challenging, you will need EMX for that.


#9

okey. why will the EMX have more performance? is a different mcu in that board or higher clock rate? regards


#10

Because of the way CAN works, data come in bursts that will be 100% bus load but only for few messages. So you either have to have some filters on enough RAM to buffer those bursts. EMX has megabytes of RAM so you can buffer thousands of messages easily.

USBizi can be an options with some safe assumption about the bus. For example, not bus will be at 100%, probably not even 50%. The good news is that CAN drivers will tell you if messages were lost.
You need to read data and move into internal RAM as fast as you can for later processing.