Multiple Slave Addresses for One Slave

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I have an I2C slave which responds to slave addresses 0x08 and 0x09. I want different functions for the same slave when either address is called. For example, if 0x08 is used read from the memory and if 0x09 is called light an LED.

Is there a function or a variable that holds the address call used to wake up the slave?

0 Likes
7 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Look in datasheet of I2C slave for "Accept matching address in RX FIFO". That explains how to do exactly what you want.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob! I found that set of code. I tried to implement it, but I'm only reading 0xFF from the FIFO register. Do you know how long that register holds the slave address value?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I realized the accept matching address in RX FIFO wasn't checked in the I2C Basic Config, but I checked that and had the same problem.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Read Datasheet page 18 and 172! Use the API I2C_SetI2cAddressCustomInterruptHandler() and provide your function to read the address.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for pointing me in the right direction Bob! I got it to work. 🙂

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Congratulations! Welcome in the fascinating world of  of PSoCs doing exactly what you want.

   

 

   

Bob

0 Likes