bq78350

BQ78350

AFEのICと通信するのに使う石.
BQ78350-R1とBQ78350-R1Aとあるが,これから使うならBQ78350-R1Aがいいかも.
BQ78350-R1A: Differences between chip versions BQ78350-R1, BQ78350-R1A and BQ78350-R2.
テクニカルリファレンスマニュアルに書いてあるデータ長は16進数表記であることに注意
読み書きする際のSBSコマンドのアドレスやデータはリトルエンディアンでやり取りしてればいいんだけど,ManufacturerBlockAccess()で読み書きするデータはビッグエンディアン?のようで混乱した.

デフォルトだと3セルしかつながないせっていになってるみたい. まずここを変更する必要がある. AFE Cell Mapというレジスタで編集するが,ここはData Flashという領域っぽい. ここにアクセスして書き換えるにはManufacturerBlockAccess()を使った読みだす.
0x44にアドレスを書き込み,0x44を読み出すとそのアドレスとそのアドレスのデータが出てくるらしい.
0x44に書き込もうとしたら最初の1バイト目でスレーブがバスを掴んだまま,ACKが帰ってこない?っぽくて次に進めなかった. AFE_Cell_Mapをデフォルトの0x0013から0x0273に変更.これでbq79630で6セル読む設定にできた.
にわたすアドレスはリトルエンディアンで渡すのに,データはビッグエンディアンで渡してる?っぽくて混乱の原因になった.  

最初にデータ数渡す必要がある言う情報,マニュアルに書いてあったっけ? → SMBusの仕様だった
BQ78350-R1: Data flash read byte order on SMBus not according to datasheet

BQ78350-R1AはSMBus v1.1(with PEC),SBSも準拠している模様.
といってもPECありなし両方の設定ができる.

FETを2段使った回路で,必要なときだけVENを立ち上げ,このときの電源電圧(を分圧抵抗で分けたもの)をBATに接続し,ADCで計測する.
この時,接続するセル数にもよるが,BATに掛かる電圧は1V以下になるようにしておくことが推奨

The BQ78350-R1A is intended to be used with the BQ769x0 Battery Monitor with a 2.5-V REGOUT configuration and I2C Address 0x08.
BQ78350-R1Aは、2.5 VREGOUT構成およびI2Cアドレス0x08のBQ769x0バッテリーモニターで使用することを目的としています。
However, the BQ78350-R1A can use a BQ769x0 with or without the communications CRC enabled (the BQ78350-R1A automatically detects if CRC is enabled).
ただし、BQ78350-R1Aは、通信CRCが有効になっているかどうかに関係なくBQ769x0を使用できます(BQ78350-R1Aは、CRCが有効かどうかを自動的に検出します)。

これかなり辛い事実で,BQ769x0はREGOUTの電圧の,I2Cアドレス,CRCの有無でいくつか異なる型番が存在する中,-00, -01のデバイスしか現状対応していないということになる.
そして今回購入できたのは-06なのBQ78350からの通信はできなさそう.

The BQ78350-R1A can receive or transmit data with or without packet error checking (PEC).
BQ78350-R1Aは、パケットエラーチェック(PEC)の有無にかかわらず、データを送受信できます。
In the write-word protocol, if the host does not support PEC, the last byte of data is followed by a stop condition and the [HPE] bit should be set to 0 (default).
ライトワードプロトコルでは、ホストがPECをサポートしていない場合、データの最後のバイトの後に停止条件が続き、[HPE]ビットを0(デフォルト)に設定する必要があります。
In the write-word protocol, the BQ78350-R1A receives the PEC after the last byte of data from the host.
ライトワードプロトコルでは、BQ78350-R1Aはホストからのデータの最後のバイトの後にPECを受信します。
If the host does not support PEC, the last byte of data is followed by a stop condition.
ホストがPECをサポートしていない場合、データの最後のバイトの後に停止条件が続きます。
After receipt of the PEC, the BQ78350-R1A compares the value to its calculation.
PECの受信後、BQ78350-R1Aは値をその計算と比較します。
If the PEC is correct, the BQ78350-R1A responds with an ACKNOWLEDGE.
PECが正しい場合、BQ78350-R1AはACKNOWLEDGEで応答します。
If it is not correct, the BQ78350-R1A responds with a NOT ACKNOWLEDGE and sets an error code.
正しくない場合、BQ78350-R1AはNOT ACKNOWLEDGEで応答し、エラーコードを設定します。
If the host supports PEC, the [HPE] bit should be set to 1.
ホストがPECをサポートしている場合は、[HPE]ビットを1に設定する必要があります。
In the read-word and block-read in MASTER mode, the host generates an ACKNOWLEDGE after the last byte of data sent by the BQ78350-R1A.
MASTERモードのリードワードおよびブロックリードでは、ホストはBQ78350-R1Aによって送信されたデータの最後のバイトの後にACKNOWLEDGEを生成します。
The BQ78350-R1A then sends the PEC, and the host, acting as a master-receiver, generates a NOT ACKNOWLEDGE and a stop condition.
次に、BQ78350-R1AがPECを送信し、マスターレシーバとして機能するホストがNOTACKNOWLEDGEと停止条件を生成します。

The ManufacturerAccess() and ManufacturerBlockAccess() commands make available a variety of data:
- ManufacturerAccess() provides access to the data through the Smart Battery data set standard, including when in SEALED mode, using a sequence of a ManufacturerAccess() write word and a ManufacturerData() block read.
- The ManufacturerBlockAccess() is an extended command that enables access to the same data, but through a simpler block write/read sequence to the same command.
ManufacturerAccess()およびManufacturerBlockAccess()コマンドは、さまざまなデータを利用できるようにします。
- ManufacturerAccess()は、SEALEDモードの場合を含め、ManufacturerAccess()書き込みワードとManufacturerData()ブロック読み取りのシーケンスを使用して、スマートバッテリーデータセット標準を介してデータへのアクセスを提供します。
- ManufacturerBlockAccess()は、同じデータへのアクセスを可能にする拡張コマンドですが、同じコマンドへのより単純なブロック書き込み/読み取りシーケンスを介して行われます。

17.2.59 Data Flash Access() 0x4000–0x5FFF

Accessing data flash is only supported by the ManufacturerBlockAccess() by addressing the physical address.
To write to the DF, send the starting address, followed by the DF data block. The DF data block is the intended revised DF data to be updated to DF.
The size of the DF data block ranges from 1 byte to 32 bytes.
All individual data must be sent in Little Endian.
データフラッシュへのアクセスは、物理アドレスをアドレス指定することにより、ManufacturerBlockAccess()によってのみサポートされます。
DFに書き込むには、開始アドレスを送信し、続いてDFデータブロックを送信します。 DFデータブロックは、DFに更新される予定の改訂されたDFデータです。
DFデータブロックのサイズは1バイトから32バイトの範囲です。
個々のデータはすべてリトルエンディアンで送信する必要があります。

The gauge supports an auto-increment on the address during a DF read. This greatly reduces the time required to read out the entire DF. Continue with the read from the DF example.
If another SMBus read block is sent with command 0x44, the gauge returns another 32 bytes of DF data, starting with address 0x4020.
ゲージは、DF読み取り中のアドレスの自動インクリメントをサポートします。これにより、DF全体の読み取りに必要な時間が大幅に短縮されます。 DFの例からの読み取りを続行します。
別のSMBus読み取りブロックがコマンド0x44で送信された場合、ゲージはアドレス0x4020で始まる別の32バイトのDFデータを返します。

参考文献

  • bq78350.txt
  • 最終更新: 2021/08/09
  • by yuqlid