Re: problem regarding Succesful Transmission of CAN message

View: New views
4 Messages — Rating Filter:   Alert me  

Re: problem regarding Succesful Transmission of CAN message

by cisc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

how application knows when arbitration lost? will msCAN retry later?
thanks!

helo everybody

>
>            i am working on S12MSCAN-v2....for data transmission
>between any test equipment and an ECU...the Microcontroller I am  
>using in the using ECU is MC9S12D64..
>
>            i have a question regarding this....
>
>           how can we know that the CAN transmission is
>completed...instead of cheking the MSCAN transmitter register
>(CAN0TFLG (TXE))..
>
>        how can we check the status of the CAN bus..i.e., when we
>send a data to the Data segement register....CANTFLG will be set to 1
>automatically  stating that the transmitter buffer is empty that
>means the transmission is completed succesfully..but how can we know
>about the successful transmission if the CAN Bus is Open or any error
>occured in the CAN bus...please provide the sample code for this if u
>have...
>it will help me alot..
>thanks and regards
>Yadunandan
>
>

Re: Re: problem regarding Succesful Transmission of CAN message

by Edward Karpicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<cisc@to..> wrote:

> how application knows when arbitration lost? will msCAN retry later?
> thanks!

Yes MSCAN will retry later. It will keep retrying until message is send and
acked by other nodes.

>
> helo everybody
>>
>>            i am working on S12MSCAN-v2....for data transmission
>>between any test equipment and an ECU...the Microcontroller I am
>>using in the using ECU is MC9S12D64..
>>
>>            i have a question regarding this....
>>
>>           how can we know that the CAN transmission is
>>completed...instead of cheking the MSCAN transmitter register
>>(CAN0TFLG (TXE))..

Why checking TXE doesn't suit you?

>>
>>        how can we check the status of the CAN bus..i.e., when we
>>send a data to the Data segement register....CANTFLG will be set to 1
>>automatically  stating that the transmitter buffer is empty that
>>means the transmission is completed succesfully..but how can we know
>>about the successful transmission if the CAN Bus is Open or any error
>>occured in the CAN bus...please provide the sample code for this if u
>>have...

To check if bus is OK, you should configure RSTATEx, TSTATEx bits in CANRIER
register. Then you should monitor CSCIF flag. RSTATx (no E in bit name),
TSTATx flags are updated only when CSCIF is cleared. So every time error
status changes (CSCIF=1), you read error status flags RSTATx, TSTATx and
clear CSCIF by writing one to it.

Edward

>>it will help me alot..
>>thanks and regards
>>Yadunandan
>>
>>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


Parent Message unknown Re: Re: problem regarding Succesful Transmission of CAN message

by cisc :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

   Thanks,Edward!
   Is there any situation that MSCAN aborts current transmitting without application abort request?
   If MSCAN keep retrying transmitting, but there is no any ack, what will happen later? error interrupt to inform application?
   

   wrote:

>
>>  how application knows when arbitration lost? will msCAN retry later?
>>  thanks!
>
>Yes MSCAN will retry later. It will keep retrying until message is send and
>acked by other nodes.
>
>>
>>  helo everybody
>> >
>> >             i am working on S12MSCAN-v2....for data transmission
>> > between any test equipment and an ECU...the Microcontroller I am
>> > using in the using ECU is MC9S12D64..
>> >
>> >             i have a question regarding this....
>> >
>> >            how can we know that the CAN transmission is
>> > completed...instead of cheking the MSCAN transmitter register
>> > (CAN0TFLG (TXE))..
>
>Why checking TXE doesn't suit you?
>
>> >
>> >         how can we check the status of the CAN bus..i.e., when we
>> > send a data to the Data segement register....CANTFLG will be set to 1
>> > automatically  stating that the transmitter buffer is empty that
>> > means the transmission is completed succesfully..but how can we know
>> > about the successful transmission if the CAN Bus is Open or any error
>> > occured in the CAN bus...please provide the sample code for this if u
>> > have...
>
>To check if bus is OK, you should configure RSTATEx, TSTATEx bits in CANRIER
>register. Then you should monitor CSCIF flag. RSTATx (no E in bit name),
>TSTATx flags are updated only when CSCIF is cleared. So every time error
>status changes (CSCIF=1), you read error status flags RSTATx, TSTATx and
>clear CSCIF by writing one to it.
>
>Edward
>
>> > it will help me alot..
>> > thanks and regards
>> > Yadunandan
>>  ------------------------------------
>
>

Re: Re: Re: problem regarding Succesful Transmission of CAN message

by Edward Karpicz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>   Thanks,Edward!
>   Is there any situation that MSCAN aborts current transmitting without
> application abort request?

No. MSCAN won't about anything without request.


>   If MSCAN keep retrying transmitting, but there is no any ack, what will
> happen later? error interrupt to inform application?

Error counters may increment, bus-off may happen. But it all should self-fix
and marked to send Tx buffers will be transmitted after bus issues
disappear. MSCAN will try again and again. Of course application should
workaound possible timing issues; if delivery is critical, then app should
track change of error status and provide necessary workarounds.

Edward

>
>
>   wrote:
>>
>>>  how application knows when arbitration lost? will msCAN retry later?
>>>  thanks!
>>
>>Yes MSCAN will retry later. It will keep retrying until message is send
>>and
>>acked by other nodes.
>>
>>>
>>>  helo everybody
>>> >
>>> >             i am working on S12MSCAN-v2....for data transmission
>>> > between any test equipment and an ECU...the Microcontroller I am
>>> > using in the using ECU is MC9S12D64..
>>> >
>>> >             i have a question regarding this....
>>> >
>>> >            how can we know that the CAN transmission is
>>> > completed...instead of cheking the MSCAN transmitter register
>>> > (CAN0TFLG (TXE))..
>>
>>Why checking TXE doesn't suit you?
>>
>>> >
>>> >         how can we check the status of the CAN bus..i.e., when we
>>> > send a data to the Data segement register....CANTFLG will be set to 1
>>> > automatically  stating that the transmitter buffer is empty that
>>> > means the transmission is completed succesfully..but how can we know
>>> > about the successful transmission if the CAN Bus is Open or any error
>>> > occured in the CAN bus...please provide the sample code for this if u
>>> > have...
>>
>>To check if bus is OK, you should configure RSTATEx, TSTATEx bits in
>>CANRIER
>>register. Then you should monitor CSCIF flag. RSTATx (no E in bit name),
>>TSTATx flags are updated only when CSCIF is cleared. So every time error
>>status changes (CSCIF=1), you read error status flags RSTATx, TSTATx and
>>clear CSCIF by writing one to it.
>>
>>Edward
>>
>>> > it will help me alot..
>>> > thanks and regards
>>> > Yadunandan
>>>  ------------------------------------
>>
>>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>