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

i2c bus scanner program [Solved]

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



Joined: 14 Sep 2003
Posts: 96
Location: Toronto, Ontario, Canada

View user's profile Send private message

i2c bus scanner program [Solved]
PostPosted: Tue Oct 27, 2015 6:59 pm     Reply with quote

Using PCWH 5.051
PIC18F97J60

Hi

I am trying the PCM Programmers I2C Scanner code and find that it works fine.

My question is if I unplug my I2C device from the board, the code hangs at the first address to test for.

Is this normal??

The way code is written it appears that it should not hang.


Thanks for any help

Jerry Shocked


Embarassed Found The problem.

My I2C device is on a plug in module, when I remove the module the code would hang.

The reason it would hang, I had the 4.7K pullups resistors on the 12c signals on the plug in module.

When I unpluged the module, no pullups in the i2c signals.

Embarassed Exclamation

Thanks again!
Ttelmah



Joined: 11 Mar 2010
Posts: 19552

View user's profile Send private message

PostPosted: Wed Oct 28, 2015 2:03 am     Reply with quote

and (of course) if you wanted to test for this in code, then read the input_state of both the I2C pins. If either is low, then print an error message that the I2C pins are not pulled high, before starting the scan. Smile
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