Continue to Site

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.
 

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 .
 

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.)
 

Re: CAN on pic18f458

If you tested it on a small distance do you have small termination resistor between lines?
Also, maybe mikropasca CANl example with pic18f458 can be useful.
**broken link removed**
 

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.
 

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top