Hello @bcelikte ,
Sorry, my mistake, I have shared the MC33771C instead of B family. But I think both of them work the same.
What I understand on how CC accumulator works is that every time you start a conversion the nbSamples are incremented and to the ccAcumulator is added the converted value for the ADC2 which is the current measurement. Now, both of the blocks (either if we talk about raw or measurements are reporting this in raw values). So the value that you see on the accumulator is raw data value and not converted in mA. This is why the output for the ccAccumulator is int32. You are expecting this to be in mA but it is in raw.
There are two things that I need to explain:
1. The ccAccumulator is stored in two uint16 registers and the block puts them together MSB and LSB. But I've seen that the SDK for the MC3377xB is defining a method on how to merge them. The actual formula from the toolbox is wrong, So I ask you to update the mc3377xb_s32k_get_values.tlc file under {Toolbox install path}\external_devices\blocks\mc3377xb. Here there are also a file that has to be replaced, at the same location, the mc3377xb_s32k_reg_write.mexw64 . So please update the files from the attached archive.
To convert from RAW to Amps you will have to use the formula presented in the Coulomb counting chapter under functional description. The rSHUNT is the value typed in the MC3377xB config block.
2. The initial configuration of the MC3377xB can be found as a C Structure under {Toolbox install path}\mbdtbx_s32k\src\BCC_SDK_SW\SDK_SW_Driver\bcc_s32k in the bcc_initial_configuration.h. At line 65 is defined if the counter uses the FREE_CNT method or not.
Also, pay attention to the FAULT register value which notifies the CC_OVF. You will find all the info required in the Reference Manual of the MC33771B and you can use the MC3377xB_Register_Write Block to clear the faults.
Hope this helps,
Marius