I want to send a message using Can Controller T89C51CC01 right now, I am not sure when the message is sent. Right after CANCONCH is set? Using the debug program in Keil, I could clearly see the message is on the can channel I assigned to. But the value of pin P4.0 and P4.1 don't change at all. If the can controller is sending messages, P4.0(Tx) P4.1(Rx) should change from time to time right? How could I achieve this Everybody, please help me.
After CAN initialisation (MailBoxes, Bit timming, channel and identifiers), setting DLC and bit CANCH0 in CANCONCH register should start CAN transmission. Try to enable CAN interruption and set a breakpoint at interruption function to see what happen. Furthermore P4.0 and P4.1 will change. Jean-Pierre BAGUET
I really appreciate your advice Jean-Pierre BAGUET I set a breakpoint at my interrupt function. at void CanInterrupt(void) interrupt 7 of the Application Note 165's example code http://www.keil.com/appnotes/docs/apnt_165.asp?bhcp=1 I modified the code to let it send message agian and agian. Then I turned the Peripherals-->Parallel Port4 on. P4.0 and P4.1 keep at logical 1. I tested my program on the hardware and used a scope to test the output sigal. I could see the signal. Thank your for your detail explaination. Vincent Chan
The simulator does not simulate the physical toogle of the I/O pins. See also: http://www.keil.com/support/docs/2817.htm http://www.keil.com/support/man/docs/uv3/uv3_simulation.htm Reinhard
Thank you so much Reinhard I should have checked that out first. You helped me out. Thanks Vincent Chan