1
0
forked from me/IronOS

Fixing up ADC config

This commit is contained in:
Ben V. Brown
2021-04-27 20:53:35 +10:00
parent d4ea53cdcd
commit 68316f0735
4 changed files with 8 additions and 9 deletions

View File

@@ -16,7 +16,6 @@
#endif
#ifdef MODEL_MHP30
#define ACCEL_LIS
#define ACCEL_MSA
#define POW_PD
//#define POW_QC // Unsure if we have this

View File

@@ -177,8 +177,8 @@ static void MX_ADC2_Init(void) {
sConfig.Rank = ADC_REGULAR_RANK_2;
HAL_ADC_ConfigChannel(&hadc2, &sConfig);
sConfig.Channel = TIP_TEMP_ADC1_CHANNEL;
sConfig.Rank = ADC_REGULAR_RANK_2;
HAL_ADC_ConfigChannel(&hadc1, &sConfig);
sConfig.Rank = ADC_REGULAR_RANK_3;
HAL_ADC_ConfigChannel(&hadc2, &sConfig);
// Run ADC internal calibration
while (HAL_ADCEx_Calibration_Start(&hadc2) != HAL_OK)

View File

@@ -7,7 +7,7 @@
#include "MSA301_defines.h"
#include <MSA301.h>
#define MSA301_I2C_ADDRESS 0x4C
#define MSA301_I2C_ADDRESS 0x26<<1
bool MSA301::detect() { return FRToSI2C::probe(MSA301_I2C_ADDRESS); }
static const FRToSI2C::I2C_REG i2c_registers[] = {

View File

@@ -164,11 +164,11 @@
#endif
#ifdef MODEL_MHP30
#define VOLTAGE_DIV 650 // Default for MHP30 TODO
#define PID_POWER_LIMIT 75 // Sets the max pwm power limit
#define VOLTAGE_DIV 350 // Default for MHP30
#define PID_POWER_LIMIT 65 // Sets the max pwm power limit
#define CALIBRATION_OFFSET 900 // the adc offset in uV
#define POWER_LIMIT 65 // 65 watts default power limit
#define MAX_POWER_LIMIT 35 //
#define MAX_POWER_LIMIT 65 //
#define POWER_LIMIT_STEPS 2 //
#define OP_AMP_GAIN_STAGE OP_AMP_GAIN_STAGE_TS100 // TODO
#define TEMP_uV_LOOKUP_MHP30 // TODO
@@ -196,6 +196,6 @@ const uint8_t tipResistance = 45; // x10 ohms, 4.5 typical for ts80 tips
#endif
#ifdef MODEL_MHP30
const uint32_t tipMass = 80; // TODO
const uint8_t tipResistance = 65; // x10 ohms, 6 typical
const uint32_t tipMass = 100; // TODO
const uint8_t tipResistance = 75; // x10 ohms, ~6 typical
#endif