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 RXIF flag

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
microJuan



Joined: 08 Mar 2008
Posts: 6

View user's profile Send private message

CAN BUS RXIF flag
PostPosted: Fri Apr 04, 2008 2:47 am     Reply with quote

Hi All,

I am new to CAN and using CCS, I recently purchased the CAN dev kit. All works well with the provided examples and all.

However, I have a device which outputs a CAN signal at 1MBit. I changed the baud register on the 18F4580.C file as discussed in

http://www.ccsinfo.com/forum/viewtopic.php?t=22138&start=8

I changed my registers to:

// the 3 lines below set registers for 1Mbit comms at 20MHz !!!

BRGCON1 = 0x00;
BRGCON2 = 0xA0;
BRGCON3 = 0x02;

(can someone confirm these for me please)

anyways, I can actually pick up data with these settings. But for some reason or other, my RXIF is raised, I cannot find any documentaion, that can suggest what might cause this problem. Also, whenever I connect the CAN devboard to the CAN Bus, other nodes drop out. Im confused.

Any suggestions or comments is greatly appreciated

Juan
jma_1



Joined: 08 Feb 2005
Posts: 147
Location: Wisconsin

View user's profile Send private message

PostPosted: Fri Apr 04, 2008 11:37 am     Reply with quote

Howdy,

Using a downloaded bit timing calculator, I came up with the same BRGCONx values. The calculator did throw up a warning about the MCP2510 idle time violation (20 < 26 min). I do not know if this is an issue or not with your setup.

pg 329 (pdf page #)of the datasheet for 18F4580
If the messsage started to transmit but encountered an error condition, the TXERR and the IRXIF bits will be sent and an interrupt will be generated.

pg 342 (pdf page #)
When an error occurs during transmission or reception of a message, the message error flag, IRXIF, will be set...and an interrupt generated

This means the error occured with either the 18F4580 board or something else on the bus. I would systematically check all nodes on the bus.

Does the baud rate of all the devices match? Is your clock frequency stable for the device? Is your bus terminated correctly? Have you tried both standard identifiers and extended identifiers? If you have the 18F4580 in listen-only mode, do you still have the problem? Do you have a PC tool or scope which will detect bus errors (error frame, bus off, dominant / passive incorrect states)? What is the bus loading (% load of full bus traffic)?

Is 1 MBaud needed? How about 250K or 125K? These rates are more typical for implementation of specific protocols like CANopen or J1939.

With such a high baud rate the cable length is reduced (as compared to other baud rates). What happens if you shorted the backbone to a few meters? The J1939 spec for drops off the backbone for 250 KBaud is less than 1 meter. I would take this to mean drops off the backbone at higher rates should be shorter than 1 meter, but I have never used this high of a baud rate.

Cheers,
JMA
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