单片机设计的PWM控制器MCS-52兼容外文翻译资料

 2022-08-22 10:08

Design of PWM Controller in a MCS-52 Compatible MCU

Author :Yue-Li Hu, Wei Wang Microelectronic Research amp; Development Center

Campus P.O.B.221, 149 Yanchang Rd, Shanghai 200072, China

Abstract: In this paper,we will talk something about PWM technology . PWM technology is a kind of voltage regulation method by controlling the switch frequencyof DC power with fixed voltage to modify the two-end voltage of load. This technology can be used for a variety of applications including motor control, temperature control and pressure control and so on. This technique will be widely used in motor control.

Keywords: PWM technology;frequency;motor control

Introduction

PWM technology is a kind of voltage regulation method by controlling the switch frequency of DC power with fixed voltage to modify the two-end voltage of load. This technology can be used for a variety of applications including motor control, temperature control and pressure control and so on. In the motor control system shown as Fig. 1, through adjusting the duty cycle of power switch, the speed of motor can be controlled. As shown in Fig. 2, under the control of PWM signal, the average of voltage that controls the speed of motor changes with Duty-cycle ( D = t1/T in this Figure ), thus the motor speed can be increased when motor power turn on, decreased when power turn off.

Fig.1: The Relationship between Voltage of Armature and Fig.2 Architecture of PWM Module

Therefore, the motor speed can be controlled with regularly adjusting the time of turn-on and turn-off. There are three methods could achieve the adjustment of duty cycle: (1) Adjust frequency with fixed pulse-width. (2) Adjust both frequency and pulse-width. (3) Adjust pulse-width with fixed frequency.

Generally, there are four methods to generate the PWM signals as the following: (1) Generated by the device composed of separate logic components. This method is the original method which now has been discarded. (2) Generated by software. This method need CPU to continuously operate instructions to control I/O pins for generating PWM output signals, so that CPU can not do anything other. Therefore, the method also has been discarded gradually. (3) Generated by ASIC. The ASIC makes a decrease of CPU burden and steady work generally has several functions such as over-current protection, dead-time adjustment and so on. Then the method has been widely used in many kinds of occasion now. (4) Generated by PWM function module of MCU. Through embedding PWM function module in MCU and initializing the function, PWM pins of MCU can also automatically generate PWM out signals without CPU controlling only when need to change duty-cycle. It is the method that will be implemented in this paper.

In this paper, we propose a PWM module embedded in a 8052 microcontroller. The PWM module can support PWM pulse signals by initializing the control register and duty-cycle register with three methods just mentioned above to adjust the duty cycle and several operation modes to add flexibility for user.

The following section explains the architecture of the PWM module and the architectures of basic functional blocks. Section3 describes two operation modes. Experimental and simulation results verifying proper system operation are also shown in that section. Depending on mode of operation, the PWM module creates one or more pulse-width modulated signals, whose duty ratios can be independently adjusted.

Implementation of PWM module in MCU

Overview of the PWM module

A block diagram of PWM module is shown in Fig.3. It is clearly from the diagram that the whole module is composed of two sections: PWM signal generator and dead-time generator with channel select logic. The PWM function can be started by the user through implementing some instructions for initializing the PWM module. In particular, the following power and motion control applications are supported:

bull; DC Motor

bull; Uninterruptablel Power Supply (UPS)

·The PWM module also has the following features:

bull; Two PWM signal outputs with complementary or independent operation

bull; Hardware dead-time generators for complementary mode

bull; Duty cycle updates are configurable to be immediated or synchronized to the PWM

Fig.3 Architecture of PWM Module

Details of the architecture

PMW generator

The architecture of the 2-output PWM generator shown in Fig.4 is based on a 16-bit resolution counter which creates a pulse-width modulated signal. The system is synthesized by a system clock signal whose frequency can be divided by 4 times or 12 times through setting the value of T3M for PWM0 or T4M for PWM1 in the special register PWMCON as shown in Fig.4. To PWM0 generator, the clock to 16-bit counter will be pre-divided by 4 times by default when T3M is set to zero. And the clock will be divided by 12 times when T3M is set to 1. This is also true for PWM1. The other bits in PWMCON are explained in detail in Table 1.

Fig .4 Bit Mapping of PWMCON

Table 1: The Bit Definition in PWMCON

Channel-select logic

The follow Fig. 5 shows the channel-select logic which is useful in Complementary Mode. From this diagram, it is clear to know that signal CP and CPWM control the source of PWMH and PWML. And the details about the two control signals will be discussed in the section 3, and the architecture of dead-time generator will also be discussed in section 5 for the continuity of Complementary Mode.

Fig. 5 Diagram of Channel-select Logic

Operation Mode and Simulation Results

The design has two operation modes: Independent Mode and Complimentary Mode. By setting the corresponding bit CPWM in register PWMCON shown in Fig.6 user can select one of the two operation modes. When CPWM is set to zero, PWM module

剩余内容已隐藏,支付完成后下载完整资料


单片机设计的PWM控制器MCS-52兼容

摘要:在本文中,我们将讨论PWM技术。 PWM技术是一种通过控制具有固定电压的直流电源的开关频率来修改负载的两端电压的电压调节方法。 该技术可用于各种应用,包括电机控制,温度控制和压力控制等。 这种技术将广泛应用于电机控制。

关键词:PWM技术;频率;电机控制

介绍

PWM技术是一种通过控制具有固定电压的直流电源的开关频率来修改负载的两端电压的电压调节方法。 该技术可用于各种应用,包括电机控制,温度控制和压力控制等。 在图1所示的电动机控制系统中, 1,通过调节电源开关的占空比,可以控制电机的转速。 如图1所示。 如图2所示,在PWM信号的控制下,控制电机转速的电压平均值随占空比变化(图中D = t1 / T),因此电机转速可以在电机接通时减小, 电源关闭。

图1:电枢电压和电压之间的关系 图2 PWM模块的架构

因此,可以通过规律地调节接通和关断的时间来控制电动机速度。有三种方法可以实现占空比的调整:(1)用固定脉冲宽度调整频率。 (2)调整频率和脉冲宽度。 (3)用固定频率调整脉冲宽度。

一般来说,有四种方法来产生PWM信号如下:(1)由由单独的逻辑组件组成的装置产生。此方法是现在已被丢弃的原始方法。 (2)由软件生成。这种方法需要CPU连续操作指令来控制I / O引脚产生PWM输出信号,使CPU不能做任何其他操作。因此,该方法也逐渐被丢弃。 (3)由A​​SIC生成。 ASIC减少了CPU负担,稳定工作通常具有过流保护,死区时间调整等多项功能。然后该方法已经广泛应用于许多种场合。 (4)由MCU的PWM功能模块产生。通过在MCU中嵌入PWM功能模块和初始化功能,MCU的PWM引脚也可以自动生成PWM输出信号,无需CPU控制,只需要改变占空比。这是将在本文中实施的方法。

在本文中,我们提出了一个嵌入在8052微控制器中的PWM模块。 PWM模块可以通过用上述三种方法初始化控制寄存器和占空比寄存器来支持PWM脉冲信号,以调整占空比和几种操作模式,为用户增加灵活性。

以下部分介绍PWM模块的架构和基本功能块的架构。第3节描述两种操作模式。验证正确系统操作的实验和仿真结果也在该部分中示出。根据工作模式,PWM模块创建一个或多个脉冲宽度调制信号,其占空比可以独立调整。

在MCU中实现PWM模块

PWM模块概述

PWM模块的框图如图3所示。从图中可以清楚地看出,整个模块由两部分组成:PWM信号发生器和具有通道选择逻辑的死区时间发生器。 PWM功能可以由用户通过实现一些初始化PWM模块的指令来启动。特别是,支持以下功率和运动控制应用:

bull;直流电机

bull;不间断电源(UPS)

·PWM模块还具有以下特性:

bull;两个PWM信号输出,具有互补或独立操作

bull;用于互补模式的硬件死区时间发生器

bull;占空比更新可配置为立即或与PWM同步

图3 PWM模块的架构

体系结构的细节

PMW发电机

图4所示的2输出PWM发生器的架构基于产生脉冲宽度调制信号的16位分辨率计数器。 该系统由系统时钟信号合成,通过设置专用寄存器PWMCON中的PWM0的T3M或PWM1的T4M的值,可以将系统时钟信号的频率除以4倍或12倍,如图4所示。 对于PWM0发生器,当T3M设置为零时,默认情况下,16位计数器的时钟将被预分频4次。 当T3M设置为1时,时钟将被12分频。这对于PWM1也是如此。 PWMCON中的其他位在表1中详细说明。

图4 PWMCON的位映射

表1:PWMCON中的位定义

通道选择逻辑

下图。 图5示出了在互补模式中有用的通道选择逻辑。 从该图可以清楚地知道,信号CP和CPWM控制PWMH和PWML的源。 并且关于两个控制信号的细节将在第3部分中讨论,并且死区时间发生器的架构也将在第5部分中讨论互补模式的连续性。

图 5通道选择逻辑图

操作模式和仿真结果

该设计有两种操作模式:独立模式和免费模式。通过在图6所示的寄存器PWMCON中设置相应的CPWM位,用户可以选择两种工作模式之一。当CPWM设置为零时,PWM模块将工作在独立模式,而PWM模块将工作在互补模式。在下面的部分中,将分别详细说明两种操作模式,并且还将示出来自验证设计的Synoposys VCS EDA平台的PWM模块的模拟结果。

独立PWM输出模式

独立PWM输出模式可用于驱动如图6所示的负载。当PWMCON寄存器中的相应CP位设置为零时,特定PWM输出处于独立输出模式。在这种情况下,双通道PWM输出彼此独立。引脚PWM0 / PWMH上的信号来自PWM0发生器,引脚PWM1 / PWML上的信号来自PWM0发生器。分离的情况通过图1中所示的通道选择逻辑来实现。 6.在建议复位时,PWM I / O引脚默认设置为独立模式。在独立模式下禁止死区时间发生器。仿真结果如图6所示,如图6所示。Tr4和tr3分别为运行位到PWM0和PWM1。实际上,从该图,MCU的引脚P1 [5] / P1 [4]用于PWMH / PWML或正常I / O。

图6独立模式下PWM输出的波形.

互补PWM输出模式

互补输出模式用于驱动逆变器负载,类似于图7所示。该逆变器拓扑典型用于直流应用。 在互补输出模式下,该对PWM输出不能同时有效。 PWM通道和输出引脚对通过通道选择逻辑在内部配置,如图7所示。 在装置切换期间可以可选地插入死区时间,其中两个输出在短时间内无效。

图7:互补PWM输出的典型负载

通过设置PWMCON中的相应CPWM位,可为PWM I / O引脚对选择互补模式。在这种情况下,PSEL有效。当PSEL设置为零时,PWMH和PWML将来自PWM0发生器,而当PSEL设置为1时,当PWM1发生器的信号无效时,PWMH和PWML将来自PWM1发生器。在互补模式下产生PWM输出的过程中,将插入死区时间,将在下一节中讨论。

死区控制

当PWM I / O引脚对在互补输出模式下工作时,死区时间自动使能。因为功率输出装置不能瞬时切换,所以必须在互补对中的一个PWM输出的关断事件和另一个晶体管的导通事件之间提供一定量的时间。 2输出PWM模块具有一个8位寄存器的可编程死区时间。PWM模块的互补输出对有一个8位递减计数器,用于产生死区时间插入。如图8所示,死区时间单元具有连接到来自PWM发生器之一的PWM信号的上升和下降沿检测器。根据检测到的PWM边沿事件将死区时间装入定时器。根据边沿是上升沿还是下降沿,互补输出上的一个转换被延迟,直到定时器倒计时到零。图8a中示出了指示该对PWM输出的死区时间插入的时序图。

图8a死区单元框图

图8b是互补模式下PWM输出的波形

AT89S52是一款低功耗,高性能的8位8位微控制器,具有8K字节的系统内可编程闪存。该器件采用Atmel的高密度非易失性存储器技术制造,并与工业标准的80C51指令集和引脚排列兼容。片上闪存允许程序存储器在系统中或由常规非易失性存储器程序编程器重新编程。通过在单片芯片上结合多功能8位CPU和在系统可编程闪存,Atmel AT89S52是一个强大的微控制器,为许多嵌入式控制应用提供了高度灵活和成本效益的解决方案.AT89S52提供以下标准功能:8K字节闪存,256字节RAM,32个I / O线,看门狗定时器,两个数据指针,三个16位定时器/计数器,六向量两级中断架构,全双工串行端口,芯片振荡器和时钟电路。此外,AT89S52设计有静态逻辑,用于低至零频率的操作,并支持两种软件可选的省电模式。空闲模式停止CPU,同时允许RAM,定时器/计数器,串行端口和中断系统继续工作。掉电模式保存RAM内存,但冻结振荡器,禁止所有其他芯片功能,直到下一个中断或硬件复位。

引脚说明

VCC:电源电压。

GND:接地。

端口0:端口0是8位开漏双向I / O端口。作为输出端口,每个引脚可以吸收8个TTL输入。当1写入端口0引脚时,引脚可用作高阻抗输入。端口0也可以配置为在访问外部程序和数据存储器时被复用的低阶地址/数据总线。在此模式下,P0具有内部上拉电阻。端口0还在闪存编程期间接收代码字节,并在编程验证期间输出代码字节。在程序验证期间需要外部上拉。

端口1:端口1是具有内部上拉的8位双向I / O端口。端口1输出缓冲器可以吸收/源4个TTL输入。当1被写入端口1引脚时,它们被内部上拉拉高,并可用作输入。作为输入,外部被拉低的端口1引脚将由于内部上拉而产生电流(IIL)。此外,P1.0和P1.1可分别配置为定时器/计数器2的外部计数输入(P1.0 / T2)和定时器/计数器2的触发输入(P1.1 / T2EX),如图所示。在闪存编程和验证期间,端口1还接收低位地址字节。

表1 P1端口的第二个功能

Port Pin

Alternate Functions

P1.0

T2 (external count input to Timer/Counter 2), clock-out

P1.1

T2EX (Timer/Counter 2 capture/reload trigger and direction control)

P1.5

MOSI (used for In-System Programming)

P1.6

MISO (used for In-System Programming)

P1.7

SCK (used for In-System Programming)

端口2:端口2是具有内部上拉的8位双向I / O端口。端口2输出缓冲器可以吸收/源4个TTL输入。当1写入端口2引脚时,它们由内部上拉拉高,并可用作输入。作为输入,外部被拉低的端口2引脚将由于内部上拉而产生电流(IIL)。端口2在从外部程序存储器获取期间以及在使用16位地址(MOVX @ DPTR)访问外部数据存储器期间发出高位地址字节。在本应用中,端口2在发出1s时使用强内部上拉电阻。在访问使用8位地址(MOVX @ RI)的外部数据存储器时,端口2发出P2特殊功能寄存器的内容。端口2还在Flash编程和验证期间接收高阶地址位和一些控制信号。

端口3:端口3是具有内部上拉的8位双向I / O端口。端口3输出缓冲器可以吸收/源4个TTL输入。当1被写入端口3引脚时,它们被内部上拉拉高,并可用作输入。作为输入,外部被拉低的端口3引脚将由于上拉电流而产生电流(IIL)。端口3接收一些控制信号,用于闪存编程和验证。端口3还具有AT89S52各种特殊功能的功能,如下表2所示。

表2 P3端口的第二个功能

Port Pin

Alternate Functions

P3.0

RXD (serial input port)

P3.1

TXD (serial output port)

P3.2

(external interrupt 0)

P3.3

(external interrupt 1)

P3.4

T0 (timer 0 external input)

P

剩余内容已隐藏,支付完成后下载完整资料


资料编号:[479882],资料为PDF文档或Word文档,PDF文档可免费转换为Word

原文和译文剩余内容已隐藏,您需要先支付 30元 才能查看原文和译文全部内容!立即支付

以上是毕业论文外文翻译,课题毕业论文、任务书、文献综述、开题报告、程序设计、图纸设计等资料可联系客服协助查找。