This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

T89C51CC01 message sending

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(Rx0) should change from time to time right?

How could I send messages to the can bus?

Everybody, please help me.

  • Some thoughts
    not familiar with this chip, but if your not seeing the values of your port pins, and they are being used to transmit and revieve CAN messages, they are probably not available as IO pins and you won't see them change in the debugger. Do you have another CAN device to recieve messages? That would be the easiest way to test operation. Or just to see that you are doing something, put a scope on your CAN TX pin.
    Andy

  • Thank you so much Andy.

    I used the scope to test the signal as you told me. I saw the signals on one pin Tx (In fact, for CAN bus, the Rx should receive what it just sent to the CAN bus right?)
    while I did not get the same result on the RX. So I thought there could be something wrong with my CAN transceiver. I am right now working on it.

    And I am thinking about how to make the debugger work.

    vincent chan

  • Vincent,
    Your RX pin should see what is on the CAN bus if it's working correctly. Maybe you can set up this can controller to accept it's own messages for purposes of testing. That will not tell you if your BAUD rate is set correctly. Only way to tell that, other that being 100% sure of your settings, is to have independent means of testing. Try a google search on PCANview. I forget the name of the company, but they make a cheap USB to CAN converter that can listen for ALL can messaged at specific settings. You may want to take a look at B & B lectronics. They make a lot of neat converters as well. They can supposebly send CAN messages, but when I was working with this stuff, I was never able to pick them up on my controllers.

    For your application, are you planning on making more than one controller?

    Andy

  • BTW, is your CAN bus (output of tranciever)connected to anything? I'm thinking that if it is not, you wont't see anything on your RX pin (nothing to see).
    I've been unemployed for the past 13 weeks (though I think thats about to change) and have been allowing cobwebs to form on my brain I'm afraid. I'm in the process of reviewing my CAN stuff as my possible new job will be dealing with it extensively. Can you give a descition of your physical layer?

    Andy

  • Dear Andy
    Thank you for your advice. I'll give it a shot. You saved me a lot of time.

    As you mentioned, I am not only working with CAN controller, but also with a chip called "FPGA". well, I am just doing a small part of a huge project related to car.

    What I need to do is to read the command from the pc user, then analyse the request sent with usb stored in "FPGA"'s register with considering the current situation and behave in the right way.

    Vince

  • Andy

    Actually, for the Can Controller, we have two of them, both of which are connected to the CAN bus. We also have a "FPGA" as a router and a usb as a connecter with the pc.
    we can discuss it in detail via Email.
    My life in the lab is so tough.

    have a nice day.

    Vince