How to know the current CAN Transmit errors and receive errors?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to know the current CAN Transmit errors and receive errors?

1,623件の閲覧回数
Saga
Contributor II
Hi to all, i would like to know the current number of errors and there is 2 registers called:

CANTXERR (MSCAN Transmit Error Counter)
CANRXERR (MSCAN Receive Error Counter)

Both registers have the number of transmision and reception errors, but the datasheet says:

Read: Only when in sleep mode (SLPRQ = 1 and SLPAK = 1) or initialization mode (INITRQ = 1 and
INITAK = 1)

NOTE
Reading this register when in any other mode other than sleep or
initialization mode, may return an incorrect value. For MCUs with dual
CPUs, this may result in a CPU fault condition.


And I can't go back to initialization mode or go to sleep mode (it's not up to me).

Is there another way to know the current errors?

Thank you very much...
ラベル(1)
0 件の賞賛
返信
1 返信

733件の閲覧回数
Bruce_andrew
Contributor I
you can't read the number of errors.

you can check these bits:

CANRFLG_OVRIF         
CANRFLG_TSTAT0              
CANRFLG_TSTAT1             
CANRFLG_RSTAT0               
CANRFLG_RSTAT1          

they are readable anytime

0 件の賞賛
返信