Other Parts Discussed in Thread: HALCOGEN
Hi!
I am Chetan. I am basically trying to implement the CAN protocol on TMS570LS0432 controller. In this regard, I need to implement two CAN nodes, each capable of transmitting and receiving data on their respective CAN modules.
Basically, my concern lies in the algorithm of the software that I have to implement in order to configure the above nodes to have Tx and Rx functionality using interrupts. In this context, I have done the following things as per my understanding of Halcogen API's for CAN and the DCAN module on the controller. I just need some assurance as to whether this algorithm will work out correctly and if not, what is it that is wrong in my approach/understanding..
For one of the nodes, I have used "CanInit()" function to configure Message Box 1 to receive data by using IF1 (Interface Register 1) Arbitration, Mask, Command registers (In order to receive the correct identifier matching data in this message box). Now, I have the Receiver Interrupt Enabled for this message box through command register. (IE0 and IE1 both interrupt lines are enabled and all have been routed to IE0 as per MUX register setting and please note that "Error and Status Based Interrupts" have been disabled).
The "Can1HighLevelInterrupt" is definitely the ISR which the code will branch to whenever a message is received in message box 1 (Is this correct?). In this ISR, (the code branches to else part), the pending interrupt flag is cleared and a call is made to a function named, "canMessageNotification". Firstly, I want to know how is "Can1HighLevelInterrupt" as an ISR different from "canMessageNotification"?
Secondly, inside the function "canMessageNotification", I am reading the identifier (using "canGetID" function) and based on certain bit sequence of the received identifier, I am calling the "canTransmit" function. Now, on having a look at "canTransmit" function, it no where sets the Tx Interrupt(enables it). So in other words, I have reception based on Interrupt but Transmission is initiated by just depending on data based on reception. Where and how do I enable transmission based on Interrupt? Also, if Transmission Interrupt is enabled, how do I modify the "CanHighLevelInterrupt" and "canMessageNotification" fucntions?
You can also share me some code snippet is possible so that I can have a better understanding. Thank you so much in advance.
Regards,
Chetan.