Skip to main content
Visitor II
June 12, 2006
Question

CAN -> Mode TEST : Can i use Remote Frame ?

  • June 12, 2006
  • 3 replies
  • 990 views
Posted on June 12, 2006 at 11:53

CAN -> Mode TEST : Can i use Remote Frame ?

    This topic has been closed for replies.

    3 replies

    gpoirier9Author
    Visitor II
    June 9, 2006
    Posted on June 09, 2006 at 12:20

    Hi,

    I succeed to send and receive Frame in Test Mode (Hot Self test -> Loop Back + Silent) : a Message Object in Transmission send a frame with a particular ID and a Message Object in Reception receive the message if the ID is ok compared with MASK and ID of the receiver.

    But I tried to send and receive Remote Frame in Test mode and it doesn't work ! I don't know if i'am doing something wrong with my code or if we can't use Remote Frame with Test Mode ???

    Datasheet say that in order to send a Remote Frame, you need just configure a Message Object in Reception with particular ID and to enable TxRqst bit of this Message Object and this procedure send a Remote Frame : I have done this thing.

    Then, you need allow Remote Frame for the transmitter with the ''RmtEn'' bit : and if i have all understand, if the Message Object have the same ID, then it send automatically a Data Frame with the ID.

    I have done all these things, but, when I try to send a Remote Frame, the behaviour is unpredictable !

    Thank you for your help.

    GP

    Visitor II
    June 12, 2006
    Posted on June 12, 2006 at 11:16

    Hi,

    As I understand the test modes (except the basic mode), you can't use the remote frame process:

    - in loopback mode, you can send the remote frame but you can't receive the data frame

    - in silent mode, you can receive a remote frame but you can't send the data frame.

    Anyway in normal mode, the reference manual said (page 177):

    Dir, Message Direction

    1: Direction = transmit: On TxRqst, the respective Message Object is

    transmitted as a Data Frame. On reception of a Remote Frame with

    matching identifier, the TxRqst bit of this Message Object is set (if RmtEn = one).

    0: Direction = receive: On TxRqst, a Remote Frame with the identifier of

    this Message Object is transmitted. On reception of a Data Frame with

    matching identifier, that message is stored in this Message Object.

    So the ''RmtEn'' bit is used to receive a remote frame (dir=1), not to send one.

    As it is said page 190:

    Reception of Remote Frame

    When a Remote Frame is received, three different configurations of the matching Message Object have to be considered:

    1) Dir = ‘1’ (direction = transmit), RmtEn = ‘1’, UMask = ‘1’ or’0’

    At the reception of a matching Remote Frame, the TxRqst bit of this Message Object is set. The rest of the Message Object remains unchanged.

    2) Dir = ‘1’ (direction = transmit), RmtEn = ‘0’, UMask =’0’

    At the reception of a matching Remote Frame, the TxRqst bit of this Message Object remains unchanged; the Remote Frame is ignored.

    3) Dir = ‘1’ (direction = transmit), RmtEn = ‘0’, UMask =’1’

    At the reception of a matching Remote Frame, the TxRqst bit of this Message Object is reset. The arbitration and control field (Identifier + IDE + RTR + DLC) from the shift register is stored in the Message Object of the Message RAM and the NewDat bit of this Message Object is set. The data field of the Message Object remains unchanged; the Remote Frame is treated similar to a received Data Frame.

    Regards,

    David B.

    gpoirier9Author
    Visitor II
    June 12, 2006
    Posted on June 12, 2006 at 11:53

    Thank you squirrel for these precisions !

    That confirms what i thought because my code seems to be good but it doesn't work.

    Concerning the ''RmtEn'' bit, I totally agree with you, but I badly expressed myself !!