I2C slave address mask

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

I2C slave address mask

Post by fotios »

Hi
I will setup a PIC as slave in I2C bus with a 7 bit ID. I came across the Microchip datasheet and from what i understood, for a slave to respond in a unique ID all bits in Slave Address Mask register must be set to 1? E.g. if i want the slave to respond only in device address (or ID) 0x30, the Address Mask must be set to 0xFF (1111 1111)? Or to 0xFE (1111 1110)? Or is the same? In datasheet simply is denoted that the MSK0 bit is not used in 7-bit addressing mode. So, if the master transmits 0x30 the slave PIC will get in write mode and 0x31 in read mode?
Thanks
Best Regards FOTIS ANAGNOSTOU

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: I2C slave address mask

Post by LeighM »

I think the answer is yes to all your questions :D

Post Reply