lpc17_CAN__LedControl on LPC1768

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

lpc17_CAN__LedControl on LPC1768

928件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jlara on Sat Feb 12 21:50:29 MST 2011
Can anyone help review the following code? I modified "lpc17_CAN_LedControl.zip example to transmit on CAN1 periodically. The code does not work and no transitions can be seen on the CAN pins (J6-9, J6-10).
0 件の賞賛
返信
3 返答(返信)

862件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Feb 13 12:35:50 MST 2011

Quote: jlara
Troubleshooting: I traced the pins of the transceiver and the lpcxpresso board several times.



:confused: And the result ?

As described in

http://knowledgebase.nxp.com/showthread.php?p=5823&highlight=self+test#post5823

there is a simple Self Test Mode, so you just need a working transceiver (and no additional receiving node which acknowledges the message)

So switch to Local Self Test

LPC_CAN1->MOD = 1; // Enter Reset Mode
LPC_CAN1->MOD = (1<<2); //local self test
 
//Enable CAN Interrupt
NVIC_EnableIRQ(CAN_IRQn);


[LEFT]before Enabling Interrupt.[/LEFT]

[LEFT]And now watch your scope and debug CANCON1->CANMOD.[/LEFT]

[LEFT]Should show 4 (1<<2) for self test mode, if it shows 5 your transceiver is not working.[/LEFT]

[LEFT]Without transceiver you can just connect RD1 / TD1 with something like 1k resistor to simulate a transceiver.[/LEFT]

[LEFT]So you should be able to transmit a message in Self Test Mode even with LPCXpresso and RD / TD bridge without transceiver.[/LEFT]

Note: Don't switch back to normal operation before you have a working CAN bus and working nodes which acknowledges your messages.

Note#1: Scope Serial Decoding shows 125k message: ID:0x234 No Ack Slot

http://www.flickr.com/photos/58892165@N08/5442242829/
0 件の賞賛
返信

862件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jlara on Sun Feb 13 09:45:51 MST 2011
Hi Zero,

Yes, CAN_SendMsg () is executed. LED2 is toggled in the same loop and that is working.  I am using a logic probe for now but will scope the pins if the problem persists.

Troubleshooting:  I traced the pins of the tranceiver and the lpcxpresso board several times.  Next I will troubleshoot the code.  I need to have a better understanding of the CAN controller, so I will be looking for the data sheet on the NXP website.  I was hoping someone intimate with this code would be able to spot the problem quickly.

It would be nice to know for a fact whether the [B]lpc17_CAN__LedControl.zip [/B]actually works on some board.  Can anyone confirm?  It was not designed for LPCXpresso 1768 board but it would help to know if it works.  It it does, it should work on LPCXpresso.
0 件の賞賛
返信

862件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Feb 12 23:24:03 MST 2011

Quote: jlara
The code does not work and no transitions can be seen on the CAN pins (J6-9, J6-10).



Try debugging :)

Is CAN_SendMsg () executed ?

Did you add a CAN transceiver or are you just scoping pins?
0 件の賞賛
返信