SJA1000 CAN controller RX error

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

SJA1000 CAN controller RX error

1,501件の閲覧回数
Sightrix
Contributor I

Could you anyone help to check what's the problem with the SJA1000 CAN controller? Thanks in advanced.

It reports RX error when received a message from PCAN-View, here is my test logs:

test: 0xab (test register read back OK)
set mode to 0x01
mode: 33
---- read back configs ----
mode: 9
BTR0: 0x80 (bitrate 1M/s at 24M CLK)
BTR1: 0x36
ACR: 255 255 255 255
AMR: 255 255 255 255
OCR: 26
mode after started: 8
status: 12
CANDRV started!


status: 12, mode: 8, ECC: 0, RXERR: 0

status: 92, mode: 8, ECC: 167, RXERR: 135

=================================================

ECC: 167 means "stuff error", "ID.17 to ID.13"

 

And here is the message sent with PCAN-View:

CAN.msg.png

 

By the way, the controller cannot send any message out also, and there's no 120 oms resistor between CAN-H and CAN-L.

 

0 件の賞賛
返信
3 返答(返信)

1,205件の閲覧回数
San_96
Contributor I

Hi, Can you please help me the following issue in SJA1000.

We are using SJA1000 for CAN communication.
I have followed Datasheet and AN97076, AN97046.
I have verified by reading the Default values initially to know we can access Reading the registers.
I have configured Registers that shall be modified in Reset Mode only and Read back.
I observed Reading and Writing the registers are Okay.
My init function like below.
1. Go to Reset Mode by writing MOD.RM = 1
2. In CDR register, Pelican Mode, CBP =1, CD=0 is written, Read back value = 0xC1
3. Acceptance & Mask are 0x00 and 0xFF respectively
4. BTR0 = 0x40 , BTR1 = 0xA5 ( 20MHz clock and 1Mbps Baud rate required)
5. Output Control : Normal Mode, TX0 pushpull
6. Interrupts are Not enabled
7. Go to Normal Mode MOD.RM = 0
I read these registers and confirmed the values are modified as I written.

I am unable to Transmit the data from Module.
My TX handler is as below.
1. Check Status Register SR.TR = 0 and SR.TBS = 1
2. If no Txn is pending, updating the TX Buffers as below.
TX Frame Info (CAN adr = 16) : Extended CAN, RTR=0, DLC=8 Value = 0x88
TX ID1 to ID4 (CAN adr = 17 to 20) : 0xA5, 0x20, 0xEF, 0xF0
TX Data (CAN adr = 21 to 28) : Some Fixed Data
3. Cheking Status Register again SR.TR=0, SR.TBS=1, SR.TCS=1
If SR is Okay, Writing Command Register CMR.TR = 1 to start Transmission.
Waiting until SR.TR = 0 and SR.TBS = 1 and SR.TCS = 1

But I am not receiving the data at other end. I have connected CAN Analyzer and following data is observed.
Please check the picture.
0x1FFFFFC0x DLC = 75 This is wrong.
Then I have read the data written in Tx Buffers as mention in AN97076.
From CAN adr 16 to 28 : All values are 0x0C
From CAN adr 96 to 108 : Below values are observed.
Please check pictures.
When Decoding 97 to 100 Adr data : I got 1DFFFFC0 which is shown in CAN analyzer.
No error is observed in Error Code Capture register (Adr 12)
I have doubt whether the registers 16 to 28 have write access or not. Because these registers always showing 0x0C.

I have looked some codes available with LPC2000 module. But I have everything is Same as our Software.
I have 120 Ohm termination resistor. I am using Intel mode.
Please check all these data and help us. Very much Thanks in advance.

0 件の賞賛
返信

1,498件の閲覧回数
Sightrix
Contributor I

If the 120ohms resistor is MUST?

0 件の賞賛
返信

1,490件の閲覧回数
Sightrix
Contributor I

YES! Everything is okay after the resistor added.

0 件の賞賛
返信