View Single Post
Posts: 75 | Thanked: 78 times | Joined on Jan 2010 @ Germany
#895
guys, I have some news about bme's i2c communication with bq24150.
Be aware that this is ALL communication to bq24150 through the kernel. Not necessarily only by BME.

initialisation (contains some nonsense IMHO):
Code:
i2c-2 (W): 0x3b, (R) 1 bytes, 	// read register 0x3b (wraps to 0x03, datasheet states otherwise!)
i2c_read:  0x4b			// result: Vendor/Part/Revision
i2c-2 (W): 0x3b, (R) 1 bytes,	// same
i2c_read:  0x4b
i2c-2 (W): 0x00, (R) 1 bytes,	// read status/control register
i2c_read:  0x00			// reset state should be x1xx 0xxx (datasheet)
i2c-2 (W): 0x00 0x80,		// reset safety timer
i2c-2 (W): 0x02, (R) 1 bytes,	// read control/battery register
i2c_read:  0x8c			// 3.5V + 700mV
i2c-2 (W): 0x02 0x8c,		// set control/battery to same value
i2c-2 (W): 0x00, (R) 1 bytes,	// read status
i2c_read:  0x00
i2c-2 (W): 0x00 0x00,		// write status
i2c-2 (W): 0x01, (R) 1 bytes,	// read control register
i2c_read:  0x06			// charger disabled, high impedance
i2c-2 (W): 0x01 0x06,		// set to same value
i2c-2 (W): 0x00, (R) 1 bytes,	// read status
i2c_read:  0x00
i2c-2 (W): 0x01, (R) 1 bytes,	// read control register
i2c_read:  0x06			// same as above
i2c-2 (W): 0x01 0x06,		// set to same value again
i2c-2 (W): 0x01, (R) 1 bytes,	// read again
i2c_read:  0x06
i2c-2 (W): 0x01 0x06,		// write again
every 15s:
Code:
i2c-2 (W): 0x00 0x80,		// reset safety timer
i2c-2 (W): 0x00, (R) 1 bytes,	// read status
i2c_read:  0x00
i2c-2 (W): 0x02, (R) 1 bytes,	// read control/battery register
i2c_read:  0x8c
i2c-2 (W): 0x04, (R) 1 bytes,	// read battery termination/fast charge current register
i2c_read:  0xca			// charge current sense voltage = 27.2mV
				// termination current sense voltage = 6.8mV
nothing too special, yet. But the printk's can be usefull when trying to find out how BME destroys VBUS, etc…

The diff for my printk's are attached.
Attached Files
File Type: txt bq24150-sniff.patch.txt (1.3 KB, 157 views)
 

The Following 4 Users Say Thank You to hcm For This Useful Post: