Multiple I2C slaves (RTC & LCD) on CY8Ckit-059

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I have a DS1307 RTC connected to I2C and an PC8574 connected to a 16x02 LCD connected to the same I2C lines in parallel.

The issue is that each of the devices work in isolation but when I try to use both, they don't work. I am using the CharLCD by Michael Bey CharLCD_I2C Component interface for PCF8574AT / HD44780 Combo .

The program is attached for your reference. Any advice is much appreciated.

PS: There are 2 no's of 4.7k pull-up resistors on the DS1307 component.

0 Likes
5 Replies
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

There are 2 I2C master components in the project, and 1 pair of I2C bus pins. Seems this is not standard way to control 2 slaves.

Could you try watching I2C bus waveform to double-check if I2C bus waveform is OK or not?

Thanks,

Ryan

0 Likes
pacr_284376
Level 5
Level 5
100 replies posted 10 solutions authored 50 sign-ins

I agree with rzzh.

You need ONE master-i2c component on CY8CKIT-059 software. the PCF8574 and DS1307 are SLAVES so you have two of them.

Using this Master i2c component you select which component to use by the i2c adress.

I would suggest to write a small routine which shows you which i2c adresses are present.

Hint : Use the Bridge Control Panel software (installed together with PSOC Creator) . For using this with your CY8CKIT-059, it might be needed to use specific i2c pins (or hardware-connect them from the programmer-part to the pins you use. The Bridge Control Panel also shows the list if available i2c adresses by clicking "LIST". If connected correctly this should directly show you 2 available adresses.

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

There is only one I2C master in the Topdesign schematic.

Sorry if the names were confusing, but the CharLCD is not an I2C master. Only the I2C_CharLCD is the master. The CharLCD uses the I2C connection from the I2C_CharLCD to run the LCD.

Hope the below images makes things more clear. The custom component file is also attached here.

pastedImage_0.png

pastedImage_1.png

pastedImage_2.png

0 Likes
Anonymous
Not applicable

So I got the program to work by stopping I2C and then Starting I2C again. It is a crude system but it works for now.

The interesting thing is that when I send I2C_CharLCD_MasterSendStop(); I get the result of "2" which should be I2C_MSTR_NOT_READY and goes into an infinite loop if I wait for I2C_MSTR_NO_ERROR (0).

Any ideas what is going on?

0 Likes
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

the error code "2" means which status?

0 Likes