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 addressing (from posts by PCM and Ttelmah)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> Best Of
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19495

View user's profile Send private message

I2C addressing (from posts by PCM and Ttelmah)
PostPosted: Tue Apr 21, 2020 6:31 am     Reply with quote

CCS uses 8-bit i2c address format the 'address byte'
All their functions and #use statements expect 8-bit format.

7-bit I2C format is used by NXP.

To convert 7-bit format to 8-bit, simply left-shift the 7-bit format by 1.

Do not initialize a slave address to an odd number. It will not work.

Do not use decimal. Think and use hex for i2c addresses.

Do not use reserved i2c addresses for a slave.

The 'address byte', has a 7bit address as the top seven bits, then the
R/W bit as the bottom bit. The PIC uses it's addresses in this format.

On the slave hardware address recognition, only the upper seven bits
are used. So only even 'addresses'. When sending the address byte, you
need the same format, but with the R/W bit included.

The most useful 'tool' for working with I2C addressing is the bus scanner
program from PCM_Programmer at:

<http://www.ccsinfo.com/forum/viewtopic.php?t=49713>
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    CCS Forum Index -> Best Of 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