- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Look in datasheet of I2C slave for "Accept matching address in RX FIFO". That explains how to do exactly what you want.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Read Datasheet page 18 and 172! Use the API I2C_SetI2cAddressCustomInterruptHandler() and provide your function to read the address.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for pointing me in the right direction Bob! I got it to work. 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Congratulations! Welcome in the fascinating world of of PSoCs doing exactly what you want.
Bob