聪明文档网

聪明文档网

最新最全的文档下载
当前位置: 首页> 毕业设计英语文献翻译--基于PIC单片机的电子控制实验箱的设计与实现

毕业设计英语文献翻译--基于PIC单片机的电子控制实验箱的设计与实现

时间:2018-08-26 00:49:56    下载该word文档

南昌航空大学信息工程学院

毕业设计英语文献翻译

摘自 http://www.scirp.org/journal/PaperInformation.aspx?PaperID=22046

自动化

090441

09044137

指导老师 李军华

2013 3 15


Design and Implementation of Electronic Control Trainer

with PIC Microcontroller

Yousif I. Al Mashhadany

Electrical Engineering Department, Engineering College, University of Anbar, Baghdad, Iraq

Email: yousif_phd@hotmail.com

Received April 26, 2012; revised May 23, 2012; accepted May 30, 2012

ABSTRACT

This paper describes the implementation of a PIC microcontroller in a conventional laboratory-type electronic trainer. The work comprises software for the PIC and hardware for the software. The PIC controller uses an EasyPIC-6 board and includes a PC-interfaced programmer for the PIC chip. It has many external modules: 128 × 64 graphic LCD dis- play, 2 × 16 LCD display, 4 × 4 keypad, and port expander, all in the same bench. The trainer is capable of 36 experiments in logic/analogue electronic and control systems. A 5-sided approximate sensor, two photoelectric sensors (BR56-DDT-P and BEN9M-TFR),four CMOS,four BCD-7-segment driven by CD4511B, two relays (2-pole and 3-pole), six voltages, ammeter measurement, DC motor, and 24VDC power supply, connect through connectors and pinions. Results of all the experiments show the trainer satisfying requirements of undergraduate and postgraduate pro- jects involving conventional electronic and classical control systems.

Keywords: PIC Microcontroller; Photoelectric Sensor; Conventional Electronic Trainer

1. Introduction

Modern microcontroller chips can store hundreds of thou- sands of transistors each. The first microprocessors had external peripherals such as memory, input-output lines, and timers (Matic, 2003). In time came a new device called integrated circuit (IC), which contains both processor and peripherals. Also called a microcontroller, this was the first chip with a microcomputer [1,2].

Peripheral Interface Controller (PIC) is new to electronics control. Providing complete control in a single chip, a PIC microcontroller has special function registers, power on reset, interrupts, user RAM for storing of program data, EPROM program memory, timer circuits, instruction set, low power consumption, and on-board A- to-D converters. It replaces conventional control of in- dustrial machinery (e.g., motor-speed control) [2,3].

Microcontroller and microprocessor differ in many ways. In functionality, a microprocessor needs external components for receiving/sending data, and memory. A microcontroller does not need external components be- cause all the necessary peripherals are built-in, saving time and space (see Figure 1 for microcontroller set [4- 7]).

The EasyPIC-6 by MikroElektronika (see Figure 2) is an extraordinary development tool for programming and experimenting with PIC ® microcontrollers. It supports over 160 MCUs in PIC10, PIC12, PIC16, and PIC18 families, in DIP packages from 8 to 40 pins. The board comes installed with PIC16F887. An impressive array of peripherals and expansion connectors are available on- board, as are optional LCD displays and temperature sensor [8,9].

An on-board programmer and mikroICD debugger allow direct connection to PC via USB cable. Fully functional demo versions of MikroElektronikas C, Pascal, and BASIC compilers are included (hex output limited to 2K program words), complete with documentation and dozens of sample programs. The EasyPIC-6 also includes an external ICD connector compatibl with MPLAB ICD2 and ICD3, allowing full compatibility with MPL- AB Integrated Development Environment (IDE) [10,11].

Its main problem is lack of facility for external experiments to be implemented in many undergraduate laboratory applications; it is also daunting to beginner designers. This paper presents a practical implementation of EasyPIC-6-based electronic control trainer able to execute about 36 experiments, and rearrangement of the EasyPIC-6 power supply to extend the trainers capability to AC-DC-current applications.

Figure 1. Microcontroller set [7].

Figure 2. EasyPIC-6 cart by MikroElektronika [11].

1.1. Integrated Development Environment (IDE)

The core development tool set operates under the IDE umbrella called MPLAB. The tools look and feel the same,so learning of new tool interface is minimized.These are the development capabilities of the MPLAB IDE:

Source-code editing;

Project management;

Machine-code generation (from assembly or C);

Device simulation;

Device emulation;

Device programming.

The comprehensive tool suite allows complete project development without leaving the MPLAB environment [12]. The MPLAB IDE software eases software develop- ment as never before in 8-bit microcontroller. MPLAB is a Windows application that contains:

o A full-features editor;

o Three operating modes:

Editor

Emulator

Simulator

o A project manager;

o Extensive online help;

MPLAB allows

o Editing of source files (ASM and C files);

o One-touch assembly (or compiling) and download to

PIC16/17 tools;

o Debugging via:

Source files

Absolute listing file

Program memory

o Run-up to four emulators on the same PC;

o Run or single-step;

Program memory

Source file

Absolute listing

The microchip simulator, MPLAB-SIM, operates under the same platform as the PICMASTER emulator, so the user need only learn a single tool set that functions equally in both the simulator and the full-features emulator [13].

1.2. MPLAB-SIM Simulator Software

The software simulator is a no-cost tool for evaluating Microchips products and designs. Its use greatly helps debug software, particularly algorithms. Depending on a projects design complexity, a time/cost benefit comparing simulator with emulator should be looked into. Projects with multiple development engineers can keep costs down by using both simulator and emulator, allowing speedy debugging of tough problems. MPLAB-SIM Simulator simulates PICmicro series microcontrollers at instruction level. With any given instruction, the user may examine or modify any of the data or provide external stimulus to any of the pins. The input/output radix can be set by the user, the execution performed as either single step, execute until break, or trace. MPLAB-SIM supports symbolic debugging via MPLAB-C and MPA- SM. The software simulators low-cost flexibility in developing and debugging code outside laboratory environment makes it excellent multiproject development tool [14,15].

PIC ranges very broadly, from tiny 6-pin 8-bit devices with just 16 bytes of data memory performing only basic digital I/O, to 100-pin 32-bit devices with 512 kilobytes of memory and many integrated peripherals for communications, data acquisition, and control. Newcomers may be confused by an aspect of PIC programming: the lowend devices have entirely separate addresses and data buses for data and program instructions. 8-bit or 16-bit refers to the amount of data that can be processed at once, i.e., the width of the data memory (in microchip terminology, registers) and the ALU (Arithmetic and Logic Unit). Lowend PICs, operating 8-bit data at any one time, have three architectural families [16,17].

1.2.1. Baseline (12-Bit Instructions)

These PICs are based on the original PIC architecture, going back to the 1970s and General InstrumentsPeripheral Interface Controller. They are rather limited, but within their limits (such as no interrupts) are simple to work with (particularly in modern assemblers such as 6-pin 10F series, 8-pin 12F509, and 14-pin 16F506).

1.2.2. Midrange (14-Bit Instructions)

An extension of the baseline architecture, it supports interrupts, has more memory and on-chip timers and peripherals, includes PWM (pulse width modulation) for motor control, supports serial, I2C, and SPI interfaces, and has LCD controllers. Modern examples include 8-pin 12F629, 20-pin 16F690, and 40-pin 16F887.

1.2.3. High-End (16-Bit Instructions)

Otherwise known as 18F series, this architecture overcomes some limits of the midrange devices. It has more memory (up to 128k program memory and almost 4k data memory) and advanced peripherals (including USB, Ethernet, and CAN or controller area network) connectivity. The 18F architecture supports C programming and is, among 8-bit PIC families, the only one with C compiler. Examples include 18-pin 18F1220, 28-pin 18F2455, and 80-pin 18F8520. Maybe a little confusing is that PIC18F series has 16-bit program instructions operating on 8-bits of data at a time, and is considered an 8-bit chip [12,18].

BASIC programming language is known to users as the easiest and is the most used. The reputation is increasingly transferred onto microcontrollers. PIC BASIC enables quicker and relatively easier program writing for PIC microcontrollers, as compared with Microchips assembly language MPASM. During program writing, the programmer encounters the same problems always: serial sending of messages, writing of variable on LCD display, generating of six PWM signals, etc. [16].

Facilitating programming are PIC BASICs built-in commands, which are intended to solve problems typically found in praxis. Where execution speed and program size are concerned, MPASM is less advantaged than PIC BASIC (therefore giving rise to the possibility of combining PIC BASIC and assembler). The part of the program where the same commands are executed many times or the execution time is critical is usually written in assembler. Modern microcontrollers such as PIC execute the instructions in a single cycle lasting 4 tacts of the oscillator. If the microcontroller oscillator is 4 MHz (one tact lasts 250 nS), then one assembler instruction requires 250 nS × 4 = 1 uS for the execution. Each BASIC com- mand is actually a sequence of assembler instructions; the exact time necessary for execution of a BASIC command is simply the sum of the times necessary for execution of assembler instructions within one BASIC command [17,19].

2. Hardware Design of the PIC Trainer Model

Figure 3 is a laboratory model of the trainer design hardware. The model has three main parts: board for applied experiments, PIC microcontroller simulator, and interfacing board with PC computer. There is also a built-in power supply.

2.1. Applied Experiments Board

The trainer can execute many experiments: electronic, control logic circuit, power system, etc. The main circuit connecting the board in standalone form will hereby be described. Sensor: the trainer has two types of sensors. One is an approximate sensor (model TURCK Bi14-cp23 APcx sn: 15 mm) detecting front iron paces with 15 mm accuracy and is the approximate switch. Another is photoelectric sensors (serial numbers BR56-DDT-P and BEN9M-TFR). Whereas the former detects interrupts within 5 m, the latter detects reflection two ways: normal closed or normal open. Relays: two types are used, i.e., two poles and three poles, with 24VDC and 24VDC/5A supplying the coils. Four 7-segment models are supplied by 5VDC/2A. Keypads a matrix of LEDs, with matrix form through logic gates to run instructions of the (i, j) form. The matrix instructions are PIC-programmed and then entered as four rows and four columns. Conveyer belt: supplied by 5VDC/2A, displaying experiment outputs based on sensors or any other processes. DC Motor (model GMN-3M027A/DC24V): its circuit drive executes start/stop, opposite direction, and emergency shutdown instructions; each event is indicated by LEDs with shift rotating. See Figure 4 for the experiment board.

2.2. PIC Simulator Board and Interfacing

Five input ports (AE) and two output ports (T0, T1). The ports transfer instructions and receive sensed signals from the experiment board. Every input/output signal on this board is LED-indicated for ON and OFF. The power supplies are 5VDC, 12VDC, and 24VDC. The PIC simulator is supplied first by he 5VDC and then by the USB cable through a PC. the experiment software is installed on-board via USB through the PIC simulator; another interface is RS232. Figure 5 shows the interfacing board.

3. Software Design of the PIC Trainer

This design uses BASIC language to implement the trainers experiments. After the program is written in mikro-Basic, it is compiled to the PIC. The PC runs the BASIC compiler program, which translates the original BASIC code into the language of 0s and 1s understood by the microcontroller. Figure 6 shows the translation of a BASIC program into an executive HEX code. The program, written in PIC BASIC and registered as Program.bas file, is converted into assembler code (Program.asm), which is further translated into executive HEX code written to the microcontroller memory by a programmer (a device transferring HEX files from the PC to the microcontrollers memory). Each experiment has two procedures: one to write the PIC programming code by software, another to implement the hardware connection.

4. Case Study of the Trainers Use

The trainer was designed to implement experiments of various electrical engineering fields. It is capable of high- level research projects and can be used in undergraduate laboratories. Two case studies, for power and electronic, are presented: DC motor controller and intelligent traffic light. Controller for DC Motor: in the experiment, three main operations (start/stop, control of clockwise and anticlockwise directions, and emergency shutdown) are applied to a 24V DC motor (see Figure 7 for the drive circuit of the three operations). A 24V DC one-pole relay was used. The circuit could be manually controlled and could also use a PIC microcontroller to operate relay coil for executing a suitable instruction to the DC motor.

The experiment procedure is:

Connect the board section (see Figure 8) to the three external power supplies on-board the microcontroller.

Connect the other details to the microcontrollers output pinnae.

Write a program for the three experiment parts and set the program on a PIC chip (any serial, e.g., 16F-667, 16F84A, etc.) and arrange for port A of the microcontroller to be the output.

Feed the emergency inputs sensed by photoelectric sensor; manual feeding is possible as needed. Run the circuit by power ON of the voltage source and examine the instruction to the DC motor.

The output must be present as the motor shift rotating and the corresponding LED lighting up showing the direction of rotation.

Intelligent Traffic Light: Optimal waiting time for traffic lights to change will reduce carbon monoxide emission, also save motoriststime and reduce frustration. Other advantages are no interference between the sensor rays and no redundant signal triggering. Ability to interface with software allows this sensor-based traffic system to easily accept feedback (the software and the hardware can communicate). Table 1 lists the operation sequences.

The experiment procedure is:

Connect the section of the board (see Figure 9) to output ports A and B of the microcontroller board.

Write a program for the three parts of the experiment and set the program on the PIC chip (PIC 16F667) and arrange the output to be at ports A and B of the microcontroller.

Turn ON the power of the main board and then of the microcontroller board.

Record the lighting time and sequence and compare with the program.

Investigate the effect of using photoelectric sensor signal; can it show what happens at a street intersection?

5. Conclusions

Results from practical implementation of all the experiments and simulation results from programming the PIC microcontroller board show the trainer to be very useful

and necessary to many design plans. Its higher performance, lower cost, higher accuracy, and better speed response are all as compared with many types of classical trainers for electronic and control systems.

Its facilities will shorten the time taken for many design procedures (where applicable), simulations, and experiments; each can also be an individual system. The design enables instant initial results and modification of experiment steps such as setting the initial condition and updating some of the parameters, so the trainers accuracy and performance are increased.

The trainer allows practical simulations of many real systems. Capable of a wide range of experiments, it is very suitable for use in higher education laboratories. New experiments can be included by adding new circuits to the board and rearranging the connections.

6. Acknowledgements

Al Anbar University supported the project through manufacturing laboratory instruments funding. Al Sofa office provided help with consulting notes for the microcontrollers practical application.

基于PIC单片机的电子控制实验箱的设计与实现

约瑟夫.铝马什哈达尼

伊拉克,巴格达大学,安巴尔省,工程学院,电气工程系

邮箱:yousif_phd@hotmail.com

收到2012426日;2012523日修订;2012530日接

摘要
本文介绍了基于PIC单片机的常规实验室型电子控制实验箱的实现。这项工作包括PIC的软件和硬件。PIC控制器使用一个基于PIC芯片的PC接口编程的EasyPIC-6 电路板。它由以下外部模块组成:128×64图形液晶显示屏,2×16液晶显示屏,4×4键盘,和端口扩展器。本实验是逻辑/模拟电子和控制系统的36个实验之一。这次实验用到的器材有一个5边近似传感器,两个光电传感器(BR56-DDT-P and BEN9M-TFR),四个CMOS,四个被CD4511B驱动的7段显示屏,两个继电器(二极和三极),六伏电压,电流表测量,直流电动机,和24VDC电源,通过连接器和小齿轮连接。所有实验结果表明实验箱满足涉及传统的电子和经典控制系统的本科和研究生专业学科的要求。

关键词:PIC单片机;光电传感器;常规电子实验箱

1、介绍

现在每个单片机芯片可以存储成百上千晶体管。世界上第一个微处理器的外围设备有存储器,输入输出线和定时器(Matic公司,2003年)。随着时间的推移,出现了一个新的设备,称为集成电路(IC),其包含了处理器和外围设备。也被称为单片机,这是微机的第一个芯片[1,2]

外设接口控制器(PIC)是新的电子控制器。在一个单芯片上提供完整的控制、PIC单片机的特殊功能寄存器、上电复位、中断、用于存储程序数据的用户RAM、程序存储器EPROM、定时器电路、指令集、功耗低、电路板上的AD转换。它取代了工业机械中的传统控制(如电机速度控制)[2,3]

  单片机和微处理器在许多方面都不同。在功能方面,一个微处理器需要外部组件接收/发送数据和记忆。 单片机不需要外部组件,因为所有必要的外围设备是内置的,节省了时间和空间(单片机集[4 - 7]参见图1)。

MikroElektronikaEasyPIC-6(见图2) ,是一个非常不错的单片机编程和实验的工具。它支持PIC10PIC12PIC16PIC18系列等超过160种的单片机,在840引脚的芯片中采用了DIP封装。该板安装了PIC16F887、实验效果非常不错的外围设备和扩充连接器板模块,比如可选的液晶显示器和温度传感器[8,9]

板载编程器和mikroICD的调试器通过USB线直接连接到PC 同时提供了MikroElektronikas CPascalBASIC编译器的全功能演示版本(十六进制输出限制在2K程序的话),完整的文档和许多示例程序。该EasyPIC-6还包括外部ICD连接器与MPLAB ICD2ICD3连接控制器,可以完全兼容MPL-AB集成开发环境(IDE[10,11]

在许多本科的实验室缺乏用于外部实验的设施,这些实验也是令初学者感到头痛的设计。本文提出了基于EasyPIC-6的电子控制实验箱切实可行的约36个实验,重新设计了EasyPIC-6供电电源以增强实验箱适用AC-DC电源能力。

1.1、集成开发环境(IDE

核心开发工具集下运作的IDE称为MPLAB 。这些开发工具是基于人的使用习惯设计的,以致这些工具即实用,界面又美观 。这些是MPLAB IDE的开发能力:

●源代码编辑;

●项目管理;

●机器代码生成(从组件或“C”);

●设备模拟;

●设备仿真;

●设备编程。

全面的工具套件使得完整的项目能够在MPLAB环境下开发[12] MPLAB IDE软件大大地简化了8位单片机的软件开发。 MPLAB是一个Windows应用程序,其中包含:

●一个全功能的编辑器;

●三种工作模式:

◆编辑器

◆仿真器

◆模拟器

●一个项目管理;

●丰富的帮助文档;

MPLAB具有的功能:

●编辑源文件(ASMC文件);

●一键装配(或编译)和下载到PIC16/17工具;

●调试通过:

◆源文件

◆绝对列表文件

◆程序存储器

●在同一台PC上运行四个仿真器;

●运行或单步执行;

◆程序存储器

◆源文件

◆绝对列表

在一个平台下运行微芯片模拟器、MPLAB-SIMPICMASTER仿真器,用户只需要学习一个单一的工具集,也能熟悉模拟器和全功能仿真器的功能[13]

1.2 MPLAB SIM模拟器软件

  软件模拟器是一个免费评估Microchip产品和设计的工具。它的使用非常有助于调试软件,尤其是算法。考虑项目设计的复杂性、时间/成本与效益的比较、模拟器与仿真器,同时开发多个工程项目可以降低使用模拟器和仿真器成本,可快速调试棘手的问题。MPLAB-SIM软件模拟器在指令级模拟微型PIC系列单片机。用户可以通过内置的指令检查或修改任何数据或提供外部信号激励。输入/输出参数可以由用户设置,执行、单步执行、要么执行直到结束、或跟踪 MPLAB-SIM支持通过MPLAB-CMPA-SM符号调试。软件模拟器的低成本开发和在实验室环境下调试代码的灵活性使其成为优秀的多项目开发工具[14,15]

  PIC范围非常广泛,从只有16bit的数据存储器、进行基本的数字I / O通信的微型6引脚8位器件,到具有512Kbit的内存、集成了许多外设进行通信、数据PIC编程方面的收发的10032位器件。新手可能在PIC编程方面存在的困难:低端设备具有完全独立的数据和程序指令的地址及数据总线。 8位或16位是指可以一次处理的数据量,即数据存储器、算术和逻辑单元(ALU)中的宽度(在微芯片的术语是“寄存器”)。低端的PIC在任何一个时间处理8位数据[1617]

1.2.1、基准(12位指令)

这些PIC是基于原有的PIC架构,这种架构可以追溯到1970年的通用仪器公司的“外围接口控制器”。这种架构的功能是相当简单的(如没有中断)。特别是在现在装配等610F系列,12F5098引脚和14引脚16F506

1.2.2、中型(14位指令)

基准架构的扩展使得它支持中断,有更多的内存、芯片上的定时器和外设,包括用于电机控制的PWM(脉冲宽度调制)。支持串口,I2CSPI接口,并且具有LCD控制器。现在的例子有8引脚的12F62916F69020引脚及40引脚的16F887

1.2.3、高端(16位指令)

否则被称为18F系列,这种架构的中端设备克服了一些限制,它拥有更多的内存(高达128K的程序内存,几乎4K数据存储器)和先进的外围设备(包括USB,以太网和CAN控制器区域网络)连接。 18F架构支持C语言编程,其中8PIC系列中,只有一个C编译器,例如包括18引脚18F12202818F2455,和80引脚18F8520。也许有点混乱的是PIC18F系列16位程序指令的时间,8位数据被认为是一个8位的芯片[12,18]

BASIC编程语言是已知的被用户称为最简单和最常用的编程语言。它的名声越来越多的被转移到单片机上 ,与芯片的内置汇编语言相比,PIC BASIC编程语言能更快、更容易的给PIC单片机编写程序。在程序的编写方面,程序员总是遇到同样的问题:串口消息的发送,液晶显示变量的编写, PWM信号生成等[ 16 ]

便于编程是PIC内置命令的基本特点,,旨在解决实践中的问题。而执行速度和程序大小有关 MPASMPIC BASIC相比是没有优势的,因此引起了结合PIC BASIC和汇编的可能性。多次执行相同的命令时,每条指令执行时间是至关重要的。指令通常是用汇编语言编写,现在的PIC单片机每条指令的执行时间是由振荡器提供的四个基本周期组成的。如果单片机振荡器为4 MHz(一个周期持续时间为250 ns),我们执行的一条汇编指令需要250纳秒×4 = 1,每一个基本的COM执行命令实际上是一个汇编指令序列。由基本汇编指令 组成的com命令执行所需要的确切时间是指令内所有的基本汇编指令的执行需要时间的总和[17,19]

2PIC实验箱模型的硬件设计

  3是一个实验室模型的实验箱设计的硬件。该模型有三个主要部分:应用实验板,PIC单片机仿真器,PC电脑接口板。还有一个内置的电源。

2.1、应用实验板

  实验箱可以执行许多实验,能够单独连接电子控制逻辑电路,电源系统等。传感器:实验箱有两种类型的传感器。一种是距离传感器(型号:TURCK Bi14-CP23 APCX SN15毫米),它是一种接近开关,可以检测前方15mm内铁块的移动速度。另一种是光电传感器(序列号BR56-DDT-PBEN9M的,TFR)。前者检测到5米范围内的中断,后者检测反射。传感器状态有两种方式:常闭或常开的。继电器有两种类型,即两极型和三极型,线圈的供电方式是24V DC24V DC/5A 5V DC/2A47段显示屏供电。通过键盘的发光二极管,知道逻辑门与矩阵是以第(ij)形式运行的。矩阵指示程序是用PIC编程的 ,通过运行程序知道输入的4*4矩阵。输送带由5V DC/2A供电,显示屏显示基于传感器或任何其他程序的实验结果。 直流电动机(型号GMN-3M027A/DC24V),驱动电路能够执行开始/停止、反方向、紧急停机指令,每个事件是通过移位旋转LED显示 。请参阅图4的实验板。

2.2 PIC仿真板与接口技术

  5个输入端口(AE)和两个输出端口(T0T1)。该端口传输指令和接收来自实验板的感应信号。此板的每一个输入/输出信号通过LEDONOFF状态指示。供电电源能够提供5V DC12VDC24VDCPIC仿真器首先由5V DC供电,再由USB电缆连接PC。通过USB电缆下载实验软件给PIC仿真器,另一个接口是RS232。图5示出的接口板。

3PIC实验箱的软件设计

  本设计是采用BASIC语言来实现的实验。 MIKRO-BASIC编写的程序,它被编译到PIC。在PC上运行的BASIC编译程序,把原来的基本代码转换成能被单片机所理解的语言01。图6示出了一个BASIC程序到执行HEX代码的编译。程序(用PIC BASIC编写,并注册为Program.bas文件)被转换成汇编代码(Program.asm),这种代码是由一个“程序员”(一个从PC向单片机的内存传送十六进制文件的装置 )进一步翻译成写入到单片机内存可执行的HEX代码。每个实验有两个过程:一个写软件的PIC程序代码,另一个实现硬件连接

4、实验箱使用的案例研究

  实验箱的目的是要实现各种电气工程领域的实验。它具有高水平的研究项目,可用在本科实验室 。现介绍两个有关电力电子案例的研究:直流电机控制器和智能交通灯。

直流电动机控制器:在实验中,有三个主要的操作(启动/停止、顺时针和逆时针方向控制,紧急关机)被应用到24VDC电机驱动电路(参见图7 驱动电路的三种操作)。继电器使用24V DC电源。该电路可以手动控制,也可以通过PIC单片机执行一条合适的指令给直流电机,进而操作继电器线圈实现自动控制。

实验过程是:

●将电路板部分(见图8)与外部电源板上的三个单片机连接。

●连接单片机的其他输出接口。

●给实验的三个模块写一个程序,并给PIC芯片设置程序(任意系列,例如16F-667,16F84A等等),并安排一个单片机的端口的输出。

●由光电传感器检测可能出现的紧急输入,如有需要也可手动。

●接通电源开关,运行电路和检查直流电机的指令。

输出必须为电机变速旋转方向或相应的点亮LED显示旋转的方向。

智能交通信号灯:最佳红绿灯等待时间的变化将减少一氧化碳排放,也节省司机驾驶时间,减少挫折感。接口与软件的能力使得基于传感器的交通系统很容易接受反馈(软件和硬件可以沟通)。表1列出了操作序列。

实验过程是:

●连接单片机板的输出端口A、端口B和实验板部分(参见图9)。

●为实验的三个部分写一个程序、给PIC芯片(PIC 16F667)设置程序和分配单片机的输出端口A和输出端口B

●接通主板的电源开关,然后接通单片机板。

●记录点亮时间和序列,并与该程序进行比较。

查看光电传感器信号的记录,可以知道在一个十字路口发生了什么?

5、结论

  从编程PIC单片机板的所有实验和仿真的实际执行结果表明,该实验箱是非常有用的,对于许多设计方案也是必要的。与许多其它类型的电子和控制系统的经典实验箱相比较,本实验箱具有更高的性能,更低的成本,更高的精度,更快的响应速度。

  实验箱上面的设备将会缩短许多设计过程(如适用)、模拟和实验的时间,每个模块都可以是一个独立的系统。该实验箱采取了实时处理初步结果的设计,能够通过设置初始条件,修改实验步骤等及时更新一些参数。因此,提高实验箱的精度和性能。

实验箱可以模拟许多真实系统,能广泛的实验,非常适合用于高等教育实验室。新的实验可以通过添加新的模块而实现。

6、致谢

安巴尔大学通过制造实验室仪器的资金支持这个项目,艾尔发办公室为单片机的实际应用提供帮助和咨询笔记。

  • 29.8

    ¥45 每天只需1.0元
    1个月 推荐
  • 9.9

    ¥15
    1天
  • 59.8

    ¥90
    3个月

选择支付方式

  • 微信付款
郑重提醒:支付后,系统自动为您完成注册

请使用微信扫码支付(元)

订单号:
支付后,系统自动为您完成注册
遇到问题请联系 在线客服

常用手机号:
用于找回密码
图片验证码:
看不清?点击更换
短信验证码:
新密码:
 
绑定后可用手机号登录
请不要关闭本页面,支付完成后请点击【支付完成】按钮
遇到问题请联系 在线客服