Software I2C master on the HC08 JB8

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Software I2C master on the HC08 JB8

1,578 Views
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.
Labels (1)
0 Kudos
Reply
1 Reply

397 Views
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 Kudos
Reply