1Mbps write speed possible for MCF51JM128 acting as USB mass storage host

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

1Mbps write speed possible for MCF51JM128 acting as USB mass storage host

481 Views
imurphy
Contributor III

Hi,

 

I plan to test the DEMOJM board as a CAN data logger, with the MCF51JM128 installed.

 

Maximum CAN bit rate is 1Mbps, there is some overhead in that so data rate will be slightly lower.

 

Will the MCF51JM128 be able to write to a USB flash drive at approximately that average speed?

 

I plan to start with the CMXUSB_LITE_V1 stack, is that advised?

 

Many thanks, Ian

Labels (1)
0 Kudos
2 Replies

249 Views
TomE
Specialist II

> Maximum CAN bit rate is 1Mbps, there is some overhead in that so data rate will be slightly lower.

 

If by "slightly" you mean "half".

 

Standard ID CAN packets have 44 bits of header plus 3 bits of interframe for a maximum of 64 bits of data. Extended ID packets have 64 bits of header. To that you need to add the "stuff bits", which (together with the header and gap) can add up to about 50 bits for standard and 74 for extended, depending on the IDs you're using. Then the 8 bytes of data can have up to 13 stuff bits if the data is all zeros.

 

So for standard frames the maximum data rate is between (64/(50+64)) and (64/(50+64+13)) or 50% to 56% and for extended packets, 42% to 46% of the bit rate. You might be able to get away with that if there's only one sender and one receiver, but you may have to derate the bandwidth (to about 90% of maximum) if there are multiple devices.

 

Make sure you get the CAN interrupt service routines pretty efficient as they're going to be interrupting at a high rate, and interrupting your mainline code and the CAN stack code. Make sure the CAN stack doesn't lock out interrupts (in its mainline or in its interrupt service routines) for longer than the CAN interrupt latency can stand, or the CAN hardware will overrun.

 

We're storing data to a USB stick on an MCF5329 using SMX's file system and CAN stack, and can manage 800 kB/s (that's kBytes) without any trouble, but that's from memory and without any competing I/O.

 

Good luck.

 

Tom

 

0 Kudos

249 Views
JimDon
Senior Contributor III

It should be able to do 1M bits per second.

 

CMXUSB_LITE_V1 is usable, but I have only used the CDC, which you might consider. I have not tried it with CW 10.x either.

0 Kudos