2237 views|0 replies

2015

Posts

0

Resources
The OP
 

Experience in using Ti's C28x series DSP (28069) (28377D) [Copy link]

In a project, the author came into contact with such a communication system. The communication architecture of the entire system is roughly as shown in the figure below, a typical one-master-multiple-slave system.

If the N of Slave_N exceeds 10, such a communication system is still relatively complicated.

The author believes that the following points need to be considered for this system:

1. Communication fault handling

(1) If a communication failure occurs in the host or slave device of the entire system, what should be done?

My current approach is that each DSP's CAN transceiver function first has a fault detection. Once a fault is detected, CAN stops sending and receiving data and enters the software reset state. If no fault is detected, communication continues. This fault is the total fault bit of the CAN register. However, I have not carefully tested this approach to see if it is useful, because the current communication system can still operate normally without any particularly strange communication faults.

Uint16 ECanFaultHandle(void) //Fault detection function of slave
{
struct ECAN_REGS ECanaShadow;

//ECanaRegs.CANTEC.bit.TEC //Send error counter
//ECanaRegs.CANREC.bit.REC //Receive error counter

if (ECanaRegs.CANES.bit.EW == 1) //Warning status
{
EALLOW;
ECanaShadow.CANMC.all = ECanaRegs.CANMC.all;
ECanaRegs.CANMC.bit.SRES = 1; //Start software reset
ECanaRegs.CANMC.bit.ABO = 1; //Automatic bus connection enable
ECanaRegs.CANMC.all= ECanaShadow.CANMC.all;
EDIS;
return 0;
}
else if(ECanaRegs.CANES.bit.EP == 1) //Passive error
{
EALLOW;
ECanaShadow.CANMC.all = ECanaRegs.CANMC.all;
ECanaRegs.CANMC.bit.SRES = 1; //Start software
resetECanaRegs.CANMC.bit.ABO = 1; //Enable automatic bus connectionECanaRegs.CANMC.all
= ECanaShadow.CANMC.all;
EDIS;
return 0;
}
else if(ECanaRegs.CANES.bit.BO == 1) //Offline
{
EALLOW;
ECanaShadow.CANMC.all = ECanaRegs.CANMC.all;
ECanaRegs.CANMC.bit.SRES = 1; //Start software
resetECanaRegs.CANMC.bit.ABO = 1; //Enable automatic bus connectionECanaRegs.CANMC.all
= ECanaShadow.CANMC.all;
EDIS;
return 0;
}
else return 1;

}
(2) What if the host communication is not faulty but the slave has a fault?

What I do is that the host will detect the CAN communication of the slave. Once it detects that a slave no longer sends data, the host will report a CAN communication fault and prompt the user to check the source of the fault.

2. Bus bandwidth

In a communication system with one master and multiple slaves, if the master and slaves send data to the CAN bus at the same time, the data on the CAN bus will inevitably be very large, but the bandwidth of the CAN bus is limited. When there are more and more slaves, this will inevitably affect the speed of data transmission. In order to avoid this phenomenon, what can we do?

When Slave_N's N exceeds 20, how should the host and slave communicate?

The author's current approach is to use the master request and slave response method, that is, one question and one answer, which is somewhat similar to the Modbus protocol. This method is bound to ensure that the bandwidth of the CAN bus per unit time will not affect the speed of data transmission, but the disadvantage of this approach is that if there are too many slaves, the time it takes for the host to traverse the slaves will definitely become longer and longer. The author believes that in this case, on the one hand, the baud rate of CAN communication can be increased, and on the other hand, the cycle of the host accessing the slave can be shortened.

3. Communication efficiency

Communication efficiency may not be an appropriate term, but for this one-master-multiple-slave system, we do have to consider the amount of data exchange, the convenience of data exchange, the amount of code, etc. In the design of this system, the slave is only a passive responder. It will only respond when the master requests it. All slaves are only responsible for the master. One slave does not request another slave, nor does it respond to another slave.

At present, this system adopts a simplified version of the CANOpen protocol. The author has not come into contact with the real CANOpen protocol. This CANOpen protocol is based on the standard frame of CAN.

This post is from DSP and ARM Processors
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews

Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list