【正文】
else P1_0=1。 } } /*對占空比值限定范圍 */ if (ZKB199) ZKB1=1。 興趣之所在 ,明確我們的人生理想 ,進而在今后的生活和工作中更好的發(fā)揮自己的優(yōu)勢 ,學好自己的專業(yè) ,成為一個對于社會有用的人 .在此更要感謝我的專業(yè)老師,是你們的細心指 導和關懷,使我能夠順利的完成畢業(yè)論文。原因可能是電腦輸出電壓低于 5V,導致晶振沒有起振。 ⑶ 要使用合適的助焊劑 助焊劑的作用是清除焊件表面的氧化膜。即 *100=1ms include define uchar unsigned char TH0 和 TL0 是計數(shù)器 0 的高 8位和低 8位計數(shù)器,計算辦法 : TL0=(65536C)%256。一般外接電容,是為了使晶振兩端的等效電容等于或接近負載電容。高級的精基于單片機的 PWM 調光 14 度更高。常用的是發(fā)紅光、綠光或 黃光 的二極管。 XTAL2:來自反向振蕩器的輸出。 ALE/PROG:當訪問外部存儲器時,地址鎖存允許的輸出電平用于鎖存地址的 地位字節(jié)。 P0能夠用于外部程序數(shù)據(jù)存儲器,它可以被定義為數(shù)據(jù) /地址的 第八位。同樣延伸到光源應用里,混合多個單色 LED 也會存在同樣的問題。當可控硅導通后,可控硅和驅動電路的阻抗都發(fā)生變化,且驅動電路由于有差模濾波電容的存在,呈容性阻抗,與可控硅調光器存在阻抗匹配的問題,因此在設計電路時一般需要使用較小的差模濾波電容。這種精細控制在 RGB 應用中特別重要,以混合不同顏色的光來產生白光。因此,本設計采用由單片機控制實現(xiàn)的脈沖計數(shù)法。 PWM 調光就是通過調整燈亮的時間與燈滅時間的比例來調整平均感觀亮度的方法。微處理器、微控制器和微型計算機三者的關系十分密切。使用脈沖寬度調制( PWM)來設置周期和占空度(圖 1)可能是最簡單的實現(xiàn)數(shù)字調光的方法,并且 Buck 調節(jié)器拓撲往往能夠提供一個最好的性能。 關鍵詞 數(shù)字脈沖 /占空比 /驅 動電路 /線性調節(jié) 基于單片機的 PWM 調光 II Based on SCM PWM dimming the lights ABSTRACT PWM dimming is a simple digital pulse, the repeated switching of white LED driver dimming technology. Application of the system only needs to provide a wide, narrow different digital pulse, can easily change the output current, thereby regulating the brightness of white light LED. PWM dimming has the advantage of being able to provide high quality white light, and the application of simple, high efficiency! For example, in a mobile phone system, using a special PWM interface can easily generate arbitrary duty cycle of the pulse signal, the signal is passed through a resistor, connected to the drive EN interface. Most manufacturers drive support PWM dimming. For Buck, Boost, BuckBoost or linear regulator to drive LED, their mon ideas are the drive circuit to control the output of light. Some applied simply to achieve the on and off function, but more application demand is to be from 0 to 100% regulates the brightness of the light, and often have very high precision. The designer has two main options: linear regulator LED current ( analog dimming ), or using the switch circuit with respect to human recognition capacity, a high enough frequency to change the average light output ( digital dimming ). The use of pulse width modulation ( PWM ) to set the cycle and duty cycle ( Figure 1 ) is probably the most simple digital dimming method, and Buck regulator topology can often provide a best performance. KEY WORDS digital pulse ,duty ,drive circuit ,linear regulator 基于單片機的 PWM 調光 III 目 錄 中文摘要 ……………………………………………………………………………………… I 英文摘要 ……………………………………………………………………………………… II 引 言 .......................................................................................................................... 1 1 單片 機應用技術簡介 ......................................................................................... 2 單片機內部構成 ....................................................................................... 2 單片機的工作原理 .................................................................................. 2 2 PWM 調光原理簡介 ............................................................................................... 4 PWM 調光技術原理 ................................................................................... 4 脈沖寬度調節(jié) ...................................................................................... 4 PWM 對于 LED 調光的優(yōu)勢 ................................................................... 5 LED 光源的特性 ........................................................................................ 7 3 電路設計 ................................................................................................................ 8 電路設計流程圖 ....................................................................................... 8 主控元件與功能模塊介紹 .................................................................... 8 按鍵功能設計 ...................................................................................... 8 主控元件單片機 .................................................................................. 8 光源模塊 .............................................................................................11 電源的選擇與連接 .............................................................................11 其他元件工作特性 ................................................................................ 12 LED 發(fā)光二極管功能簡介 ................................................................. 12 晶振的作用與電路的連接 ................................................................ 13 4 實物裝配與調試 ................................................................................................ 16 實物裝配流程 ...........................................