Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Topic started by: funstuf on September 16, 2016, 10:03:04 pm

Title: problem i2c TIMEOUT!
Post by: funstuf on September 16, 2016, 10:03:04 pm
hello,
i have a big problem using i2c whit the buspirate.
it seems there is a long delay after a start condition and any ACK/NACK.
IT IS ALMOST 2mS long.
and it is getting even longer when the baud rate  of the buspirate is set to a lower rate.
normal i2c devises do not seem to care, sofar i could test it.
but i am trying to talk whit a smbus device, and that one does not like those long timeouts.
here a screenshot from my logic analyzer.
[attachment=0]
can anyone tel me whats is going on?
i am able to program the pic and i have the sours code open in mplab.
but i do not understand C/C++ completely.
can anyone help me to fix this problem?
Title: Re: problem i2c TIMEOUT!
Post by: mikeb on September 17, 2016, 01:49:07 am
I have never used I2C together with a Bus Pirate, but I think you might try updating your firmware,
especially could try out the firmware builds with speed optimization. I will upload it soon to this thread:
viewtopic.php?f=28&p=65284#p65284 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&p=65284#p65284)
This might be not a full solution, but maybe it could improve the situation?
Title: Re: problem i2c TIMEOUT!
Post by: funstuf on September 17, 2016, 09:54:20 am
this is the firmware that is in the pic.

Bus Pirate v3.5
Firmware v6.1 r1676  Bootloader v4.4
DEVID:0x0447 REVID:0x3046 (24FJ64GA002 B8)

it looks like that this is the latest firmware.
Title: Re: problem i2c TIMEOUT!
Post by: mikeb on September 17, 2016, 08:00:08 pm
[quote author="funstuf"]it looks like that this is the latest firmware.[/quote]

No the latest is firmware 7.0 - you can get it here:
viewtopic.php?f=28&t=8498#p65290 (http://dangerousprototypes.com/forum/viewtopic.php?f=28&t=8498#p65290)
You have BPv3 so you need to extract bpv3_fw7.0_16092016.zip,
and could try "_opt2_" firmware build (optimization for speed)

You bootloader is not the latest too - I am sure there were commits since your build.
But I can't find a project file for BPv3 bootloader, so you woud have to use the old bootloader for a while
Title: Re: problem i2c TIMEOUT!
Post by: funstuf on September 17, 2016, 11:59:18 pm
thanks mikeb,
i have programmed the version that you have proposed , but the problem i have is still the same.
i have tried to use a different terminal: hyperterminal and realterm, also connected the buspirate to a tablet , but the problem i have is still the same.
Title: Re: problem i2c TIMEOUT!
Post by: mikeb on September 18, 2016, 01:00:36 am
[quote author="funstuf"]i have tried to use a different terminal: hyperterminal and realterm, also connected the buspirate to a tablet , but the problem i have is still the same.[/quote]
hmm.... i never worked with i2c so sorry my help is limited by my experience... the only idea i have now is to try doing all this under Linux. If you don't have a PC with Linux already installed, maybe you could run Ubuntu LiveCD (or "LiveUSB" if you put this .iso to USB instead of hard drive).
1) Boot into a temporary environment (stored in RAM)
2) Install some i2c software (it will be also stored temporarily in RAM and will disappear after you shutdown your PC)
https://help.ubuntu.com/community/LiveC ... eCD_Ubuntu (https://help.ubuntu.com/community/LiveCD#How-To_LiveCD_Ubuntu)
Not sure if this could help but i just don't have any other ideas currently...

( ! ) 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.01032073272session_write_close ( )...(null):0
20.01062204864ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01062205640Database_MySQL->query( ).../DatabaseHandler.php:119
40.05432344376Database_MySQL->error( ).../Db-mysql.class.php:273