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

下載本文檔

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

文檔簡介

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

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

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

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

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

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

7、2)連接起來。當(dāng)電容器充電時電容器內(nèi)的電壓越來越低。當(dāng)電壓降到1/3 vcc時觸發(fā)器引腳2使引腳3變?yōu)関cc并且通過led激活555。將引腳7從地面上斷開,電容器開始通過ra和rb再次充電。從以前的電路上構(gòu)建這個電路,做法如下:斷開電源。去掉引腳6和引腳7之間的跨接線,用2.2k的電阻來代替(rb=2.2k)用引腳2處的跨接線連接引腳2和引腳6。現(xiàn)在重新連接電源并且led應(yīng)該始終閃爍(只要電源是開著的)。用不同阻值的ra和rb做實驗看一下lrd閃爍時間長短的變化(你可以改變電容器充放電時間的長短)。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. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論