国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【STM32 開發(fā)】| INA219采集電壓、電流值

這篇具有很好參考價(jià)值的文章主要介紹了【STM32 開發(fā)】| INA219采集電壓、電流值。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

前言

INA219 是一款具備 I2C 或 SMBUS 兼容接口的分流器和功率監(jiān)測計(jì)。該器件監(jiān)測分流器電壓降和總線電源電壓,轉(zhuǎn)換次數(shù)和濾波選項(xiàng)可通過編程設(shè)定??删幊绦?zhǔn)值與內(nèi)部乘法器相結(jié)合,支持直接讀取電流值(單位:安培)。通過附加乘法寄存器可計(jì)算功率(單位:瓦)。I2C 或 SMBUS 兼容接口 具有 16 個(gè)可編程地址。

INA219 可在 0V 至 26V 范圍內(nèi)感測總線中的分壓。該器件由 3V 至 5.5V 單電源供電,電源的最大流耗為1mA。INA219 的工作溫度范圍為 -40°C 至 125°C。

1 原理圖

ina219,STM32,stm32,單片機(jī),嵌入式硬件

2 IIC地址說明

ina219,STM32,stm32,單片機(jī),嵌入式硬件
此測試時(shí)A0、A1都下拉接地,所以INA219的IIC通信地址為1000000B

3 寄存器地址說明

ina219,STM32,stm32,單片機(jī),嵌入式硬件

  • 0x00 配置寄存器,用來配置工作模式、采集范圍以及其他參數(shù)
  • 0x01 分流電阻兩端的電壓
  • 0x02 總線電壓(IN-到GND的電壓差)
  • 0x03 功率
  • 0x04 經(jīng)過分流電阻兩端的電流
  • 0x05 校準(zhǔn)寄存器,用于對測量結(jié)果進(jìn)行校準(zhǔn)

4 開始工作前配置

  • 0x00 寄存器Bit 13:設(shè)置檢測最大檢測電壓 0 = 16V,1 = 32V (此處項(xiàng)目需要測3V到5V的電壓,故設(shè)置Bit 13 為 0
  • 0x00 寄存器Bit 11-12:設(shè)置總線分流電阻最大的電壓(此處項(xiàng)目需要測0A到5A的電流,故設(shè)置Bit 11-12 為 01,即量程±80mV,可測電流±8A
  • 0x00 寄存器Bit 0-2:設(shè)置工作模式(默認(rèn))
  • 0x05 寄存器:設(shè)置基準(zhǔn)值(根據(jù)需要測的電壓、電流范圍再套入公式得出結(jié)果

由以下公式可得出0x05的配置值。
C a l = t r u n c ( 0.04096 C u r r e n t L S B × R s h u n t ) Cal = trunc\left ( \frac{0.04096}{CurrentLSB\times Rshunt} \right ) Cal=trunc(CurrentLSB×Rshunt0.04096?)
C u r r e n t L S B = M a x i m u m E x p e c t e d C u r r e n t 2 15 CurrentLSB = \frac{Maximum Expected Current}{2^{15}} CurrentLSB=215MaximumExpectedCurrent?

數(shù)據(jù)手冊說明文檔
ina219,STM32,stm32,單片機(jī),嵌入式硬件文章來源地址http://www.zghlxwxcb.cn/news/detail-767719.html

5 程序代碼

1)驅(qū)動程序

#include "main.h"
#include "ina219aidcnr_helper.h"

uint16_t ina219_calibrationValue;
uint16_t ina219_currentDivider_mA;
float ina219_powerMultiplier_mW;

/**
 * @brief  The IIC reads 16bit data from the specified register address.
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  registerAddress Internal memory address.
 * @return 16 bit register data.
 */
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress)
{
  uint8_t Value[2];

  HAL_I2C_Mem_Read(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, Value, 2, 1000);

  return ((Value[0] << 8) | Value[1]);
}

/**
 * @brief  Writes 16 bits of data to the register.
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  registerAddress Internal memory address.
 * @param  Value 16 bits of data to be written.
 */
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value)
{
  uint8_t regAddr[2];
  /* High Byte */
  regAddr[0] = (Value >> 8) & 0xff;
  /* Low Byte */
  regAddr[1] = (Value >> 0) & 0xff;
  HAL_I2C_Mem_Write(ina219->ina219_i2c, (INA219_ADDRESS<<1), registerAddress, 1, (uint8_t*)regAddr, 2, 1000);
}

/**
 * @brief  Read bus voltage.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Read voltage value, unit mV.
 */
uint16_t INA219_ReadBusVoltage(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_BUS_VOLTAGE);

  /* return mV */
  return ((result >> 3  ) * 4);
}

/**
 * @brief  Read current register value.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Current register value.
 */
uint16_t INA219_ReadCurrentRaw(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CURRENT);

  return (result);
}

/**
 * @brief  Read current register value, unit mA.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Current value.
 */
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219)
{
  uint16_t result = INA219_ReadCurrentRaw(ina219);

  return (result / ina219_currentDivider_mA);
}

/**
 * @brief  Read current register value, unit mV.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Shunt Voltage value.
 */
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_SHUNT_VOLTAGE);

  /* When multiple sign bits are present, they will all be the same value.
   * Negative numbers are represented in 2's complement format.
   * Generate the 2's complement of a negative number by complementing the absolute value binary number and adding 1.
   * Extend the sign, denoting a negative number by setting the MSB = 1.
   * Extend the sign to any additional sign bits to form the 16-bit word. */
  if(result > MAX_SHUNT_RANGE)
  {
    result = 65536 - MAX_SHUNT_RANGE;
  }

  /* Shunt voltage, unit mV. */
  return (result / 100);
}

/**
 * @brief  INA219 system reset.
 * @param  ina219 Slave configuration structure of the IIC.
 */
void INA219_Reset(INA219_t *ina219)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, INA219_CONFIG_RESET);
  HAL_Delay(1);
}

/**
 * @brief Set calibration register.
 * @param ina219 Slave configuration structure of the IIC.
 * @param calibrationData Calibrated data.
 */
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CALIBRATION, calibrationData);
}

/**
 * @brief  Gets the value of the configuration register.
 * @param  ina219 Slave configuration structure of the IIC.
 * @return Configuration Register value.
 */
uint16_t INA219_GetConfigInfo(INA219_t *ina219)
{
  uint16_t result = INA219_ReadDataForRegister_16Bits(ina219, INA219_REG_CONFIG);
  return result;
}

/**
 * @brief Set configuration register.
 * @param ina219 Slave configuration structure of the IIC.
 * @param configData Configuration data.
 */
void INA219_SetConfig(INA219_t *ina219, uint16_t configData)
{
  INA219_WriteDataToRegister_16Bits(ina219, INA219_REG_CONFIG, configData);
}

/**
 * @brief The measurement results are calibrated. Voltage range is 16V, Current range is 8A.
 * @param ina219 Slave configuration structure of the IIC.
 */
void INA219_SetCalibration_16V_8A(INA219_t *ina219)
{
  uint16_t configInfo = INA219_CONFIG_VOLTAGE_RANGE_16V |
                    INA219_CONFIG_GAIN_2_80MV | INA219_CONFIG_BADCRES_12BIT |
                    INA219_CONFIG_SADCRES_12BIT_1S_532US |
                    INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS;

  // Current_LSB = Maximum Expected Current / 2^15 = (80 / 10) / 2^15 = 0.0002
  // Cal = 0.04096 / (Current_LSB / R) = 0.04096 / (0.0002A * 0.01R) = 20480 = 0x5000
  // Calibration Register = 20480
  ina219_calibrationValue = 20480;

  // 1mA = Current_LSB * bits = 200uA * 5bit (5 bit/mA)
  ina219_currentDivider_mA = 5;
  // 1mW = Power_LSB * bits = 4mW * 0.25bit (0.25f bit/mW)
  ina219_powerMultiplier_mW = 0.25f;

  INA219_SetCalibration(ina219, ina219_calibrationValue);
  INA219_SetConfig(ina219, configInfo);
}

/**
 * @brief  Ina219 driver initialization
 * @param  ina219 Slave configuration structure of the IIC.
 * @param  i2c Pointer to a I2C_HandleTypeDef structure that contains
 *             the configuration information for the specified I2C.
 * @param  Address  Configuration data.
 * @return status.
 */
uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address)
{
  ina219->ina219_i2c = i2c;
  ina219->Address = Address;

  ina219_currentDivider_mA = 0;
  ina219_powerMultiplier_mW = 0;

  uint8_t ina219_isReady = HAL_I2C_IsDeviceReady(i2c, (Address << 1), 3, 2);

  if(ina219_isReady == HAL_OK)
  {

    INA219_Reset(ina219);
    INA219_SetCalibration_16V_8A(ina219);

    return 1;
  }

  else
  {
    return 0;
  }
}

2)頭文件


#ifndef INA219AIDCNR_HELPER_H
#define INA219AIDCNR_HELPER_H


#define INA219_ADDRESS 							        (0x40)
#define MAX_SHUNT_RANGE                     			(0x0FA0)

/* Register */
#define	INA219_REG_CONFIG						        (0x00)
#define	INA219_REG_SHUNT_VOLTAGE				    	(0x01)
#define	INA219_REG_BUS_VOLTAGE					    	(0x02)
#define	INA219_REG_POWER						        (0x03)
#define	INA219_REG_CURRENT						      	(0x04)
#define	INA219_REG_CALIBRATION					    	(0x05)
//
#define INA219_CONFIG_RESET 					      	(0x8000)
//
#define INA219_CONFIG_VOLTAGE_RANGE_16V					(0x0000)      // 0-16V Range
#define INA219_CONFIG_VOLTAGE_RANGE_32V					(0x2000)      // 0-32V Range

#define	INA219_CONFIG_GAIN_1_40MV				    	(0x0000)      // Gain 1, 40mV Range
#define	INA219_CONFIG_GAIN_2_80MV				    	(0x0800)      // Gain 2, 80mV Range
#define	NA219_CONFIG_GAIN_4_160MV				    	(0x1000)      // Gain 4, 160mV Range
#define	INA219_CONFIG_GAIN_8_320MV				  		(0x1800)      // Gain 8, 320mV Range

#define	INA219_CONFIG_BADCRES_9BIT				      	(0x0000)  // 9-bit bus res = 0..511
#define	INA219_CONFIG_BADCRES_10BIT				      	(0x0080)  // 10-bit bus res = 0..1023
#define	INA219_CONFIG_BADCRES_11BIT				      	(0x0100)  // 11-bit bus res = 0..2047
#define	INA219_CONFIG_BADCRES_12BIT				      	(0x0180)  // 12-bit bus res = 0..4097
#define	INA219_CONFIG_BADCRES_12BIT_2S_1060US 			(0x0480)  // 2 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_4S_2130US	  		(0x0500)  // 4 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_8S_4260US	  		(0x0580)  // 8 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_16S_8510US			(0x0600)  // 16 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_32S_17MS	  		(0x0680)  // 32 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_64S_34MS	  		(0x0700)  // 64 x 12-bit bus samples averaged together
#define	INA219_CONFIG_BADCRES_12BIT_128S_69MS	  		(0x0780)  // 128 x 12-bit bus samples averaged together

#define	INA219_CONFIG_SADCRES_9BIT_1S_84US		  		(0x0000)  // 1 x 9-bit shunt sample
#define	INA219_CONFIG_SADCRES_10BIT_1S_148US	  		(0x0008)  // 1 x 10-bit shunt sample
#define	INA219_CONFIG_SADCRES_11BIT_1S_276US	  		(0x0010)  // 1 x 11-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_1S_532US	  		(0x0018)  // 1 x 12-bit shunt sample
#define	INA219_CONFIG_SADCRES_12BIT_2S_1060US	  		(0x0048)  // 2 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_4S_2130US	  		(0x0050)  // 4 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_8S_4260US	 	 	(0x0058)  // 8 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_16S_8510US			(0x0060)  // 16 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_32S_17MS	  		(0x0068)  // 32 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_64S_34MS	  		(0x0070)  // 64 x 12-bit shunt samples averaged together
#define	INA219_CONFIG_SADCRES_12BIT_128S_69MS	  		(0x0078)  // 128 x 12-bit shunt samples averaged together

#define INA219_CONFIG_MODE_MASK					        0x07
#define	INA219_CONFIG_MODE_POWERDOWN			       	0x00
#define	INA219_CONFIG_MODE_SVOLT_TRIGGERED		   		0x01
#define	INA219_CONFIG_MODE_BVOLT_TRIGGERED		   		0x02
#define	INA219_CONFIG_MODE_SANDBVOLT_TRIGGERED	 		0x03
#define	INA219_CONFIG_MODE_ADCOFF				        0x04
#define	INA219_CONFIG_MODE_SVOLT_CONTINUOUS		   		0x05
#define	INA219_CONFIG_MODE_BVOLT_CONTINUOUS		   		0x06
#define	INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS  		0x07


typedef struct
{
  I2C_HandleTypeDef 	*ina219_i2c;
  uint8_t				Address;
} INA219_t;


uint8_t INA219_Init(INA219_t *ina219, I2C_HandleTypeDef *i2c, uint8_t Address);
uint16_t INA219_ReadBusVoltage(INA219_t *ina219);
uint16_t INA219_ReadCurrent_mA(INA219_t *ina219);
uint16_t INA219_ReadCurrent_raw(INA219_t *ina219);
uint16_t INA219_ReadShuntVoltage_mV(INA219_t *ina219);
uint16_t INA219_ReadDataForRegister_16Bits(INA219_t *ina219, uint8_t registerAddress);
uint16_t INA219_GetConfigInfo(INA219_t *ina219);

void INA219_Reset(INA219_t *ina219);
void INA219_SetCalibration(INA219_t *ina219, uint16_t calibrationData);
void INA219_SetConfig(INA219_t *ina219, uint16_t configData);
void INA219_SetCalibration_16V_8A(INA219_t *ina219);
void INA219_WriteDataToRegister_16Bits(INA219_t *ina219, uint8_t registerAddress, uint16_t Value);




#endif //INA219AIDCNR_HELPER_H

3) 測試代碼

int main(void)
{
  /* USER CODE BEGIN 1 */
  uint16_t vbus, vshunt, current;
  /* USER CODE END 1 */

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */

  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_USART1_UART_Init();
  MX_I2C2_Init();
  /* USER CODE BEGIN 2 */

  while(!INA219_Init(&ina219, &hi2c2, INA219_ADDRESS))
  {

  }
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
    vbus = INA219_ReadBusVoltage(&ina219);
    vshunt = INA219_ReadShuntVoltage_mV(&ina219);
    current = INA219_ReadCurrent_mA(&ina219);
    
    sprintf(strBuffer, "INA219 param: vbus:%d mV; current:%d mA\r\n", vbus, current);
    HAL_UART_Transmit(&huart1, strBuffer, strlen(strDataBuf), 0xff);

    UserDelay_ms(500);
  }

到了這里,關(guān)于【STM32 開發(fā)】| INA219采集電壓、電流值的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 【STM32】BLDC驅(qū)動&控制開發(fā)筆記 | 10_基于STM32F407+DRV8323的ADC電流采集

    【STM32】BLDC驅(qū)動&控制開發(fā)筆記 | 10_基于STM32F407+DRV8323的ADC電流采集

    在上一篇文章的基礎(chǔ)上繼續(xù)努力!?? ??【STM32】BLDC驅(qū)動控制開發(fā)筆記 | 09_基于STM32F407的ADC電壓采集,多通道ADC+DMA+USART_CSDN博客@F菌的進(jìn)階之路 在實(shí)現(xiàn)電機(jī)閉環(huán)控制的實(shí)驗(yàn)程序中,通過ADC功能來實(shí)現(xiàn)電壓或電流的采集十分重要。一般來說,為了獲得更高的精度,會在直接通過

    2024年04月17日
    瀏覽(33)
  • 基于STM32電壓檢測和電流檢測

    基于STM32電壓檢測和電流檢測

    CPU: STM32F103C8 屏幕: 0.96寸OLED屏幕(SPI接口) 電壓測量模塊: INA226(IIC接口) 點(diǎn)流測量模塊: ACS712(ADC采集) 1.可測量直流電壓0~36V,適用于低電壓電子電路中。 2.可測量直流電0~5A范圍內(nèi),目前采用的ACS712測量量程為5A,該模塊有多個(gè)量程,可測量到20A 3.實(shí)時(shí)功率監(jiān)測 4.電池電量監(jiān)測

    2024年02月02日
    瀏覽(22)
  • STM32采集電流互感器(電流互感器模塊)數(shù)據(jù)

    STM32采集電流互感器(電流互感器模塊)數(shù)據(jù)

    1. 電流互感器簡介 在發(fā)電、變電、輸電、配電和用電的線路中電流大小懸殊,從幾安到幾萬安都有。為便于測量、保護(hù)和控制需要轉(zhuǎn)換為比較統(tǒng)一的電流,另外線路上的電壓一般都比較高如直接測量是非常危險(xiǎn)的。電流互感器就起到電流變換和電氣隔離作用。 2. 電流互感器

    2024年02月12日
    瀏覽(27)
  • STM32F103C8T6 ADC輸入電流電壓特性

    STM32F103C8T6 ADC輸入電流電壓特性

    ADC 輸入電壓范圍:0-VDDA(0-3.3V) 輸入電流范圍:0-220μA 輸入電阻:50kΩ 采樣頻率:0.6-14MHz? ?官方STM32C103C8系列數(shù)據(jù)手冊: https://www.st.com/en/microcontrollers-microprocessors/stm32f103c8.html

    2024年02月13日
    瀏覽(25)
  • stm32_acs712電流采集計(jì)算思路

    stm32_acs712電流采集計(jì)算思路

    Acs712數(shù)據(jù)手冊地址 :https://item.szlcsc.com/45473.html 需要測量的參數(shù) 0 實(shí)際電流值 : ACS712_A 1 ?acs712供電電壓 : Vin ?? 2 ?ACS 輸出電壓 : 712_OUT_V 3 ?ACS 輸出電壓, 經(jīng)過分壓電阻后送到ADC引腳的電壓 : R_OUT_V 4 單片機(jī)12位ADC讀出的原始值 :adc_data 5 分壓低端電阻: R1??(10k?) 高端電阻 :R2? ?

    2024年01月20日
    瀏覽(20)
  • 運(yùn)放電路采集電流、電壓

    運(yùn)放電路采集電流、電壓

    當(dāng)我們利用單片機(jī)ADC采樣功能,采集電流電壓信號時(shí),單片機(jī)的IO口輸入 電壓范圍是0~3.3V ,所以為了保證安全,需要把測量電壓保持在這個(gè)范圍之內(nèi)。 設(shè)計(jì)目標(biāo): ? ? ? ? 采集電流范圍:0~1A ·? ? ? ?采集電壓范圍:0~15V ? ? ? ? 實(shí)物:基于STM32F103C8T6的電流電壓采樣,通過

    2024年02月09日
    瀏覽(24)
  • 基于STM32的單相可調(diào)逆變電源設(shè)計(jì)(能輸出穩(wěn)定的電壓電流,也可擴(kuò)展為三相輸出)

    基于STM32的單相可調(diào)逆變電源設(shè)計(jì)(能輸出穩(wěn)定的電壓電流,也可擴(kuò)展為三相輸出)

    本篇文章主要介紹的是我前段時(shí)間做的一個(gè)基于STM32H750VB為主控芯片的單相可調(diào)逆變電源,額定輸入為10V-80V,額定輸出電壓為220V,額定輸出電流為5A。做這個(gè)逆變電源的時(shí)候還是遇到了很多困難,首先是網(wǎng)上這方面的資料并不多,ACDC的資料不少,但是DCAC的資料少得可憐,在

    2024年02月14日
    瀏覽(94)
  • STM32筆記_10(ADC—電壓采集)

    STM32筆記_10(ADC—電壓采集)

    STM32f103 系列有 3 個(gè) ADC ,精度為 12 位 ,每個(gè) ADC 最多有 16 個(gè)外部通道 。其中 ADC1 和ADC2 都有 16 個(gè)外部通道, ADC3 根據(jù) CPU 引腳的不同通道數(shù)也不同,一般都有 8 個(gè)外部通道。 ????????ADC 輸入范圍為: VREF- ≤ VIN ≤ VREF+ 。由 VREF-、 VREF+ 、 VDDA 、 VSSA、這四個(gè)外部引腳決定

    2024年02月04日
    瀏覽(25)
  • STM32F103_ADC電壓采集

    STM32F103_ADC電壓采集

    ADC寄存器 STM32 的 ADC 是 12 位逐次逼近型的模擬數(shù)字轉(zhuǎn)換器。 它有 18 個(gè)通道,可測量 16 個(gè)外部和 2 個(gè)內(nèi)部信號源。各通道的 A/D 轉(zhuǎn)換可以單次、連續(xù)、掃描或間斷模式執(zhí)行。ADC 的結(jié)果可以左對齊或右對齊方式存儲在 16 位數(shù)據(jù)寄存器中。 模擬看門狗特性允許應(yīng)用程序檢測輸入

    2023年04月08日
    瀏覽(21)
  • 直流有刷驅(qū)動板電流電壓采集

    直流有刷驅(qū)動板電流電壓采集

    電流采集會涉及到電流環(huán)的使用。

    2024年02月16日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包