2025-08-20 11:20 PM - edited 2025-08-20 11:41 PM
Hello everybody,
I would like to know when the VBUS voltage measurement is updated. I am using the functions to read the voltage:
VBS_GetBusVoltage_d
VBS_GetAvBusVoltage_V
I am using the threads startMediumFrequencyTask, StartSafetyTask, and my own thread.
At system startup, I want to load a buffer. But the measurements taken are incorrect or zero at the board startup.
Is there any documentation on the acquisitions?
MCSDK : 6.4.1
Best regards.
Solved! Go to Solution.
2025-08-21 8:38 AM
Hello @Cedd,
The raw VBUS value is obtained at the medium-frequency task in mc_tasks.c:
uint16_t rawValueM1 = RCM_GetRegularConv(&VbusRegConv_M1);
CodeReturn |= errMask[bMotor] & RVBS_CalcAvVbus(&BusVoltageSensor_M1, rawValueM1);
The latest conversion is then available in VbusRegConv_M1.data.
2025-08-20 11:37 PM
Which MCSDK version you are using there are some differences in 6.4.0 compared to previous versions for acquiring the regular channels ADC data.
2025-08-21 12:12 AM
Might be a bug in the library...
I do see the variable AvBusVoltage_d increasing over time, but LatestConv always stays at 0.
2025-08-21 8:38 AM
Hello @Cedd,
The raw VBUS value is obtained at the medium-frequency task in mc_tasks.c:
uint16_t rawValueM1 = RCM_GetRegularConv(&VbusRegConv_M1);
CodeReturn |= errMask[bMotor] & RVBS_CalcAvVbus(&BusVoltageSensor_M1, rawValueM1);
The latest conversion is then available in VbusRegConv_M1.data.
2025-08-21 11:31 PM
Hello GMA,
Thanks for this answer, it's all good.