【STM32 开发】| INA219采集电压、电流值

目录

  • 前言
  • 1 原理图
  • 2 IIC地址说明
  • 3 寄存器地址说明
  • 4 开始工作前配置
  • 5 程序代码
    • 1)驱动程序
    • 2)头文件
    • 3) 测试代码

前言

INA219 是一款具备 I2C 或 SMBUS 兼容接口的分流器和功率监测计。该器件监测分流器电压降和总线电源电压,转换次数和滤波选项可通过编程设定。可编程校准值与内部乘法器相结合,支持直接读取电流值(单位:安培)。通过附加乘法寄存器可计算功率(单位:瓦)。I2C 或 SMBUS 兼容接口 具有 16 个可编程地址。

INA219 可在 0V 至 26V 范围内感测总线中的分压。该器件由 3V 至 5.5V 单电源供电,电源的最大流耗为1mA。INA219 的工作温度范围为 -40°C 至 125°C。

1 原理图

在这里插入图片描述

2 IIC地址说明

在这里插入图片描述
此测试时A0、A1都下拉接地,所以INA219的IIC通信地址为1000000B

3 寄存器地址说明

在这里插入图片描述

  • 0x00 配置寄存器,用来配置工作模式、采集范围以及其他参数
  • 0x01 分流电阻两端的电压
  • 0x02 总线电压(IN-到GND的电压差)
  • 0x03 功率
  • 0x04 经过分流电阻两端的电流
  • 0x05 校准寄存器,用于对测量结果进行校准

4 开始工作前配置

  • 0x00 寄存器Bit 13:设置检测最大检测电压 0 = 16V,1 = 32V (此处项目需要测3V到5V的电压,故设置Bit 13 为 0
  • 0x00 寄存器Bit 11-12:设置总线分流电阻最大的电压(此处项目需要测0A到5A的电流,故设置Bit 11-12 为 01,即量程±80mV,可测电流±8A
  • 0x00 寄存器Bit 0-2:设置工作模式(默认)
  • 0x05 寄存器:设置基准值(根据需要测的电压、电流范围再套入公式得出结果

由以下公式可得出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

数据手册说明文档
在这里插入图片描述

5 程序代码

1)驱动程序

#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);
  }

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/123823.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

算法打卡01——求两数之和

题目&#xff1a; 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标值 target 的那 两个 整数&#xff0c;并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是&#xff0c;数组中同一个元素在答案里不能重复出现。 你…

Python进行数据可视化,探索和发现数据中的模式和趋势。

文章目录 前言第一步&#xff1a;导入必要的库第二步&#xff1a;加载数据第三步&#xff1a;创建基本图表第四步&#xff1a;添加更多细节第五步&#xff1a;使用Seaborn库创建更复杂的图表关于Python技术储备一、Python所有方向的学习路线二、Python基础学习视频三、精品Pyth…

2023年度API安全状况详解

随着云计算和移动应用的快速发展&#xff0c;API&#xff08;应用程序接口&#xff09;已成为不可或缺的技术组成部分。然而&#xff0c;API的广泛使用也带来了安全风险。本文将探讨2023年的API安全状况&#xff0c;并介绍了一些应对这些安全挑战的最佳实践。 引言 随着全球互联…

【Leetcode】【每日一题】【简单】2609. 最长平衡子字符串

力扣&#xff08;LeetCode&#xff09;官网 - 全球极客挚爱的技术成长平台备战技术面试&#xff1f;力扣提供海量技术面试资源&#xff0c;帮助你高效提升编程技能&#xff0c;轻松拿下世界 IT 名企 Dream Offer。https://leetcode.cn/problems/find-the-longest-balanced-subs…

在linux安装单机版hadoop-3.3.6

一、下载hadoop https://mirrors.tuna.tsinghua.edu.cn/apache/hadoop/core/hadoop-3.3.6/ 二、配置环境变量 1、配置java环境变量 2、配置hadoop环境变量 export HADOOP_HOME/usr/local/bigdata/hadoop-3.3.6 export HBASE_HOME/usr/local/bigdata/hbase-2.5.6 export JA…

C# 继承,抽象,接口,泛型约束,扩展方法

文章目录 前言模拟需求场景模拟重复性高的需求初始类结构继承优化抽象类 需求1&#xff1a;打印CreateTime方法1&#xff1a;使用重载方法2&#xff1a;基类函数方法3&#xff1a;泛型约束方法3.1&#xff1a;普通泛型方法方法3.2&#xff1a;高级泛型约束&#xff0c;扩展方法…

阿里云双11大促,WoSign SSL国密RSA双证书首购4折优惠

阿里云2023双11“金秋云创季”活动盛大开启&#xff01;2023年11月01日至11月31日&#xff0c;阿里云平台WoSign SSL证书“国密/RSA 双证书解决方案”首购4折优惠&#xff01;惊喜折扣、限时福利&#xff0c;机会不容错过&#xff01; 作为阿里云一年一度最盛大的优惠促销活动&…

RAID卡管理工具使用

RAID 基本概念 由于现代数据中心业务量的与日俱增&#xff0c;单台服务器上需要运行的数据也日益增多。当 单个物理磁盘在容量和安全性上不足以支持系统业务时&#xff0c;就需要将多个磁盘以某种特 定方式组合起来&#xff0c;对外作为一个可见的磁盘来使用&#xff0c;才可…

计算机毕业设计 基于Web的视频及游戏管理平台的设计与实现 Java实战项目 附源码+文档+视频讲解

博主介绍&#xff1a;✌从事软件开发10年之余&#xff0c;专注于Java技术领域、Python人工智能及数据挖掘、小程序项目开发和Android项目开发等。CSDN、掘金、华为云、InfoQ、阿里云等平台优质作者✌ &#x1f345;文末获取源码联系&#x1f345; &#x1f447;&#x1f3fb; 精…

oracle数据导出exp导入imp

Oracle的exp/imp命令用于实现对数据库的导出/导入操作&#xff1b; exp命令用于把数据从远程数据库服务器导出至本地&#xff0c;生成dmp文件&#xff1b; imp命令用于把本地的数据库dmp文件从本地导入到远程的Oracle数据库。 一、获取帮助信息 exp/imp helpy 二、数据导出 1…

3d max软件中的缓存垃圾该如何清理?

使用3d max建模到渲染操作&#xff0c;来回对效果图调整的次数过多时&#xff0c;就会出现一下看不到的垃圾缓存&#xff0c;影响保存的速度&#xff0c;影响效率&#xff01; 对于这类的3d垃圾清理的有什么高效方法呢&#xff1f; 3dmax垃圾清理的常规操作如下&#xff1a; 1、…

AD9371 官方例程 NO-OS 主函数 headless 梳理(二)

AD9371 系列快速入口 AD9371ZCU102 移植到 ZCU106 &#xff1a; AD9371 官方例程构建及单音信号收发 ad9371_tx_jesd -->util_ad9371_xcvr接口映射&#xff1a; AD9371 官方例程之 tx_jesd 与 xcvr接口映射 AD9371 官方例程 时钟间的关系与生成 &#xff1a; AD9371 官方…

windows11使用docker部署安装minio

时间 2023-11-08 windows11使用docker部署安装minio 目录 1.docker 下载镜像2.docker安装镜像3.访问控制台4.安装问题解决5.使用教程 1.docker 下载镜像 调整镜像源到国内&#xff0c;否则会很慢 docker pull minio/minio2.docker安装镜像 设置用户名和密码时需要注意&…

开源:特殊的垄断

免责声明&#xff1a;本博客旨在分享我对开源策略的理解和体会&#xff0c;不代表任何组织或机构的立场或观点&#xff0c;也不构成任何商业或投资的建议或担保。本博客的内容可能存在错误或遗漏&#xff0c;也可能随着时间的推移而变得过时或不适用。请在使用或依赖本博客的内…

MySQL的表格去重,史上最简便的算法,一看就会

首先&#xff0c;表格my_tab02存在很多重复的数据&#xff1a; #表格的去重 方法一&#xff1a; 详细内容传送门&#xff1a;表格的去重 -- 思路&#xff1a; -- 1.先创建一张临时表 my_tmp,该表的结构和my_tab02一样 -- 2.把my_tmp的记录通过distinct关键字 处理后 把记录复…

基于单片机GP2D12测距-proteus仿真-源程序

基于51单片机红外测距-proteus仿真-源程序 一、系统方案 本设计采用51单片机作为主控器&#xff0c;液晶1602显示&#xff0c;GP2D12采集距离值&#xff0c;按键设置报警阀值&#xff0c;测量值超过阀值&#xff0c;蜂鸣器报警。 二、硬件设计 原理图如下&#xff1a; 三、单…

flutter笔记:骨架化加载器

flutter笔记 骨架化加载器 - 文章信息 - Author: Jack Lee (jcLee95) Visit me at: https://jclee95.blog.csdn.netEmail: 291148484163.com. Shenzhen ChinaAddress of this article:https://blog.csdn.net/qq_28550263/article/details/134224135 【介绍】&#xff1a;本文介…

21 移动网络的前世今生

1、移动网络的发展历程 发展过程就是&#xff1a;2G,3G,4G,5G的过程&#xff0c;用2G看txt&#xff0c;用3G看jpg&#xff0c;用4G看avi。 2、2G网络 手机本来是用来打电话的&#xff0c;不是用来上网的&#xff0c;所以原来在2G时代&#xff0c;上网使用的不是IP网络&#…

「Verilog学习笔记」多功能数据处理器

专栏前言 本专栏的内容主要是记录本人学习Verilog过程中的一些知识点&#xff0c;刷题网站用的是牛客网 分析 注意题目要求输入信号为有符号数&#xff0c;另外输出信号可能是输入信号的和&#xff0c;所以需要拓展一位&#xff0c;防止溢出。 timescale 1ns/1ns module data_…