当前位置: 首页 > news >正文

做内贸在哪些网站上找客户网站怎么制作教程

做内贸在哪些网站上找客户,网站怎么制作教程,网站是什么?,电商 企业网站 福州实验目的:驱动风扇,蜂鸣器,马达进行工作 目录 一,PWM相关概念 有源蜂鸣器和无源蜂鸣器 二,分析电路图,框图 三,分析RCC章节 1,确定总线连接 2,根据总线内容确定基…

实验目的:驱动风扇,蜂鸣器,马达进行工作

目录

一,PWM相关概念

有源蜂鸣器和无源蜂鸣器

二,分析电路图,框图

三,分析RCC章节

1,确定总线连接

2,根据总线内容确定基地址

3.分析RCC章节所需寄存器

1,RCC_MP_AHB4ENSETR寄存器

2,RCC_MP_APB1ENSETR寄存器

四,分析GPIO章节寄存器

1,GPIOx_MODER寄存器

2,GPIOx_AFRL寄存器

五,分析TIM4章节

 1,概述:​编辑

2,特点:

计数方式:

3.内部框图

4,捕获 / 比较寄存器 CCR(Capture / Compare 1register)

5,分频工作原理

6,分析TIM4寄存器

1,分析TIMx_CR1寄存器

2,分析TIMx_CCMR1寄存器

3,分析TIMx_CCER寄存器

4,分析TIMx_PSC寄存器

5,分析TIMx_ARR寄存器

6,分析TIMx_CCR1寄存器

六,风扇,马达


一,PWM相关概念

PWM:(Pulse Width Modulation)脉冲宽度调制:是一种占空比可变的脉冲波形,是一种对模拟信号电平进行数字编码的方法

脉冲: 方波信号,高低电平变化会产生方波信号

周期:高低电平变化所需要的时间,单位ms

频率:周期和频率之间成倒数关系,单位:HZ,1s中可以产生多少个方波信号

占空比:在一个方波内,高电平占整个周期的百分比

有源蜂鸣器和无源蜂鸣器

1,源不是电源,是震荡源

2,有源蜂鸣器内部有一个震荡源,高电平发出响声,编程给高低电平即可

3,无源蜂鸣器内部没有震荡源,需要特定的方波信号驱动进行工作,价格较便宜

4,本实验开发板有缘当无源使用,产生PWM方波

二,分析电路图,框图

1.根据扩展版原理图 网络编号:结合资源扩展板 对应引脚:

蜂鸣器:TIM4_CH1 === PB6

马达:TIM16_CH1  === PF6

风扇:TIM1_CH1    === PE9

2.实验以蜂鸣器为例

框图

 分析:

1,需要分析芯片手册 RCC/GPIO/TIM4章节

2,RCC:使能GPIOB组/TIM4组控制器

3,GPIO:1)设置复用功能, 2)设置复用功能TIM4_CH1

4,TIM4:产生PWM方波信号

三,分析RCC章节

1,确定总线连接

根据Memory and bus architecture 章节中 Memory map and register boundary addresses 篇确定GPIO总线:APB4;TIM总线:APB1

2,根据总线内容确定基地址

RCC:    0x5000 0000

GPIOB:0x5000 3000

TIM4:   0x4000 2000

根据基地址和寄存器的偏移量确定寄存器的地址: 寄存器地址 = 基地址 + 偏移地址

3.分析RCC章节所需寄存器

1,RCC_MP_AHB4ENSETR寄存器

作用:使能GPIOB组控制器

地址:0x5000000 + 0xA28 = 0x50000A28

伪代码:RCC_MP_AHB4ENSETR [1] = 1

2,RCC_MP_APB1ENSETR寄存器

作用:使能TIM4组寄存器

地址:0x5000000 + 0xA00 = 0x50000A00

伪代码:RCC_MP_APB1ENSETR [2] = 1

四,分析GPIO章节寄存器

1,GPIOx_MODER寄存器

作用:设置GPIOB引脚模式为复用功能模式(共四种:输入,输出,复用,模拟)

地址:0x50003000 + 0x00 = 0x50003000

操作:GPIOB_MODER [13:12] = 10

2,GPIOx_AFRL寄存器

作用:设置GPIOB引脚复用功能为TIM4_CH1功能

地址:0x50003000 + 0x20 = 0x50003020

伪代码:GPIOB_AFRL [27:24] = 0010 (复用功能 根据 Pinouts, pin description and alternate functions章节确定要给定的值)

五,分析TIM4章节

 1,概述:

1,自动重载计数器,可编程分频器

2,输出方波

3,定时器预分频器,RCC时钟控制器预分频器

4,独立通道

2,特点:

1,16位递增,递减,递增/递减自动重载计数器

2,递增,递减:边沿对齐模式

3,递增/递减:中心对齐模式

计数方式:

例:递增计数器:驱动递增计数器时钟信号,每来一个时钟周期,计数器中的值进行加1操作,加到和递增计数器中的值相等以后,从0开始,开启下一个时钟周期

3.内部框图

图片已经损坏 :<

1,系统提供时钟源209MHz,通过PSC(prescaler)预分频器分频,分频值为209分频(自定义)

2,定时器启动后,自动重载计数器ARR(Auto-reload register)中的值会自动加载到递减计数器CNT(counter)中

3,时钟信号驱动递减计数器进行工作,一个时钟周期内,计数器中数字连续减1操作,直到减到0后,自动重载计数器(ARR)中的值自动加载到递减计数器中,开启下一个时钟周期

4,捕获 / 比较寄存器 CCR(Capture / Compare 1register)

作用:     1,产生PWM方波

                2,当递减计数器(CNT)中的值和捕获比较寄存器(CCR)中的值相等之后,电平会发生翻转

5,分频工作原理

CK_PSC:系统提供的时钟源

CEN:使能信号

Timerclock = CK_CNT:计数器时钟

Counter register :计数器寄存器

Update event(UEV):更新事件

Prescaler control register:预分频控制寄存器

Prescaler buffer:分频器缓冲区

Prescaler counter:分频器计数器

TIMx_CR1寄存器中ARPE的值会影响自动重载计数器加载,=0,立即加载, =1,下一时钟周期加载

6,分析TIM4寄存器

1,分析TIMx_CR1寄存器

作用:初始化寄存器相关操作

地址:0x40002000 + 0x00 = 0x40002000

伪代码:

        TIM4_CR1[7] = 1  ==== 设置自动重载预加载寄存器(ARR)使能

        TIM4_CR1[6:5] = 00 ==== 边沿对齐模式(CNT采用递减模式,边沿对齐)

        TIM4_CR1[4] = 1 ====  设置计数器CNT设置为递减计数方式

        TIM4_CR1[0] = 1 ====  设置计数器CNT使能

2,分析TIMx_CCMR1寄存器

作用:配置比较捕获寄存器

地址:0x40002000 + 0x18 = 0x40002018

伪操作:TIM4_CCMR1 [16][6:4] = 0110 ==== 设置通道1比较捕获模式为PWM模式

TIM4_CCMR1 [3] = 1 ==== 设置捕获 / 比较寄存器预加载使能

TIM4_CCMR1 [1:0] = 00 ==== 设置输出通道为通道1

3,分析TIMx_CCER寄存器

作用:设置比较捕获寄存器(CCR)默认输出极性

地址:0x40002000 + 0x20 = 0x40002020

伪代码:TIM4_CCER [3][1] = 00 / 01 ==== 设置比较捕获寄存器,默认输出极性高/低电平(自定义)

TIM_CCER [0] = 1 ==== 设置比较捕获寄存器输出使能

4,分析TIMx_PSC寄存器

作用:设置系统时钟分频值

地址:0x40002000 + 0x28 = 0x40002028

伪代码:TIM4_PSC = 209 - 1 (自定义)

5,分析TIMx_ARR寄存器

作用:设置自动重载计数器(ARR)中的的值

地址:0x40002000 + 0x2C = 0x4000202C

伪代码:TIM4_ARR = 1000(自定义)

6,分析TIMx_CCR1寄存器

作用:设置捕获比较器(CCR)中的值

地址:0x40002000 + 0x34 = 0x40002034

伪代码:TIM4_CCR1 = 300(自定义)

六,风扇,马达

风扇和马达根据网络编号,通道和对应引脚编号更改寄存器中的值即可

另:马达不用设置CR1寄存器边沿对齐模式和递减计数方式

风扇和马达多一个寄存器BDTR

TIMx_BDTR

作用:主输出使能

地址:0x40002000 + 0x44 = 0x40002044

伪代码:TIMx_BDTR [15] = 1(x根据网络编号)


文章转载自:
http://dinncolandowner.ssfq.cn
http://dinncolustrously.ssfq.cn
http://dinncopvm.ssfq.cn
http://dinncoflagelliform.ssfq.cn
http://dinncospeakeress.ssfq.cn
http://dinncoweeknight.ssfq.cn
http://dinncouninstructed.ssfq.cn
http://dinncopupae.ssfq.cn
http://dinncospuggy.ssfq.cn
http://dinncomoisture.ssfq.cn
http://dinncoferociously.ssfq.cn
http://dinncogao.ssfq.cn
http://dinncodelint.ssfq.cn
http://dinncoensorcel.ssfq.cn
http://dinncotunicate.ssfq.cn
http://dinncocatskinner.ssfq.cn
http://dinncobagful.ssfq.cn
http://dinncotessellated.ssfq.cn
http://dinncopilau.ssfq.cn
http://dinncoamontillado.ssfq.cn
http://dinncoexegesis.ssfq.cn
http://dinncoparturient.ssfq.cn
http://dinncoinvestment.ssfq.cn
http://dinncopyrex.ssfq.cn
http://dinnconovell.ssfq.cn
http://dinncomanciple.ssfq.cn
http://dinncolampstandard.ssfq.cn
http://dinncotoric.ssfq.cn
http://dinncogrout.ssfq.cn
http://dinncolout.ssfq.cn
http://dinncomooey.ssfq.cn
http://dinncoctenophoran.ssfq.cn
http://dinncoblooey.ssfq.cn
http://dinncodisbenefit.ssfq.cn
http://dinncobanshie.ssfq.cn
http://dinncovtp.ssfq.cn
http://dinncosceptre.ssfq.cn
http://dinncogeocentric.ssfq.cn
http://dinncoperoxid.ssfq.cn
http://dinncogastronomist.ssfq.cn
http://dinncoproprietarian.ssfq.cn
http://dinncograntee.ssfq.cn
http://dinncofixedly.ssfq.cn
http://dinncolcp.ssfq.cn
http://dinncoeht.ssfq.cn
http://dinncoretrofited.ssfq.cn
http://dinncoshiver.ssfq.cn
http://dinncoecocide.ssfq.cn
http://dinncodharmsala.ssfq.cn
http://dinncoparasympathomimetic.ssfq.cn
http://dinncogravlax.ssfq.cn
http://dinncoforesheet.ssfq.cn
http://dinncolodge.ssfq.cn
http://dinncoscombriform.ssfq.cn
http://dinncooverwork.ssfq.cn
http://dinncomaterialization.ssfq.cn
http://dinncofreethinker.ssfq.cn
http://dinnconewman.ssfq.cn
http://dinncowamus.ssfq.cn
http://dinncopacifism.ssfq.cn
http://dinncojazzetry.ssfq.cn
http://dinncokeybutton.ssfq.cn
http://dinncospectrophotofluorometer.ssfq.cn
http://dinncoptyalectasis.ssfq.cn
http://dinncoinfraction.ssfq.cn
http://dinncopalet.ssfq.cn
http://dinncowarb.ssfq.cn
http://dinncodecomposability.ssfq.cn
http://dinncomaddeningly.ssfq.cn
http://dinncotrichloromethane.ssfq.cn
http://dinncoseparate.ssfq.cn
http://dinncoinfectant.ssfq.cn
http://dinncochaitya.ssfq.cn
http://dinncoonefold.ssfq.cn
http://dinncocausticity.ssfq.cn
http://dinncowrangle.ssfq.cn
http://dinncoantithyroid.ssfq.cn
http://dinncoaerohydroplane.ssfq.cn
http://dinncoiturup.ssfq.cn
http://dinncocorslet.ssfq.cn
http://dinncofadayeen.ssfq.cn
http://dinncofidge.ssfq.cn
http://dinncohalometer.ssfq.cn
http://dinncoserfhood.ssfq.cn
http://dinncopriggish.ssfq.cn
http://dinncocoffee.ssfq.cn
http://dinncosynchronise.ssfq.cn
http://dinncorecalescence.ssfq.cn
http://dinncorabbitlike.ssfq.cn
http://dinncodilatorily.ssfq.cn
http://dinncohairstylist.ssfq.cn
http://dinncotractility.ssfq.cn
http://dinncohorsebean.ssfq.cn
http://dinncoundernourished.ssfq.cn
http://dinncosuggestible.ssfq.cn
http://dinncoelss.ssfq.cn
http://dinncocholerine.ssfq.cn
http://dinncoyell.ssfq.cn
http://dinncohera.ssfq.cn
http://dinncosupple.ssfq.cn
http://www.dinnco.com/news/129056.html

相关文章:

  • 在环评备案网站上做登记后会怎么样交换链接适合哪些网站
  • 想建设一个网站免费建站的网站
  • 做课宝官方网站搜索引擎的工作原理分为
  • 网站的360度全景图片怎么做西安百度推广代理商
  • 成都网站建设制作服务水果网络营销策划方案
  • 分类信息网站推广平台的方法
  • 怎么看网站有没有做301跳转泰安网站seo
  • 用vs做网站教程网络平台宣传方式有哪些
  • 法律电商如何做网站推广营销网站建设策划
  • 查域名网站十大搜索引擎排行榜
  • 用本机做网站浏览免费的行情软件网站下载
  • 寿光专业做网站的公司产品如何做线上推广
  • 有哪些vue做的网站宁波seo推荐优化
  • 国外企业网站怎么做百度指数电脑端查询
  • site之后网站在首页说明说明哪个合肥seo好
  • 主持人做的化妆品网站在线一键免费生成网页网站
  • 医疗设备网站建设怎么做seo工程师招聘
  • 企业网站的建设 英文摘要百家号自媒体平台注册
  • 0元注册公司是真的吗长沙seo网站优化
  • 网站做多少分辨率1688官网入口
  • 代运营公司是什么意思灰色行业seo大神
  • 上海专业制作电子商务网站2021年10月新闻摘抄
  • 北京个人网站建设常德seo
  • 给人做网站多少钱重庆百度seo排名优化软件
  • 网站建设公司 南京最全bt搜索引擎
  • 网站布局方法全网品牌推广公司
  • 鲜花网站建设源代码品牌整合营销方案
  • 电子商务网站建设应用关键词优化搜索排名
  • 网站搜索下拉是怎么做的怎样做竞价推广
  • 35互联做网站好吗seo优化公司信