This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ78350-R1: how to read from the Manufacturer access using Block 0x44

Part Number: BQ78350-R1

Hey all,

I'm trying to read the Device Type from the device

From everything I've read and done with the above device It seems like the proper way to read from the ManufacturerAccess() is:

Write : 0x44 , 0x02 , 0x01 , 0x00 (little endian for command 0x0001)

Write : 0x44

Read (using address 16)

However this isn't working and my code fails when sending the second write. I'm not sure what else I would need to be sending in order to initiate the write. I've also tried to use 0x00 for the write and 0x23 and 0x26 for the reads.

Any advice is appreciated. I can post code snippets if needed, I just want to know if conceptually I'm doing the wrong thing. I should also mention I'm doing this while the device is in SEALED MODE which I don't think should matter.

Thanks for the input,

Scott Sterling Arnold

  • Hi Scott,

    Your command set is correct. Did you get a NACK signal durng Writing ?

    You have to read from 0x44.

  • right now, I'm using an Atmel Studio 6 built driver so the Nack is extracted a bit, so effectively what I expect when I write anything over the SMBus is that the driver function returns the same data length that I sent it,

    here's my write function if that helps

    static bool BMS_MAC_dev_Read(mac_command* command)
    {
    	uint8_t msg[4] = { 0x44 , command->len , command->maccode , ( command->maccode >> 8 ) };
    	uint8_t data[16];
    	// make a check in io_write for the readonly
    	if ( io_write(BMS_I2C_SMB_io, msg , 4 ) == 4 )
    	{
    		switch (command->access)
    		{
    			case BLOCK_R :
    			        if ( io_write(BMS_I2C_SMB_io, 0x44 , 1 ) == 1 )
    				{
    				        if ( io_read(BMS_I2C_SMB_io, data, ( command->len + 3 ) ) == ( command->len + 3 ) )
    					{
    						sprintf(debug_buffer, "%x %x %x %x %x\n", data[0], data[1], data[2], data[3], data[4]);
    						io_write(&EDBG_COM.io, debug_buffer, strlen(debug_buffer));
    						while( usart_async_get_status(&EDBG_COM,NULL) == ERR_BUSY );
    						// may need to do other stuff here
    						return true;
    					}
    				}
    		                break;
    		}
    	}
    	return false;
    }

    So what happens is the second write of just 0x44 (or 0x00) to the bq doesn't work. I'm using it in a similar way to how the SMBus made simple guide does with comcodes which I'm supposing is why this isn't working for reads from 0x44. To clarify when I for example read voltage I use the following:

    if ( io_write(BMS_I2C_SMB_io, &command->comcode, 1) == 1 )
    	{
    		if ( io_read(BMS_I2C_SMB_io, result, command->len) == command->len)
    		{
    			// may need to do other stuff here
    			return true;
    		}
    	}
    return false;

    the comcode and len in the above for voltage is 0x09 and 2 respectively, and result is a uint8_t array to collect data recieved.

    So with all that said, I'm not sure what a "read" from 0x44 means other than a write of 0x44 to the board then reading on the SMBus. feel like I'm missing something about the protocol.

    Thanks for the reply btw and confirming what I've understood so far. The Battery Management Studio, Advanced Comm SMB isn't really good for explaining the underlying workings of the Manufacturer Access.

    Thanks again,

    Scott

  • Is there more information needed to assist me with this or should I switch up the way I'm sending messages? Any help is appreciated.

    Thanks again,
    Scott
  • Hi Scott,

    I attached the file which responds your questions.

    Scott.pdf