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

18F26K22 with spi and I2c

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



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

18F26K22 with spi and I2c
PostPosted: Mon Mar 26, 2012 9:11 am     Reply with quote

Does anyone have working code for this chip with both spi and I2C working?

My config is spi_2 and I2c on 1.

It seem to hang on any write to the I2C.

Thanks for any help.

Chris
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 9:15 am     Reply with quote

Show us your code! A small,compilable program that has the problem.
also include compiler version and what value the I2C pullups re and bus speed.
We need more information to help you.
cwedgwood



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 9:17 am     Reply with quote

Thanks,

No pullups, i'm using NOFLOAT_HIGH instead.
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 9:41 am     Reply with quote

I2C devices need the correct pullups, it's in the specs
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 9:44 am     Reply with quote

Seriously get rid of this, and add resistors.
NOFLOAT_HIGH, can _only_ be used with slave devices that do not use NACK to mark the last transfer. It is _not_ compatible with normal I2C operation.

Best Wishes
cwedgwood



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 9:50 am     Reply with quote

Thanks, but would this cause the code to hang?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 26, 2012 10:48 am     Reply with quote

Quote:

No pullups, i'm using NOFLOAT_HIGH instead.
would this cause the code to hang?

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=40930
cwedgwood



Joined: 16 Mar 2012
Posts: 12

View user's profile Send private message

PostPosted: Wed Mar 28, 2012 3:14 am     Reply with quote

Thanks PCM, problem all fixed now.
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