Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: baumer5000 on July 28, 2011, 07:08:19 pm

Title: Clock Stretching - I2C
Post by: baumer5000 on July 28, 2011, 07:08:19 pm
I thought it would be good to start a separate thread just on the topic of clock stretching.  I think it should be a requirement in future firmware revisions.

I tried out BP for the first time this week and was disappointed when I couldn't get it to communicate properly out of the box with my target PIC acting as an I2C slave.  My code relies on clock stretching for flow control and can take several tens of milliseconds to respond to certain commands.  Some commands I can get away with the 5 kHz speed, but not all.

That's my input.  Thanks for all those who work hard on this project.
Title: Re: Clock Stretching - I2C
Post by: ian on July 28, 2011, 07:21:36 pm
I'm sorry about that. Due to a defect in one version of the PIC 24FJ64GA002 on the Bus Pirate we use a software I2C library, and it does not support clock stretching at this time. It is on the todo list though.
Title: Re: Clock Stretching - I2C
Post by: akohlsmith on July 02, 2014, 01:26:04 am
Could we get positive confirmation that v4 bus pirates do support clock stretching? I'm sad to say that I wasted a few hours debugging an I2C slave implementation because it was not painfully obvious that my v3b did not support clock stretching.
Title: Re: Clock Stretching - I2C
Post by: macboy on September 12, 2014, 08:27:29 pm
I have clock stretching working on V3 with my own custom build. It is a trivial thing to implement... just wait until the clock goes high again after releasing it. I can hardly believe that it isn't implemented in the release firmware yet.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.00882056832session_write_close ( )...(null):0
20.00912188424ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.00912189200Database_MySQL->query( ).../DatabaseHandler.php:119
40.05352327936Database_MySQL->error( ).../Db-mysql.class.php:273