Really Really confused with CAN Transmission and other questions

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

Really Really confused with CAN Transmission and other questions

607 Views
rahulkrishna
Contributor IV

I am really confused with the following questions

 

1. I am trying to gateway messages from one channel to other channel in the same sequence as it receives. At one point of time i receive 3 messages and process them for transmission, but the program transmits first message and then starts transmitting the new messages received after the 3 messages, Some time later it transmits missing messages. I want to clarify if it is my software program error ?

2. If i transmit the three messages at a stretch without delay does the controller miss the sequence of messages and transmit when the bus is free. Is this scenario ever possible?

3. Currently if i transmit i am only setting the transmit interrupt bit to transmit the message. Is it possible that i know that the message is actually on the bus? Can i use this method of programming so that i becomes closed loop programming.

4. Between two CAN messages how much delay should i provide? Is there any standard? As i have seen different delays in different programs.

5. I use a semaphore for data coherency i lock a variable in the interrupt when receiving data. In the main routing i lock the same variable and copy to local variable and process. My main doubt is suppose i locked the variable in the main for longer time by mistake and in the mean time the interrupt happens in the xgate and finds the semaphore locked will it wait till the semaphore is unlocked or just comes out of interrupt without updating. Any error is generated in such cases?

sorry for a long list of questions. without the above clarifications i really cannot move further in the project.

 

Thanks in advance.

Labels (1)
0 Kudos
Reply
1 Reply

497 Views
kef2
Senior Contributor V

1-2. Do you mean order of Tx'ed messages is different to what you expect? Are you using Transmit Buffer Priority Register? You should use TBPR to guarantee order of Tx messages. Message to be transferred next should have higher TBPR value. There's a problem of max TBPR value of 255. Incrementing TBPR value, at some point you need to reset it. You can do it when all 3 Tx flags are set.

4. CAN controller should care about this.

Edward

0 Kudos
Reply