On-chip CAN tranceiver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

On-chip CAN tranceiver

1,477 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Tue Feb 28 03:45:52 MST 2012
Hi

After about 30-60 minutes, my on-chip CAN tranceiver stops receiving messages. There is no CAN errors indicated in the registers. There is 5 notes on the CAN bus, and only 1 note is accepted (se below). The transmission is stil ongoing without any problems. I'm using msgobj 0-30 as transmission buffers.

My setup to receive:
// Configure message object 31 to receive all 29-bit messages from only note 0xC8
msg_obj.msgobj  = 31;
msg_obj.mode_id = CAN_MSGOBJ_EXT | 0xC8;
msg_obj.mask    = 0xC8+ 1;
(*rom)->pCAND->config_rxmsgobj(&msg_obj);


Does anyone have an idea why it stops receiving CAN messages?

Best regards
Casper
0 Kudos
Reply
25 Replies

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by 3CPO on Fri Dec 11 10:06:20 MST 2015
Hello CasperH,

I have the same issue as you have.

Everything works as it should until I start with TX a MOB. Then randomly one of the MOB stop receiving.
when I restart the LPC11C22 by power off and on, it start working and suddenly it stops again receiving.

Did you found a solution for this issue?
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by prancius on Sat Sep 15 14:23:15 MST 2012
Missed :) thank you for notice!
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Sat Sep 15 14:15:07 MST 2012

Quote: prancius
2. Get LPC11U24 which is with usb :)



And without CAN :mad::confused::eek:
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by prancius on Sat Sep 15 14:09:40 MST 2012
I will choose simple. One of them

1. Use TTL usb cable
2. Get LPC11U24 which is with usb :)
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Sep 15 13:31:32 MST 2012
If you draw you own board, just add a FT232RL (SSOP28) as shown here:

Schematic:
http://flic.kr/p/b2GfaT

3D CAD:
http://flic.kr/p/b2Gf8c

FT232RL:
http://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT232R.pdf

Note: This chip can power your LPC11C24 also :):)
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by prancius on Sat Sep 15 13:15:19 MST 2012
Thank you for information. As usually need to use ttl.

Regards,
Pranas
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ex-kayoda on Sat Sep 15 13:00:04 MST 2012
Read USB<->TTL converter in 30 minutes: #15 of http://knowledgebase.nxp.com/showthread.php?t=1931
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by prancius on Sat Sep 15 11:20:48 MST 2012
Hello,

What board you are using? And how you connected board with pc?
I am also want to make CAN <-> usart <-> PC so i am interested how connect my board LPC11C24 via usart to PC

Regards,
Pranas
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Mon Mar 05 04:09:47 MST 2012
I have been debugging for some time now without sending CAN messages, and now the RX interrupt does not stop. Is there any critical handling of the TX interrupt, or use of MOBs for TX, which I should be aware about?
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Mon Mar 05 03:13:34 MST 2012
Yes, the ram is reserved for the CAN tranceiver.

The sample from LPCXpresso they are using MOB0, and if I use MOB32, the rx interrupt triggers with MOB0. After 256 time triggering on MOB0, the rx interrupt  has stopped triggering.
If I stop using MOB32, it do not trigger on MOB0, so that error is fixed.

The main-problem is unfortunately still present and after some time, the rx interrupt has stopped triggering. No task error, no CAN bus error and no CAN tranceiver error... :confused:
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 08:05:55 MST 2012

Quote: CasperH
...and still no solution found...



Except of MOB0 usage there's nothing wrong.
Otherwise your description is vague. Of course it's unusual that receiving is stopped, but without more information it's a guessing game.
Did you reserve RAM from address 0x1000 0050 to 0x1000 00B8?
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 07:40:48 MST 2012
Great improvement

for(i = 0; i < 30; i++)
{
 msg_obj.msgobj = i;
 msg_obj.mode_id = 0x400;
 msg_obj.mask = 0x00;
 (*rom)->pCAND->config_rxmsgobj(&msg_obj);
}
Is it something religious that you set 30 MOBs with same settings :confused:

Please stop kidding me :eek:

I'm surprised that you receive any ID at all after mutilating sample code

Again:

#1 Use a single MOB, MOB1

#2 Read your MOB in receive interrupt routine and store it. Reading MOBs outside of receive interrupts is nonsense!

#3 Don't disable CAN Interrupt.
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Tue Feb 28 07:36:47 MST 2012
I'm sorry, but this post started with a problem that I have, and still no solution found. Can you please start a new post...
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by yanvasilij on Tue Feb 28 07:09:51 MST 2012

Quote: Zero
Is it something religious that you set MOB30 30 times?
What does that mean?
Is it receiving 2 or is it showing 2 via UART?
How fast is your CAN?
What's your receive interrupt doing?



it's a mistake, sory. Here:

for(i = 0; i < 30; i++)
{
msg_obj.msgobj = i;
msg_obj.mode_id = 0x400;
msg_obj.mask = 0x00;
(*rom)->pCAND->config_rxmsgobj(&msg_obj);
}


reading from mobs:
os_evt_wait_or (EVT_CAN_int, 0xFFFF);//It is RTX rotine. It wait until CANrx interrupt is not happen
mob_amount = msg_obj.msgobj;
for(mob_num = 0; mob_num <= mob_amount; mob_num++)//read and process all used messages objects 
{
NVIC_DisableIRQ(CAN_IRQn);
msg_obj.msgobj = mob_num;
(*rom)->pCAND->can_receive(&msg_obj);//read mob_num message object
id = msg_obj.mode_id;
len = msg_obj.dlc;
for(i = 0; i<8; i++) data = msg_obj.data;
NVIC_EnableIRQ(CAN_IRQn);

//process data from this message object
...
...
//------------------------------------

}

interrupt rotine:
void CAN_rx(uint8_t msg_obj_num){
  msg_obj.msgobj = msg_obj_num;
  isr_evt_set (EVT_CAN_ISR, CAN_ISR);
  return;
}

CAN speed 500bps. Other devices send messages once per 100 ms. My device RECIVES 2 messeges from 3.
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 07:07:51 MST 2012

Quote:

for(i = 0; i < 30; i++)
{
msg_obj.msgobj = 30;
msg_obj.mode_id = 0x400;
msg_obj.mask = 0x00;
(*rom)->pCAND->config_rxmsgobj(&msg_obj);
}

Is it something religious that you set MOB30 30 times?

Quote:

...my device gets messages only from two of them...

What does that mean?
Is it receiving 2 or is it showing 2 via UART?
How fast is your CAN?
What's your receive interrupt doing?
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by yanvasilij on Tue Feb 28 06:54:01 MST 2012

Quote: Zero
#1 Use MOB1

#2 Set correct ID and MASK

There's no reason why one MOB shouldn't receive all messages :eek:
Which of them are not received? You are talking about UART, how fast is your UART and is it able to cope incoming data?



Zero, hello and thank you!

Here my initialization:
for(i = 0; i < 30; i++)
{
msg_obj.msgobj = 30;
msg_obj.mode_id = 0x400;
msg_obj.mask = 0x00;
(*rom)->pCAND->config_rxmsgobj(&msg_obj);
}

There 3 node on my CAN-bus id1 = 0x501; id2 = 0x502; id3 = 0x503. When They all are connected, my device gets messages only from two of them (id1 = 0x501; id2 = 0x502), separately gets from all. My UART speed 115200 kbs.   Six mounth ago I maked CAN<->UART converter on AVR microcontrioller (AT90CAN32) and it works fine. It can get masseges from all nodes and resending them by UART  (CANhacker protocol 115200 kbs).

I've exchaged my program to using MOB1. It didn't help.
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 06:46:40 MST 2012

Quote: yanvasilij
I've done it. Didn't help. All incoming messages get in  mob 0, and some of them don't get at all. I don't really know haw to read incoming messages if more than one mobs are used.



#1 Use MOB1

#2 Set correct ID and MASK

There's no reason why one MOB shouldn't receive all messages :eek:
Which of them are not received? You are talking about UART, how fast is your UART and is it able to cope incoming data?
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Feb 28 06:36:18 MST 2012

Quote: CasperH
The manual says that the controller supports 32 message objects, I'm only assuming that it is numbered from 0-31. I can't find more specific information.



Wrong manual, read:

[COLOR=Red]C_CAN User’s Manual Revision 1.2[/COLOR]

http://www.silabs.com/Support%20Documents/TechnicalDocs/Bosch_CAN_Users_Guide.pdf


Quote:

3.3.1 IFx Command Request Registers
....
Message Number
0x01-0x20 Valid Message Number, the Message Object in the Message RAM is selected for data transfer.
0x00 Not a valid Message Number, interpreted as 0x20
0x21-0x3F Not a valid Message Number, interpreted as 0x01-0x1F

0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by yanvasilij on Tue Feb 28 06:14:25 MST 2012

Quote: CasperH
I havn't tried to use more than one mob to receive, so I don't know if you are able to call config_rxmsgobj more than once with different mobs...?



I've done it. Didn't help. All incoming messages get in  mob 0, and some of them don't get at all. I don't really know haw to read incoming messages if more than one mobs are used.
0 Kudos
Reply

1,341 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CasperH on Tue Feb 28 06:08:50 MST 2012
I havn't tried to use more than one mob to receive, so I don't know if you are able to call config_rxmsgobj more than once with different mobs...?
0 Kudos
Reply