摘 要 近十几年来,随着电子技术的飞速发展,为磁通门技术的进一步发展奠定了物质基础,使磁通门的各项技术指标得到了进一步提高,在科研方面的应用更是普遍;另一方面,在自动控制、智能仪器仪表、家用电器和数据采集系统等领域中,单片机的应用越来越广泛,为此,根据科研任务的要求,提出了“磁通门的数据采集系统”这一论题,以培养学生自己动手的能力。 本论题通过磁通门发出的信号经过解调放大,A/D转换,并利用单片机的串行口与PC机的串行口COM1和COM2进行通信,将单片机采集到的数据传送到PC机,其中需经过MAX232的电平转换。简单而言,就是对磁通门输出信号的数据采集和发送。 由于在设计过程中应采用数量尽可能少,功能尽可能多的芯片,所以在设计和制作过程中,选用的是AVR单片机,片内具有A/D转换功能,并在选用多路模拟开关时采用了CD4066和CD4052。最后,采用C语言对A/D转换和串行通信进行编程。也即实现了数据的采集和通信。 关键词:磁通门;AVR单片机;数据采集系统 ABSTRACT In the last more than ten years, as the fast development of the electronics technical, for the material foundation to make a further development, and the application in the research is more widespread; On the other hand, in automatically control, in the intelligence instrument appearance, in the electronic equipment and in the data collecting system, the single-chip microcomputer is more and more extensive, so according to the research mission, put forward “the data collecting system of the fluxgate” to develop the ability of the student. The text is a signal that sent out from the fluxgate adjusts to enlarge through solution, the A/D conversion, and make use of the Single-chip Microcomputer’s serial interface and serial interface-COM1 or COM2 of PC to carry on the data, and convey the data which the Single-chip Microcomputer gathers to the PC, among them need the conversion of electricity of pass by the MAX232. In brief, it is to collect and send out the data from the fluxgate. In the design process should choose chips as little as possible in quantity, as many as possible in function, so in the design and manufacture process. I chose the AVR single-chip microcomputer, which has the A/D conversion inside, and choose the CD4066 and CD4052 in emulation switch. In the end, use the C language to A/D converse and serial communication to make the program. In the other word, it carries out collecting the data and serial communicate. Key words: fluxgate; AVR Single-chip Microcomputer; data collecting 目 录 第1章 绪论…………………………………………………………1 1.1 课题的背景和目………………………………………………………1 1.1.1 课题的背景……………………………………………………1 1.1.2 目的……………………………………………………………1 1.2 国内外研究状况和相关领域中已有的研究成果……………………2 1.3 对课题的研究设想……………………………………………………3 1.4 预期结果和意义………………………………………………………3 第2章 磁通门的介绍………………………………………………4 2.1 磁通门的工作原理……………………………………………………4 2.2 理想变压器与单铁芯磁通门…………………………………………6 2.3 双铁芯磁通门…………………………………………………………9 2.4 磁通门输出信号……………………………………………………10 2.5 磁通门输出信号的处理……………………………………………13 2.6 本章小结……………………………………………………………13 第3章 单片机的选择与介绍……………………………………15 3.1 单片机的概述………………………………………………………15 3.1.1 单片机及其发展………………………………………………15 3.1.2 单片机的应用…………………………………………………15 3.2 单片机的选择………………………………………………………16 3.3 ATmega16单片机的介绍……………………………………………16 3.3.1 ATmega16单片机的特点……………………………………16 3.3.2 ATmega16单片机封装与引脚………………………………17 3.3.3 ATmega16CPU内核…………………………………………19 3.3.4 系统控制和复位………………………………………………20 3.3.5 I/O端口………………………………………………………21 3.3.6 ATmega16的A/D转换………………………………………22 3.4 AVR单片机C编译器………………………………………………23 3.5 本章小结……………………………………………………………25 第4章 硬件电路的分析…………………………………………26 4.1 整体介绍……………………………………………………………26 4.2 多路模拟开关………………………………………………………27 4.2.1 四路双向模拟开关CD4066…………………………………27 4.2.2 双四路模拟开关CD4052……………………………………27 4.3 四运放LM324………………………………………………………29 4.4 电压比较器LM139…………………………………………………29 4.5 串行通信………………………………………………………………30 4.6 本章小结………………………………………………………………32 第5章 系统软件的设计…………………………………………34 5.1 AVR单片机的开发语言……………………………………………34 5.1.1 C语言开发单片机的优势……………………………………34 5.1.2 ICCAVR使用的C语言基础知识……………………………35 5.2 通用同/异步串行接口USART………………………………………36 5.2.1 USART的概述………………………………………………36 5.2.2 USART寄存器………………………………………………37 5.3 有关的I/O寄存器……………………………………………………41 5.4 串行通信……………………………………………………………46 5.5 本章小结……………………………………………………………47 第6章 系统的调试………………………………………………48 6.1 A/D转换……………………………………………………………48 6.2 微机处理数学模型…………………………………………………48 6.3 AVR集成开发环境(AVR STUDIO)………………………………50 6.4 仿真调试……………………………………………………………50 6.5 JTAG下载编程操作…………………………………………………50 6.6 本章小结……………………………………………………………52 结论…………………………………………………………………53 参考文献……………………………………………………………54 致谢…………………………………………………………………55 第1章 绪论 1.1 课题的背景和目的 1.1.1 课题的背景 随着计算机技术的飞速发展和普及,数据采集系统也迅速的得到应用。在生产过程中,应用这一系统可对生产现场的工艺参数进行采集、监视和记录,为提高产品质量、降低成本提供信息和手段。在科学研究中,应用数据采集系统可获得大量的动态信息,是研究瞬间物理过程的有利工具,也是获取科学奥秘的重要手段之一。总之,不论在哪个应用领域中,数据采集与处理越及时,工作效率越高,取得的经济效益就越大。 20世纪30年代初,出现了磁通门技术,它可以测定恒定和低频弱磁场,其基本原理是磁芯磁导率随时间而变化。1936年德国物理学家Aschenbrenner和Goubau首次采用二次谐波环芯探头测量大地磁场在水平方向上的冲击波动地磁变化,记录磁扰并提出磁通门的工作原理,随后Lapierre、Autranikian、Vacquier等人对此项技术做了进一步的探索,从而证明了这种技术的可行性,利用它制成的仪器也不断的获得发展。由于微电子技术的日益完善,计算机应用系统的普及以及新兴材料的出现,为磁通门技术的进一步发展奠定了物质基础,并为此技术的应用领域从军事方面扩展到民用领域,为磁通门技术的发展指出了一条新的方向。 因此,根据科研任务中磁通门技术的有关应用,特别设计了磁通门的数据采集系统这一课题,以加强学生实际动手能力的培养。 1.1.2 目的 |