I used EFM32GG11 MCU to collect sensor data, and the data was 20k bytes. The CAN interface was adopted to transmit the data to the host machine. It was required that each slave machine transmitted the data in a very short time (3 seconds).
My question is, how does each slave organize and send this 20K byte data?After the host machine receives the data, how to reorganize the data sent by each slave machine?Can provide references for relevant articles?
Hi Steven: CAN uses messages to send a limited # of data bytes and each message has a priority level. Higher priority levels are sent first so there is a chance that some messages may not arrive on time to their destination.
The GG11 has a CAN bus example that you may wish to investigate and it is available from within Simplicity Studio when you connect the SLSTK3701A, which is the starter kit for the GG11...see below:
You will need 2 starter kits and 2 isolated CAN extenders if you want to play with this. Additionally, I have attached UG322, the User Guide for this project for your convenience.
Be warned, though, that each CAN message will transmit only 8 bytes, so if each slave has 20 KBytes to transmit in only 3 seconds your selection of CAN may be unrealistic.
Can you share more data?
1) How many sensors do you have and what are they, i.e. what type of data are you collecting?
2) What makes for the 3 second time limit for xmission?
3) What happens if not all of the data from a given sensor arrives on time?
4) What is the distance over which you need to transmit the data?
The sensor is ADXL345B. The host machine requires that each sensor of the slaves continuously collect data for 5 seconds every 10 minutes with a frequency of not less than 500Hz. Thus, it is calculated that each sensor collects data at least 15000 Bytes once.
In order to collect timely and accurate data, the slaves did not send data to the host during the data collection period. After all data were collected, the data would be sent uniformly.
Each host machine is connected with 2 CAN Slaves, and the distance between the slaves and the host machine is not more than 30 meters. Each CAN Slaves is connected with 4 ADXL345B sensors.Data from all 8 sensors should be sent to the host within 1-2 minutes.
Ok, so considering a single sensor measuring 500 times/sec...and let's say you go for max resolution of 13 bits per sensor reading, so let's say that's 2 bytes...and you do that for 3 seconds (1 measurement period):
500 samples/sec * 2 bytes/sample * 3 seconds = 3K Bytes per measurement period.
[And that has to happen every 10 minutes for that given sensor (and all of the others). Where does 15K Bytes come from?]
Assuming 3K bytes per measurement period per sensor is correct and you want to transfer these in 3 seconds, then allowing for 2 attempted re-transmissions of each message in case of data corruption due to electrical noise, etc (this also allows for xmission of other frames besides the data frames and time for possible bit-stuffing), ....let's say your transfer rate becomes 9K Bytes per second. At 8 data bytes per message (Data Frame) that would be 1125 messages per second and each CAN Data Frame is 55 bits long.
Therefore, your target comm speed would be circa 1125 Frames/sec * 55 bits/Frame = 61.875K BPS. I would start at 100 KBPS and see if your bus capacitance will allow that; if so, you're in great shape....!
Every 10 minutes collect data for 5 seconds，500 Hz ODR ,total data is 500 samples/sec * 2 bytes/axes * 3 xyz*5seconds=15K Bytes 。
I‘m going to’ use the 29-Bit Identifier(ID+Command) ，First transmit the number of packets, then transmit data sequentially。