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 CCS Technical Support

Weird I2C issue

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



Joined: 17 Aug 2005
Posts: 316
Location: Perth, Western Australia

View user's profile Send private message Visit poster's website

Weird I2C issue
PostPosted: Tue May 09, 2006 12:45 am     Reply with quote

I'm working on a system where an 18F2455 (ultimately for its USB port) is using I2C to communicate with up to 16 18F2480s (for their CAN ports). All using hardware I2C support, running at 8MHz and using the I2C slow mode.

Messages are passed using fixed-length multi-byte transfers of 12 bytes each.

I'd been getting the occasional bad data, so I decided to add a CRC-CCITT to the data. At that point everything stopped working. The weird part is when I switched the 18F2455 master to software I2C everything started working again.

Has anyone experienced anything like that?

My problem is that in order for the I2C comms to be reliable, I now need to disable interrupts around the i2c_start..i2c_stop code, no doubt because the software needs to time things and interrupts throw the timing out. I'm pretty sure that's why the 18F2455 now appears to be dropping RS232 characters every now and again.

I have to say that for this current project, the biggest time sink by far has been the I2C stuff. It seems to be incredibly fragile and unreliable. I've been wondering if switching to a LIN bus might be a better idea? Are there other options?
_________________
Andrew
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