User code execution in I2CHW user module during data transfer
Last Updated: 12/14/2009
Question: In the I2CHW user module in Master mode, can I execute other code while writing say, 128 bytes of data to a Slave? Does the same hold true for the I2Cm user module?
Response: The I2CHW user module uses the dedicated I2C Hardware resource on the PSoC. When you use the I2CHW_bWriteBytes function in the I2CHW user module, the function initiates the transfer in the foreground and the actual data transfer takes place in the ISR of the I2CHW user module. The foreground process has just to poll the ISR using the I2CHW_bReadI2CStatus function to check if the write is completed. During this time, the CPU can perform other operations in the foreground. The same applies to I2CHW_ReadBytes function as well.
But in case of the I2Cm user module, this is a firmware implemented I2C Master and the functions are completely blocking, ie, the read or write functions do not return till the read or write operation is completed.