Software I2C master on the HC08 JB8

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

Software I2C master on the HC08 JB8

1,919件の閲覧回数
simon2
Contributor I
I have implemented a basic software master I2C module for the HC08 JB8 and I would like to extend it to be able to detect clock stretching by the slave device.

In order to do this, I need to be able to detect when the slave is holding the clock line low.

Unfortunately, the clock line is a output line as far as the JB8 is concerned and on the JB8, unlike some other microcontrollers, you don't appear to be able to read the current actual status of an output line.

I have looked at the software I2C master application note, but it is silent on the subject of clock stretching.

Does anyone have any suggestions how I can read the actual level of a JB8 output line ?

Thanks,

Simon.
ラベル(1)
0 件の賞賛
返信
1 返信

738件の閲覧回数
bigmac
Specialist III
Hello Simon,
 
Since the I2C interface requires an active pull-down and a passive pull-up, I would assume that you would set the output latch permanently low to provide the pull-down condition, and then toggle the clock by changing the DDR bit.  So when the clock state is set high, the pin would actually become an input.  At this point it can easily be determined whether the slave device is forcing the clock line to remain low.
 
Regards,
Mac
 
0 件の賞賛
返信