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

USB low-full-high speed peripherals Forum Discussions

anne_4609456
Level 3
Level 3
10 replies posted 25 sign-ins 5 questions asked

Hello.

I wrote a program in C to read/write an 24C64 external serial eeprom for CY7C64315-16 chip.
I used P1[5] as SDA and P1[7] as SCL and set both pins as I2C open drain low and connected external pull-up resistor (5.6 K ohms) on both pins.
My program works fine to write data to external eeprom. I checked it using an external read/write programmer device.
But when I try to read data from the eeprom it seems the SDA pin cannot be read by my program.
I'm assuming that P1[5] when set as I2C and open drain low it works as bidirectional, correct?
Which instruction in C should I use to check the SDA pin status (P1[5]) coming from external I2C eeprom?

Any additional advices are welcome.

Best regards,
Anne.

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

Since you can "write" data to the deivce, I hope that the SDA pin is OK.

But from my experience, read operation and/or some operations which requires the device some preparation,

you (or we) need insert delay after sending "start(I2C_READ_MODE)" or "restart(I2C_READ_MODE)."

So how about adding CyDelayUs(100) or CyDelay(1) if you are using PSoC Creator,

or add similar delay function before reading the value?

moto

View solution in original post

0 Likes
2 Replies
Len_CONSULTRON
Level 9
Level 9
500 solutions authored 1000 replies posted 750 replies posted

Anne,

I believe you posted this question in the wrong forum section.  This sub-forum supports the PsoC1, PSoC3 and PSoC5 CPUs.

I believe you want the "USB" forum with one of the sub-forums listed below.

Len_CONSULTRON_0-1672451282095.png

In this forum, I don't think you'll get the "eyes" you need to solve your issue.

Len
"Engineering is an Art. The Art of Compromise."
MotooTanaka
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Hi,

Since you can "write" data to the deivce, I hope that the SDA pin is OK.

But from my experience, read operation and/or some operations which requires the device some preparation,

you (or we) need insert delay after sending "start(I2C_READ_MODE)" or "restart(I2C_READ_MODE)."

So how about adding CyDelayUs(100) or CyDelay(1) if you are using PSoC Creator,

or add similar delay function before reading the value?

moto

0 Likes