Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problems with using CAN on pic18f458

Status
Not open for further replies.

djolestojic

Member level 5
Joined
Dec 9, 2001
Messages
85
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
508
Does anybody know what can be cause for the following problem.
When I initialize canbus pheripheral on PIC18f458, an when I issue only one send message, microcontrolller keeps sending over and over again, as if TxReq bit is always set in cancon register of the used cantx buffer. But when I check the error code for canbus, microcontroller answers that it has Tx error count 128 (namely, NO ERROR code).

Thanks.
 

edonor

Junior Member level 1
Joined
May 31, 2004
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
153
Re: CAN on pic18f458

Do you have another node in the network? If the transmitter controller does not read a acknowledge (ACK bit dominant) of a receiver, it tries again .
 

djolestojic

Member level 5
Joined
Dec 9, 2001
Messages
85
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
508
Re: CAN on pic18f458

I have 2 nodes, with same code - except the second microcontroller has disabled lines in C code which call SendCanMessage() function (same initialization, etc.)
 

metao

Member level 1
Joined
Sep 1, 2004
Messages
33
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
303
Re: CAN on pic18f458

Try to use loop back mode for test your code
(Careful acceptance filter in Can module )
if your code work you should get data that your send.
if still not work i think your hardware have problem.
 

mImoto

Full Member level 4
Joined
Feb 21, 2002
Messages
211
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Activity points
1,746
Re: CAN on pic18f458

You should have no other CAN nodes in the network or you should check that your CANTX and CANRX are properly connected.

when a node first send a message if no other node acknoledge (place an ACK bit at the end of the frame) it retryes continually then the TXERRCNT is 128 (Passive mode).

Best regards,

mimoto
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top