电子书-十天学会单片机实例100.pdf//实例 4:用单片机控制一个灯闪烁:认识单片机的工作频率 #include<reg51.h> //包含单片机寄存器的头文件 /**************************************** 函数功能:延时一段时间 *****************************************/ void delay(void) //两个 void 意思分别为无需返回值,没有参数传递 { unsigned int i; //定义无符号整数,最大取值范围 65535 for(i=0;i<20000;i++) //做 20000 次空循环 ; //什么也不做,等待一个机器周期 } /******************************************************* 函数功能:主函数 (C 语言规定必须有也只能有 1 个主函数) ********************************************************/ void Main(void) { while(1) //无限循环 { P1=0xfe; //P1=1111 1110B, P1.0 输出低电平 delay(); //延时一段时间 P1=0xff; //P1=1111 1111B, P1.0 输出高电平 www.91
标签: 单片机
上传时间: 2022-03-19
上传用户:kingwide
目前电动汽车主要以锂电池作为动力来源,为了提高锂电池的使用时间和安全性,为锂电池提供安全良好的运行环境,电池管理系统应运而生。BMS主控单元基于S32K144汽车级单片机,通过主从式网络控制结构能够对锂电池的各个参数进行采集与分析。采用扩展卡尔曼滤波对电池的荷电状态(SOC)进行估算,克服普通估算方法无法避免电池内阻误差的缺点,通过Matlab/Simulink软件仿真验证可使估算误差达到2%以内。At present,electric vehicles Mainly use lithium batteries as the power source.In order to improve the running time and safety of lithium batteries,a safe and good operating environment for power batteries is provided,and a battery management system(BMS) has emerged.The BMS Main control unit is based on the S32K144 automotive-grade control chip.Through the master-slave network control structure,it can collect and analyze the various parameters of the lithium battery.The Extended Kalman Filter(EKF) is used to estimate the state of charge(SOC) of the battery,which overcomes the shortcomings of the internal estimation method that cannot overcome the internal resistance error of the battery.It can be verified by Matlab/Simulink software simulation.The estimation error is within 2%.
上传时间: 2022-03-26
上传用户:XuVshu
51单片机电子时钟程序,程序由Main.c,ds1302,lcd1602,key,模块组成,压缩包,包含proteus仿真图,单片机课设用的。
上传时间: 2022-03-26
上传用户:kingwide
研究一种智能扫地机器人。从硬件系统控制模块设计到主要技术调试进行了较详细的阐述。以STM32单片机为控制核心与电机驱动、红外线路径识别模块等相互协调应用。进行电路搭建和程序编写。实现了智能扫地机器人红外线避障和自动扫地功能,其清扫面积能达到约70%,清扫率约60%,很大程度受到自身机械机构的限制,后期将对小车的机械结构进行完善。This paper studies an intelligent sweeping robot.From the hardware system control module design to the Main technical debugging are described in detail.STM32 MCU is used as the control core to coordinate with motor drive and infrared path recognition module.Conduct circuit building and programming.The functions of infrared obstacle avoidance and automatic sweeping of intelligent sweeping robot are realized.Its cleaning area can reach about 70%and the cleaning rate is about 60%.Because it is limited by its own mechanical mechanism to a great extent,the mechanical structure of the car will be improved in the later stage.
标签: 扫地机器人
上传时间: 2022-03-26
上传用户:
近年来反季节种植已成火热趋势,温室大棚的普及十分迅速,而温室大棚对自动化、智能化的要求也越来越迫切,本系统将温室大棚的温湿度、二氧化碳浓度各个方面的检测,通风、浇灌、温度、喷洒农药等各个方面的控制进行综合系统研究,实现温室大棚对自动化、智能化的要求。这一系统是基于单片机控制的智能检测,控制系统包含单片机主控模块、感应检测模块、传感模块,显示、控制模块等[1]。从而提高温室大棚的种植效率,减少劳动力,提高利润等。In recent years,counter-season planting has become a hot trend featuring the rapid popularization of greenhouse and urgent requirement for the automation and intellectualization of greenhouse.This paper offers a comprehensive and systematic study of the monitoring of temperature,humidity and carbon dioxide concentration in the greenhouse and the control of ventilation,irrigation,temperature and pesticide spraying in order to achieve automation and intellectualization in greenhouse.This system is based on the intelligent detection controlled by single chip computer with the control system including the Main control module,induction detection module,sensing module,display and control module of single chip computer,which is effective in improving planting efficiency of greenhouse,reducing labor force and increasing profits.
上传时间: 2022-03-27
上传用户:
以AT89S52单片机为控制核心,采用电容降压技术,Buck电路拓扑,PWM驱动模块和功率器件散热设计,通过高速的数据采集、主功率输入输出模块和控制模块,设计一种新型智能车载充电器.在充电过程中,通过负脉冲瞬间放电实现对铅酸蓄电池的再生修复,提高电池的有效容量,延长使用寿命.该充电器体积小、速度快、效率高、可靠性好.With AT89S52 single chip computer as the control core,a new type of intelligent car-carried charger was designed by using capacitance step-down technology,Buck circuit topology,PWM driving module and power device heat dissipation design,through high-speed data acquisition,Main power input and output module and control module.In the charging process,the regeneration and repair of lead-acid batteries are realized by instantaneous discharge of negative pulse,which improves the effective capacity of batteries and prolongs their service life.The charger has the advantages of small size,fast speed,high efficiency and good reliability.
标签: 车载充电器
上传时间: 2022-03-27
上传用户:
入室抢劫事件屡见不鲜,针对此现象进行分析不难发现,造成失窃事件的极大原因是人们慵懒和意识差等不良性格造成习惯性不锁门.本文以STC89C52单片机为基础,设计了一种基于人体红外传感器的自动关门锁门装置,来解决此类问题.The incidents of burglary are so common. It is not difficult to find that the Main reason for the burglary is the habit of unlocking of doors caused by people's laziness and poor consciousness. Based on the single chip microcomputer of STC89C52, a device used with infrared sensor of human body is introduced in this paper, which can achieve the effect of automatic closing and locking doors.
上传时间: 2022-03-27
上传用户:canderile
数字示波器功能强大,使用方便,但是价格相对昂贵。本文以Ti的MSP430F5529为主控器,以Altera公司的EP2C5T144C8 FPGA器件为逻辑控制部件设计数字示波器。模拟信号经程控放大、整形电路后形成方波信号送至FPGA测频,根据频率值选择采用片上及片外高速AD分段采样。FPGA控制片外AD采样并将数据输入到FIFO模块中缓存,由单片机进行频谱分析。测试表明:简易示波器可以实现自动选档、多采样率采样、高精度测频及频谱分析等功能。Digital oscilloscope is powerful and easy to use, but also expensive. The research group designed a low-cost digital oscilloscope, the chip of MSP430F5529 of TI is chosen as the Main controller and the device of EP2C5T144C8 of Altera company is used as the logic control unit. Analog signal enter the programmable amplifier circuit, shaping circuit and other pre-processing circuit. The shaped rectangular wave signal is sent to FPGA for measure the frequency. According to the frequency value to select AD on-chip or off-chip high-speed AD for sampling. FPGA controls the off-chip AD sampling and buffers AD data by FIFO module. The single chip microcomputer receives the data, and do FFT for spectrum analysis. The test shows that the simple oscilloscope can realize automatic gain selection, sampling at different sampling rates, high precision frequency measurement and spectrum analysis.
上传时间: 2022-03-27
上传用户:
LED 线阵显示装置, 分为 LED 线性旋转显示主机和图文录入器两部分。主机用直流电机带动由红绿 LED 组成的线阵旋转, 同时线阵按照时序依次切换显示状态, 在固定区域利用视觉暂留效果形成 16×16 点阵, 用以显示图文;图文录入器用 HMI 触控屏作为人机交互界面, 实现图文录入和回放功能。主机与图文录入器通过无线通信方式进行信息交互,可由图文录入器控制主机切换不同工作任务, 以及改变线阵显示内容。The LED linear array display device is divided into two parts:the one is the Main unit used to display content,and the other one is used to input the contents.The Main unit is driven by a DC motor to rotate the linear array composed by red and green light emitting diodes.At the same time,the 16×16 dot matrix that switching the display state according to the time sequence on the Main unit displays pictures and texts in the fixed area,by using the visual temporary effect.The HMI touch screen is used as human machine interface to realize the function that input and playback pictures and texts.The two parts of the device communicate with each other through wireless communication.The image and text input controller can control the Main unit to switch different tasks and change the content of linear array displayed.
标签: stc12c5a60s2 单片机 led
上传时间: 2022-03-28
上传用户:jiabin
通过采用无桥PFC和半桥LLC谐振变换器作为数字开关电源的主变换拓扑,基于STM32系列微控制器的全数字控制PFC和DC-DC变换器,首先对数字化开关电源方案进行对比,然后阐述了200W数字开关电源整体方案,并对数字开关电源的无桥PFC和半桥LLC变换器进行系统研究。By using a bridgeless PFC and a half-bridge LLC resonant converter as the Main conversion topology of the digital switching power supply,the all-digital control PFC and DC-DC converter based on the STM32 series of microcontrollers,firstly the digital switching power supply scheme is compared,and then the overall scheme of 200 W digital switching power supply is expounded, and the bridgeless PFC and half-bridge LLC converter of digital switching power supply are systematically studied.
标签: 数字开关电源
上传时间: 2022-04-02
上传用户:qingfengchizhu