9S08SH8 and I2C

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

9S08SH8 and I2C

929件の閲覧回数
bob_walker
Contributor III

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?

ラベル(1)
3 返答(返信)

648件の閲覧回数
delair
Contributor I

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?

0 件の賞賛
返信

648件の閲覧回数
bob_walker
Contributor III

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.

648件の閲覧回数
Monica
Senior Contributor III

Hey Bob!

How is the project going so far? Any progress?

Regards!

0 件の賞賛
返信