My module is working as a slave receiver, my I2C ISR can be simplified as follows: void interrupt I2CISR(void) { IBIF = 1; bThisByte = IBDR; } After the last statement, the receiver sends out an ACK, and after this ACK, the MCU holds both SDA and SCL low for at least 2.5 microseconds to indicate a BUSY status, before master transmitter can generate next clock. I understand this BUSY time is OK according to I2C standard, but our customer doesn't like this delay. So, is it possible to elminiate this delay or reduce it to less than 1 microsecond? ( I already set IBFD = 0 for 0 SDA Hold time). Thanks. |
|
I2C delay after each ACK on MC9S12DP256
Started by ●February 25, 2003
Reply by ●June 18, 20032003-06-18
--- In , "Chengrong Lu <chengrong@y...>" <chengrong@y...> wrote: > My module is working as a slave receiver, my I2C ISR can be > simplified as follows: > > void interrupt I2CISR(void) > { > IBIF = 1; > bThisByte = IBDR; > } > > After the last statement, the receiver sends out an ACK, and > after this ACK, the MCU holds both SDA and SCL low for at least > 2.5 microseconds to indicate a BUSY status, before master transmitter > can generate next clock. > > I understand this BUSY time is OK according to I2C standard, but our > customer doesn't like this delay. > > So, is it possible to elminiate this delay or reduce it to less than > 1 microsecond? ( I already set IBFD = 0 for 0 SDA Hold time). > > Thanks. Excuse me, can you help me?. I'm reading HCS12_IIC.pdf document. I don't understand what is the first tap, e how i can esactly calculate scl2start,tap2tap, and so on. I must estabilishe an I2C communication between HCS12 (master) and IO expander PCF 8574A (as slave). This is source code, of function that implement IIC: if(IIC_STATUSREG & BIT7VAL) /*Byte transfer condition*/ { while(IIC_STATUSREG bitand 0x20); /*Wait for IBB flag to clear if Bus is Idle, IBB=0*/ IIC_MASTERMODE_TRANSMIT; /*Start condition, Master/Transmit, IBB is set*/ IIC_DATAREG=ucAddr; /* "Address of slave", R/W=0 write mode*/ while(!(IIC_STATUSREG bitand 0x20)); /*Wait for IBB flag to set */ while((IIC_STATUSREG bitand 0x01)); /*Attendi ack dallo slave*/ for(i=0; i<000; i++) /*Delay software*/ j++; IIC_DATAREG=ucData; /*Enable led of IO Expander?*/ while(IIC_STATUSREG bitand 0x01); /*Attendi ack dallo slave*/ for(i=0; i<000; i++) /*Delay software*/ j++; IIC_STOP_CONDITION; /*Generate a Stop condition, IBB=0*/ //////////////////////////////////////// How i can eliminate delay software istruction?. Thanks. |