Would anyone from Processor Expert like to weigh in on this one....?
PE initializes I2C as part of MCUinit() as follows:
/* IICF: MULT1=0,MULT0=1,ICR5=0,ICR4=0,ICR3=1,ICR2=0,ICR1=1,ICR0=1 */
IICF = 0x4BU;
/* IICS: TCF=1,IAAS=0,BUSY=0,ARBL=1,SRW=0,IICIF=1,RXAK=0 */
IICS = 0x92U; /* Clear the interrupt flags */
/* IICC1: IICEN=1 */
IICC1 |= (unsigned char)0x80U;
I fail to understand why TCF is written to (=1). According to Table 11-7 in the datasheet (IICS), TCF is cleared automatically by tx/rx events and is
shown as a read only bit.
Is there something about this bit that has not been disclosed or is this just an error on PE's part?
Hi Bob Walker.
The TCF is really read-only and there is no difference as to the value assigned to it. Make TCF = 1 this is not an error, just a useless as far as TCF = 0.
I have I2C working in SH8 in mode Multimaster/Master sends only and Slave receives only. It´s work very well. What do you need exactly?
I need nothing - I have I2C working as well. However, the code produced by Processor Expert raises questions, especially to those trying to implement I2C. If the setting of TCF is incorrect, it should be removed - it only adds more confusion. One only has to look at the sheer number of posts on tihs forum regarding I2C. I would prefer to have clarification by the Processor Expert group.
Hey Bob!
How is the project going so far? Any progress?
Regards!