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

i2c_start not starting!

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



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

i2c_start not starting!
PostPosted: Sun Apr 30, 2006 2:03 pm     Reply with quote

Hi,
I am having a spot of bother with some i2c code.
I am getting stuck in i2c_start(); I never get to my next line which is a i2c_write with the address! I am using the hardware i2c MSSP master mode. The code it's stuck in is:

01C8: BSF FC5.0
01CA: BTFSC FC5.0
01CC: BRA 01CA

FC5.0 is "Initiate Start condition on SDA and SCL pins. Automatically cleared by hardware"

in my case the hardware isn't automatically clearing it! Even with nothing connected to the i2c liens only 3k pull-ups it still doesn't get cleared.

Am I missing something?

P.S. PIC is 18F2520
Ttelmah
Guest







PostPosted: Sun Apr 30, 2006 2:54 pm     Reply with quote

Have you looked at the errata sheet for the chip.
There is a problem if an I2C_START is repeatedly sent. In this circumstance the bit will not clear automatically, and will hang the code...
Send an I2C_STOP, before sending any I2C_START command, and it should prevent the problem.

Best Wishes
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