895191577關(guān)于單片機(jī)的中英翻譯_第1頁(yè)
895191577關(guān)于單片機(jī)的中英翻譯_第2頁(yè)
895191577關(guān)于單片機(jī)的中英翻譯_第3頁(yè)
895191577關(guān)于單片機(jī)的中英翻譯_第4頁(yè)
免費(fèi)預(yù)覽已結(jié)束,剩余1頁(yè)可下載查看

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、微控制器微控制器是一個(gè)可編程集成電路(ic),當(dāng)你開(kāi)啟微控制器時(shí)就會(huì)看到一系列的命令,這些命令是你事先植入芯片中的。你可以通過(guò)改變這些命令做不同的事情(通常稱為編程)。為了修改你的命令你需要一個(gè)pg320這樣的裝置,你可以通過(guò)pg320從計(jì)算機(jī)上下載程序到微控制器上。這一章將為你展示一些簡(jiǎn)單的程序和如何下載。2.0.1 555定時(shí)器如何產(chǎn)生脈沖555 定時(shí)器是由簡(jiǎn)單的晶體管組成,作用和觸發(fā)器一樣,它們本身不能定時(shí),當(dāng)你接上電源它們開(kāi)始產(chǎn)生脈沖,當(dāng)你撤掉電源它們就不能產(chǎn)生脈沖,所以對(duì)于555定時(shí)器本身來(lái)說(shuō)不能產(chǎn)生脈沖。產(chǎn)生脈沖的方法就是用一些元件把555連接在一個(gè)電路中(如下面的電路)。這個(gè)電路

2、是由一個(gè)電容器和一個(gè)電阻器構(gòu)成的。我們可以交換觸發(fā)器和啟動(dòng)充電電容。電阻器用來(lái)控制電容充電的快慢。電阻越大,電容充電時(shí)間越長(zhǎng)。電路中的電壓可以用作輸入的另一個(gè)觸發(fā)器,因?yàn)槠鹗茧妷簽?時(shí),在第二個(gè)開(kāi)關(guān)處不會(huì)有任何的反應(yīng),但最終由于電容器充電到一定值激活第二個(gè)觸發(fā)器。555工作的原理是當(dāng)你交換第一個(gè)觸發(fā)器,輸出引腳為vcc(由陽(yáng)極供應(yīng)電壓),電容器開(kāi)始充電。當(dāng)電容器電壓達(dá)到2/3的vcc(也就是vcc*2/3),第二個(gè)觸發(fā)器閉合使輸出電壓為0伏。555定時(shí)器的引出線如下: 詳細(xì)資料 引腳2(觸發(fā)器)是脈沖的啟動(dòng)開(kāi)關(guān)。觸發(fā)器的字符線路告訴我們電壓與我們通常所期望的相反。當(dāng)引腳2接0伏電壓,對(duì)這個(gè)相反

3、行為的專業(yè)術(shù)語(yǔ)稱為“低態(tài)有效”。對(duì)于ic輸入模塊看到低態(tài)有效行為很平常,因?yàn)榫w管電路的轉(zhuǎn)換實(shí)質(zhì)就像我們?cè)趌ed和晶體管指南看到的一樣。引腳6是脈沖的關(guān)閉開(kāi)關(guān)。我們把電容器的陽(yáng)極連接到這個(gè)引腳上,電容器的陰極接地。當(dāng)引腳2(觸發(fā)器)是vcc,555定時(shí)器電壓處于0伏控制引腳7(注意反轉(zhuǎn)電壓),當(dāng)引腳2電壓為0伏時(shí)555停止控制引腳7,然后電容器開(kāi)始充電。電容器通過(guò)連接在vcc上的電阻充電,電流開(kāi)始流入電容器,電容器的電壓開(kāi)始升高。 引腳3是輸出(在這里輸出實(shí)際的脈沖)端。引腳3上起始電壓為0,當(dāng)觸發(fā)器(引腳2)上電壓為0時(shí),555 通過(guò)vcc控制引腳3直到引腳6電壓達(dá)到vcc的2/3(也就是v

4、cc*2/3)。然后將引腳3的電壓接地,這樣你就可以看到一個(gè)脈沖(此外注意翻轉(zhuǎn)作用).引腳7上的電壓同樣也要接地,連接電容器進(jìn)行地面放電。觀看脈沖為了看到脈沖我們用一個(gè)led接在555輸出端(引腳3)。當(dāng)輸出端電壓為0伏時(shí)led將不工作,當(dāng)輸出端是vcc時(shí)led將工作。構(gòu)建電路因?yàn)?55的放置要穿過(guò)電路實(shí)驗(yàn)板的中間線路所以一邊4個(gè)引腳。(為了使它們放在孔中你可能需要把引腳彎曲一點(diǎn))。直到完成電路后才可以通電。上面的圖表指導(dǎo)你怎樣將555上面的引腳編號(hào)。你可以通過(guò)尋找在芯片末端的半個(gè)循環(huán)發(fā)現(xiàn)以腳1。有時(shí)候不是半個(gè)循環(huán),而是一個(gè)點(diǎn)或是很淺的洞。在你開(kāi)始構(gòu)建電路之前,用跳線連接紅或綠動(dòng)力行和在電路板

5、另一邊的紅或綠動(dòng)力行。然后你會(huì)很容易的將電路板兩邊的vcc和地線連接在一起(如果電線太短,對(duì)于陽(yáng)極(vcc)用兩個(gè)電線接在一起成一排,對(duì)于地線用兩根電線接在一起成不同的排)。將引腳1接地.將引腳8接到vcc上.將引腳4接到vcc上.將led的陽(yáng)極接到330歐姆的電阻器上,led的陰極接地。將330歐姆電阻器的其它接頭連接輸出端引腳3.將引腳7用一個(gè)10k的電阻接到vcc上(r =10k)。引腳7和6用跨接線連接。引腳6接220f的電容器陽(yáng)極(c=220f)。(為了使陰極能插進(jìn)電路實(shí)驗(yàn)板你可能需要將陽(yáng)極(長(zhǎng)腿的)彎進(jìn)或彎出一點(diǎn)。電容器的陰極接地。引腳2用線接出作為觸發(fā)器。開(kāi)始把引腳2和vcc連接

6、起來(lái)?,F(xiàn)在接電源。led將被激活停留大約2秒。從vcc上拔掉連接引腳2的電線,你可以通過(guò)用你手指接觸連接引腳2的電線或?qū)㈦娋€接地或是移開(kāi)來(lái)再一次激活555。(它應(yīng)該產(chǎn)生大約2秒鐘的脈沖)振蕩接下來(lái)我們將使led不斷的反射而不必觸發(fā)它。我們將鉤住555以便它自己本身可以觸發(fā)。工作原理就是我們?cè)陔娙萜骱头烹娨_,引腳7之間加一個(gè)電阻。現(xiàn)在,電容器將充電(通過(guò) )當(dāng)電壓達(dá)到2/3 vcc時(shí),把引腳3和引腳7接地。但由于rb電容器不能立即放電,電容器通過(guò)rb從充電到放電需要一定的時(shí)間,rb的電阻越大時(shí)間越長(zhǎng)。電容器開(kāi)始放電的時(shí)間也就是led工作中斷的時(shí)間。為再一次觸發(fā)555,我們將引腳6和觸發(fā)器(引腳

7、2)連接起來(lái)。當(dāng)電容器充電時(shí)電容器內(nèi)的電壓越來(lái)越低。當(dāng)電壓降到1/3 vcc時(shí)觸發(fā)器引腳2使引腳3變?yōu)関cc并且通過(guò)led激活555。將引腳7從地面上斷開(kāi),電容器開(kāi)始通過(guò)ra和rb再次充電。從以前的電路上構(gòu)建這個(gè)電路,做法如下:斷開(kāi)電源。去掉引腳6和引腳7之間的跨接線,用2.2k的電阻來(lái)代替(rb=2.2k)用引腳2處的跨接線連接引腳2和引腳6。現(xiàn)在重新連接電源并且led應(yīng)該始終閃爍(只要電源是開(kāi)著的)。用不同阻值的ra和rb做實(shí)驗(yàn)看一下lrd閃爍時(shí)間長(zhǎng)短的變化(你可以改變電容器充放電時(shí)間的長(zhǎng)短)。microcontrollers a microcontroller is an integra

8、ted circuit (ic) that is programmable. when you turn on the power to the microcontroller it goes through a series of commands. these commands are put in the chip by you. you can make it do different things by changing the commands (usually called the program). to change the commands you need a devic

9、e like the pg302. the pg302 lets you download the program from your computer to the microcontroller. this chapter will show you some simple programs and how to download those to2.0.1the 555 timer creating a pulse the 555 is made out of simple transistors that are about the same as on / off switches.

10、 they do not have any sense of time. when you apply a voltage they turn on and when you take away the voltage they turn off. so by itself, the 555 can not create a pulse. the way the pulse is created is by using some components in a circuit attached to the 555 (see the circuit below). this circuit i

11、s made of a capacitor and a resistor. we can flip a switch and start charging the capacitor. the resistor is used to control how fast the capacitor charges. the bigger the resistance, the longer it takes to charge the capacitor. the voltage in the capacitor can then be used as an input to another sw

12、itch. since the voltage starts at 0, nothing happens to the second switch. but eventually the capacitor will charge up to some point where the second switch comes on. the way the 555 timer works is that when you flip the first switch, the output pin goes to vcc (the positive power supply voltage) an

13、d starts charging the capacitor. when the capacitor voltage gets to 2/3 vcc (that is vcc * 2/3) the second switch turns on which makes the output go to 0 volts. the pinout for the 555 timer is shown below deep details pin 2 (trigger) is the on switch for the pulse. the line over the word trigger tel

14、ls us that the voltage levels are the opposite of what you would normally expect. to turn the switch on you apply 0 volts to pin 2. the technical term for this opposite behavior is active low. it is common to see this active low behavior for ic inputs because of the inverting nature of transistor ci

15、rcuits like we saw in the led and transistor tutorial. pin 6 is the off switch for the pulse. we connect the positive side of the capacitor to this pin and the negative side of the capacitor to ground. when pin 2 (trigger) is at vcc, the 555 holds pin 7 at 0 volts (note the inverted voltage). when p

16、in 2 goes to 0 volts, the 555 stops holding pin 7 at 0 volts. then the capacitor starts charging. the capacitor is charged through a resistor connected to vcc. the current starts flowing into the capacitor, and the voltage in the capacitor starts to increase. pin 3 is the output (where the actual pu

17、lse comes out). the voltage on this pin starts at 0 volts. when 0 volts is applied to the trigger (pin 2), the 555 puts out vcc on pin 3 and holds it at vcc until pin 6 reaches 2/3 of vcc (that is vcc * 2/3). then the 555 pulls the voltage at pin 3 to ground and you have created a pulse. (again noti

18、ce the inverting action.) the voltage on pin 7 is also pulled to ground, connecting the capacitor to ground and discharging it. seeing the pulse to see the pulse we will use an led connected to the 555 output, pin 3. when the output is 0 volts the led will be off. when the output is vcc the led will

19、 be on. building the circuit place the 555 across the middle line of the breadboard so that 4 pins are on one side and 4 pins are on the other side. (you may need to bend the pins in a little so they will go in the holes.) leave the power disconnected until you finish building the circuit. the diagr

20、am above shows how the pins on the 555 are numbered. you can find pin 1 by looking for the half circle in the end of the chip. sometimes instead of a half circle, there will be a dot or shallow hole by pin 1. before you start building the circuit, use jumper wires to connect the red and blue power r

21、ows to the red and blue power rows on the other side of the board. then you will be able to easily reach vcc and ground lines from both sides of the board. (if the wires are too short, use two wires joined together in a row of holes for the positive power (vcc) and two wires joined together in a dif

22、ferent row of holes for the ground.) connect pin 1 to ground. connect pin 8 to vcc. connect pin 4 to vcc. connect the positive leg of the led to a 330 ohm resistor and connect the negative end of the led to ground. connect the other leg of the 330 ohm resistor to the output, pin 3. connect pin 7 to

23、vcc with a 10k resistor (ra = 10k). connect pin 7 to pin 6 with a jumper wire. connect pin 6 to the positive leg of the 220uf capacitor (c = 220uf). (you will need to bend the positive (long leg) up and out some so that the negative leg can go in the breadboard. connect the negative leg of the capac

24、itor to ground. connect a wire to pin 2 to use as the trigger. start with pin 2 connected to vcc. now connect the power. the led will come on and stay on for about 2 seconds. remove the wire connected to pin 2 from vcc. you should be able to trigger the 555 again by touching the wire connected to pi

25、n 2 with your finger or by connecting it to ground and removing it. (it should be about a 2 second pulse.) making it oscillate next we will make the led flash continually without having to trigger it. we will hook up the 555 so that it triggers itself. the way this works is that we add in a resistor

26、 between the capacitor and the discharge pin, pin 7. now, the capacitor will charge up (through ra and rb) and when it reaches 2/3 vcc, pin 3 and pin 7 will go to ground. but the capacitor can not discharge immediately because of rb. it takes some time for the charge to drain through rb. the more resistance rb has, the longer it takes to discharge. the time it takes to discharge the capacitor will be the time the led is off. to trigger the 555 again,

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論