Hi, I'm writting code for the above chip. I can receive messages into my application using the CAN simulator no problem. However, when I launch a message from my application, it is continuously re-transmitted (as seen on the can bus simulator). The TXOK flag is set OK and I get into my interrupt but, the only way I have been able to stop re-transmissions is by setting the CANCONCH register for the page to 0 and disabling the page. What am I doing wrong, should the simulator mimic a reply ACK to prevent multiple re-transmissions or is it my responsibility to disable further transmissions? Any clues? Regards Rob McKinley
You did not indicate is it data or remote frame we discuss about. Well, after a message object with data frame has been transmitted without errors then corresponding bit ENCHx of CANEN1/2 is cleared and CAN macro will not use this channel any more. Only one way to transmit it again is re-write CANCONCH of a message object. The strange thing I see is that TXOK bit has been set => so message object has been transmitted w/o errors. There are some possible reasons: - you re-enable transmission somewhere in your program yourself (check code again); - you do not clear TXOK flag before start transmission (you must do it each time to avoid dead loop on interrupt); - it is a bug in debugger/simulator. Please report result of your fix problem coz it is very interest problem for me (via private mail if so). Finally, as temporal workaroud: use TTC mode oc CAN macro - it will send a frame only one time even errors occur. Good days!
Gentlemen, Thankyou for your replies, however, my main problem presists. How do I get the simulator to send an ACK back into my application? The simulator obviously knows a transmission has been send, because it registers it? As for how the simulator deals with the transmission, it does nothing with ENCHx, i.e it leaves it set and the CONCONCH still remains set for a transmission launch. When if forcefully reset these, in the TXOK interrupt, then the CAN simulator shows a second transmission has been started, then cancelled. Either, the simulator doesn't work or I am not setting it up correctly. For reference I am sending a simple 11bit identifier transmission - nothing fancy. Has anyone successfully got the simulator to correctly reply to a simple transmission launched from an application? Regards Rob McKinley
I had exactly the same problem with the same CAN message continually being sent due to no ack from a second CAN node. Recently this has gone away, I am pretty certain that it has been fixed in an update of the software in last few months. btw I am using 7.06a. Rob.
Cheers Rob, Good idea, I'll look into that one. RobMck
View all questions in Keil forum