- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to use the CY7C65211 as an interface between my Host - PC and a peripheral (e.g. sensing unit) acting as the I2C slave. To be more agile I wanted to write a driver within Matlab - which works flawlessly already - except for one crucial part: The CyI2cRead function. My sequence is the following:
- CyOpen
- CySetI2cConfig
- CyI2CWrite (within for loop)
- CyI2CRead (within for loop)
- CyClose
When running it for 1000 iterations, I have a Read Success rate of ~ 2% - so I had roughly 20 successful read operations
Question # 1
Do you have an experience whether there is a known issue for the read command? I am using it as the following:
[bStatusRead, CY_HANDLE, sTransferCountRead, cReadBuff] = calllib('CyLib','CyI2cRead',CY_HANDLE, CY_I2C_DATA_CONFIG, CY_Read_DATA_BUFFER, sTimeout)
(i hope this is clear)
for comparison, this is the function within the header file:
CY_RETURN_STATUS CyI2cRead (CY_HANDLE handle, /*Valid device handle*/
CY_I2C_DATA_CONFIG *dataConfig, /*I2C data config*/
CY_DATA_BUFFER *readBuffer, /*Read buffer details*/
UINT32 timeout /*API timeout value*/);
Concerning the error itself:
I have 3 different outputs from a read command
- Either nothing happens after the start condition, which is then followed by a returned 'CY_ERROR_I2C_NAK_ERROR' - Status
- No stop Bit is sent, therefore it reads until the 'CY_ERROR_IO_TIMEOUT' is returned
- It works
I am very thankful for any advice
BR,
Thomas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi tho_ka ,
Can you please let us know which I2c Device are you using it will be good if you share the device datasheet.
please share your configuration. have you configured USB serial device using USB Serial Utility tool .
Thank You
Varun Narolkar