Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Development => Topic started by: lartmander on March 08, 2012, 12:53:19 am

Title: BP v3 I2C 16-bit register writes?
Post by: lartmander on March 08, 2012, 12:53:19 am
I have a component that uses a 16-bit register write, and I'm a bit unsure if the BP is writing and reading correctly.

Does this look correct? (from a terminal session)  There doesn't look like there's any distinction when I write a 0x000A or a 0x010A. 

I2C>[0x34 0x000A 0x47 0x81]
I2C START BIT
WRITE: 0x34 NACK
WRITE: 0x0A NACK
WRITE: 0x47 NACK
WRITE: 0x81 NACK
I2C STOP BIT
I2C>[0x34 0x010a 0x47 0x81]
I2C START BIT
WRITE: 0x34 NACK
WRITE: 0x0A NACK
WRITE: 0x47 NACK
WRITE: 0x81 NACK
I2C STOP BIT
Title: Re: BP v3 I2C 16-bit register writes?
Post by: ian on March 08, 2012, 07:27:29 am
I believe the code only supports 8bit I2C registers. Sjaak added adjustable bits to the code though, so he would be the final word.

Do you have a datasheet for the chip?
Title: Re: BP v3 I2C 16-bit register writes?
Post by: Sjaak on March 08, 2012, 07:27:55 am
Standard does the buspirate 8bit read/writes. you can send more bits with the ; postfix, i.e. 0x55AA;16 after this all subsequent read/writes are 16 bits. with i2c a 16 bits can also be written as two 8bits: 0x55 0xAA

btw everything is nacked, so please check your coonnections. I guess you forgot the the pullups..

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