-
Notifications
You must be signed in to change notification settings - Fork 10
Description
As mentioned in the specifications document, the formulas for calculating Vref, Icell and Vdac have been updated according to the characterization of the prototype in the laboratory. I have developed a series of files with functions that implement these new formulas that makes the calculation straight forward in order to make it easier for you. Incorporate these files into your projects and use them wherever you see fit. I'm sending you the files in this way (ZIP) and not through a commit in your repositories because not all of you have followed the same file structure. The description of each function can be found in the .h file.
Download: Core.zip
This is an example of how to use the functions:
#include "components/formulas.h"
...
uint32_t adcValue = HAL_ADC_GetValue(&hadc1);
double vRef = calculateVrefVoltage(adcValue);
...
adcValue = HAL_ADC_GetValue(&hadc1);
double iCell = calculateIcellCurrent(adcValue);
...
float vDac = calculateDacOutputVoltage(vCell);
MCP4725_SetOutputVoltage(hdac, vDac);
...I have also attached an update of i2c_lib that fixes a bug when making a transmission. Replace the original ones in your projects. Remember to comment the macro I2C_DEBUG in i2c_lib.h in order to test the project with the prototype. A new version of the ad5280_driver.c is also provided.
On the other hand, I ask you to turn on the power supply of the board (set the EN pin to high level) and let 500 ms to stabilize the system. You can do this by adding the HAL_Delay(500) function directly after enabling the power supply.
HAL_GPIO_WritePin(EN_GPIO_Port, EN_Pin, GPIO_PIN_SET);
HAL_Delay(500);I would also like to take this opportunity to let you know that the viSens application has been updated. In this last update (v0.2.0), the application stops sending the STOP command when the measurement is finished or the stop button is pressed. This will remove a number of inconveniences for those of you who do not implement the optional STOP functionality. Those of you who do implement this feature to qualify for the bonus score, please do not update the viSens application.