Getting started with I2C as slave

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

cross mob
Anonymous
Not applicable

 Hello everyone,

   

I am new in the community and getting my hands on PSoC1. I am trying to implement I2C slave on CY8C20637-24LQXI. I am following apllication note AN56007 provided by Cypress. I could not understand how to handle request coming from master (Read/Write). How to handle request coming from master (read/write) and respond to the same? Is there any handlers available which get fire on detecting request from master after matching address?

   

Thank you,

   

nIk

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

Welcome in the forum, nIK !

   

I2C is quite straightforward: The slave provides a buffer which the master can read from and another buffer the master can write to. Not quite easy checking that out with a PSoC1 since you (normally) do not have any debugging capabilities. Do you have got a development kit ? Which one exactly??

   

What is your master device? Link to datasheet if you have got one

   

 

   

Bob

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

 @Bob,

   

Thank you for quick response.. I am using AVR ATMega164PA as a master (Datasheet is attached). I am using this library for I2C communication. I have tested this library and its working completely. I have used Arduino (as slave) to test communication. Now in place of Arduino I want to use CY8C20637-24LQXI as a slave.

   

As you mentioned master can write and read into buffer but you have not mentioned way to do that. It would be great if you can show me a way to do so.

   

Regards,

   

nIk

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

In the datasheet of the I2CHW component is an example (C and ASM) for a slave. I admit the structure of the program is a bit strange, but it is working.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

@Bob,

   

I am not finding I2CHW that you are talking about. Can you please make it clear??

   

nIk.

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

You are posting here in the PSoC1 forum. When you use Designer v5.4 and choose a cy8c29466 chip you will see the I2CHW component in the "Communications"-folder.

   

 

   

Bob

0 Likes