CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CAN bus problem¡¡¡¡¡Help¡¡¡¡

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Raúl Virutas



Joined: 20 Sep 2005
Posts: 2

View user's profile Send private message Send e-mail

CAN bus problem¡¡¡¡¡Help¡¡¡¡
PostPosted: Wed Sep 21, 2005 12:13 pm     Reply with quote

Hello everybody!!... and sorry for my english!!!

I'm a spanish student. I have a pcb with a PIC microcontroller (18C458)(20MHz) that uses a Phillips PCA82C250 transceiver. We are using CCS CAN libraries with MPLAB IDE to develop a domotic application, different nodes in this network comunicate with CAN protocol.
My program send a frame every 20 sec. and receive frames via interrupts.
Problem is I load succesfully trx buffer with can_putd function but data doesn't exit to bus because there is a "bus error" ->
bit TXBnCON.TXERR = 1 and so bit TXREQ remains 1.
Can somebody show me his code, i.e. bus initialization, in order to compare and try to find some mistake???
thanks!!!!!
my email is rauvape@epsa.upv.es
_________________
understanding CAN¡¡¡¡
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 21, 2005 12:24 pm     Reply with quote

Do you have a 120 ohm resistor connected between CAN_H and CAN_L
on each end of the CAN bus ? These resistors are required.

See the section on Bus Termination in the following page:
http://www.kvaser.com/index.htm
Raúl Virutas



Joined: 20 Sep 2005
Posts: 2

View user's profile Send private message Send e-mail

PostPosted: Thu Sep 22, 2005 8:23 am     Reply with quote

Hello¡ and thanks for your response.

We have the mentioned 120 ohms resistors attached betwen CANH and CANL. I think the problem is bus initialization...I will continue investigating it... thanks
_________________
understanding CAN¡¡¡¡
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Thu Sep 22, 2005 9:46 am     Reply with quote

Perhaps the problem lies with the bus. Normally the transceiver chip requires some kind on acknowledgement from another device on the bus. For instance, if you send a single message with nothing else on the bus, the message will be continually transmitted (scope). Perhaps this is the bus error you are seeing.
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Thu Sep 22, 2005 9:56 am     Reply with quote

My bad, I didn't read your initial email correctly.

Start with small steps. Try to isolate the problem to the device or the bus (divide and conquer approach). If you connect the terminating resistors only to your device (CAN_H, CAN_L), do you see any data transmitted when you send a message? Did you call can_init()? Do you have any known good devices in which to test the bus? Physical bus length may violate CAN spec?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group