2005-03-18 01:51 PM
2011-05-17 03:06 AM
I am using the sample uPSD I2C driver contained in one of the App. Notes. However, in order to make the I2C driver work with a certain device, I need to delay the sending of I2C data w.r.t.
the I2C clock, in the range of about .5 microsec - 1 microsec. I suspect there is a way of accomplishing this either by correctly setting up S1CON/S1SETUP. Or, by possibly changing the order of some instructions in the code, so the I2C clock starts slightly earlier before the I2C data begins to get sent. Any ideas?? Thanks for your help.2011-05-17 03:06 AM
Hi,
I think that first you should consider the following questions: - what max I2C speed is supported by your slave device (Standard, Fast or High), - are the CR0, CR1, CR2 bits in S1CON set accordingly to your crystal frequency (you should not exceed max I2C speed), - is the I2C START condition sample in S1SETUP set correcttly also here I2C speed is important). I don't think that you cannot control data/clock sequence by changing some instruction order. The data/clock are generated internally by I2C engine in hardware.