P. 1
Ho Vi Dieu Khien 8051 Tong Van On

Ho Vi Dieu Khien 8051 Tong Van On

|Views: 1,099|Likes:
Được xuất bản bởibuilen

More info:

Published by: builen on Oct 22, 2009
Bản quyền:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

02/18/2013

pdf

text

original

Chuang 1 ; Gidi thieu

1~

1

-r-

GIOI THIEU

.

1.1 Md DAU

(,I

\

Vao nam 1971 t~p dean Intel da: gioi thieu 8080, bi? vi xu ly ( microprocessor) thanh corig dau tien. Sau do khcng lau Motorola, RCA, ke den Ia MaS Technology va Zilog da gidi thieu cac bi? vi xu ly tuong hI ; 6800, 1801, 6502 va Z80. Ban than cac vi mach ( IC ; integrated circuit) nay tuy khong co nhieu hieu qua su dung nhung khi Ia mi?t phan cua mot may tinh dan board ( single-board computer ), chung trd tha nh thanh phan trung tam trong cac san pham co Ich dung M nghie n cuu va thie't ke'. Cac may t.inh dan board nay, trong do co D2 cua Motorola, KIM-1 cua MaS Technology va SDK-85 cua Intel la dang ghi nhri nhat, da nhanh chong xarn nhap vao cac phong thi nghiern thiet ke cua triro ng' trung hoc, trunng da i hoc va cac cong ty dien tu.

Vao narn 1976 Intel gidi thieu bi? vi di~u khien ( microcontroller ) 8748, mot chip tucng tI! nhu cac bi? vi xu ly va la chip dau tien trong ho vi dieu khien MCS-48. 8748 la mot vi mach chua tre n 17000 transistor bao g6m mot CPU, 1 K byte EPROM, 64 byte RAM, 27 chan xua t nhap va mot bi? dinh thai 8-bit. IC nay va cac IC khac tiep theo cua ho MCS-

~.?*t Wi .nhanh chong trd' thanh chuan cong nghiep trong cac irng dung

, trong di~u khi~n ( control-oriented application ). Viec thay the cac thanh phdn co' dien trong cac san pharn nhu cac may gi~t va cac bi? dieu khien den giao thong la mot ung dung ph6 bien ban d§u. Cac san phdm khac rna trong do bi? vi di~u khien duoc tim thay bao g6m xe 0 to, thiet hi cong nghie p, cac san pham tieu dung va cac ngoa i vi cua may tfnh ( ban phirn cua IBM-PC Ia mo t thi du su dung bi? vi dieu khien trong cac thie't ke' toi thi~u thanh phan ).

f)Q phirc tap, kich thirdc va kha nang cua cac bi? vi dieu khi~n diroc tang them mi?t bac quan trong vao narn 1980 khi Intel cfmg bo chip 8051,bQ vi di~u khien d§u tien cua ho vi di~u khien MCS-51. So vdi 8048, chip 8051 chua tren 60000 transistor bao g6m 4 K byte ROM, 128

r!j2

H<;> vi dieu khian 8051

byte RAM, 32 dinrng xuat nhap, 1 port n6i tiep va 2 bi? dinh thoi 16-bit - mot so' hrong mach dang chii y trong mot IC don. Cac thanh vieri moi diroc them vao cho ho MCS-51 va cac bian th~ ngay nay g~n nhl1 co ga'p d6i cac d$c trung nay. Tap doan Siemens, ngudn san xua't thli' hai cac bi? vi dieu khien thuoc ho MCS-51 cung cap chip SAB80515, mot ca i tieri cua 8051 chua trong mo t vo 68 chan, co 6 port xuat nhap 8-bit, 13 nguon tao ra ngilt va mot bi? bien d6i AID 8-bit vdi 8 kenh ng6 vao. H<;> 8051 Ia met trong nhirng bi? vi di~u khidn 8-bit manh va linh ho~tnha't da trd thanh bi? vi die u khi~n hang dilu trong nhirng narn gan day.

Quy~n sach nay khao sat ho vi di~u khien MCS-51. Cac chirong tiep theo gidi thieu cau true pha n cirng va phan mern cua ho MCS-51, dong thni chirng minh qua nhieu th i du thiat ke', each rna ho vi dieu khien nay c6 the tham gia vao cac thie't ke' dien ttl.' vci so' thanh phdn them vao t6i thieu.

Trong cac muc sau cua chuong nay, thong qua viec gidi thieu vat t<'it v~ cau true may tinh, ta se phat trien tit vung cua nhieu tit diroc cau tao tit chtr dau cua cac tit khac va cac tit dang dl1qc stl.' dung ph6 bieri nhung d~ nharn hln trong linh vue nay. Do nhieu thuat ngtr co dinh nghta mo ho va trung la'p phu thuoc vao dinh kien cua cac tap doan len va cac y chot nay ra cua nhieu tac gia khac nhau, each gia i quyet cua chung ta mang tinh thuc tien hon la triru tircng. M6i met thuat ngir duoc gidi thieu trong khung canh chung nhat cling vdi su gia i thich ro rang.

1.2 THU~T NGU

Mi?t may tinh ( computer) duoc dinh nghia bdi hai diem chinh :

kha nang duoc l~p trinh de thao tac tre n du Iieu rna kh6ng can den su can thiep cua con ngmri.

kha nang luu tru va kh6i phuc dtr lieu

T6ng qua t hon, mot h~ may tinh ( computer system ) cung bao g6m cac thiet bi ngoai vi ( peripheral device) de truyen thong vci con nguui cung nhir cac chirong trrnh ( program) de xtl.' ly du Iieu. Thie't bi la pha n cirng ( hardware ) va chucng trinh la pha n mern ( software ). Chung ta hay bat dau vdi phdn cirng cua may tfnh bang each khao sat hinh 1.1.

Hinh 1.1 la so do khdi don gian, khong chi tie't mot each co' y nharn muc dich tieu bieu cho ta't ca cac loai may Hnh. Nhu ta da tha'y, mo t M may tinh bao g6m mot don vi xtl.' ly trung tam CPU ( central processing unit ), don vi nay ke't n6i vdi bi? nho truy xuat ng<lu nhien RAM ( random access memory ) va bi? nho c.hi doc ROM ( read only memory ) thong qua bus dia chi ( address bus ), bus dir Iieu ( data bus) va bus dieu

Clnnrng 1 : Gidi thieu

3 ~

khien ( control bus ). Cac mach giao tie'p ( interface circuit) ke't nfii cac . bus cua M thong ( go i tat hi bus M thong ) vdi cac thiet bi ngoai vi. Ta SEl d~ cap chi tie't cac dan vi vita neu tren.

CPU

Hmh 1.1 : Sa db khoi cua mi?t h~ may vi tinh CPU: dan vi xi'lly trung tam

RAM: bi? nho truy xuilt ngtiu nhie n ( hay bi? uho doc / ghi ) ROM: bi? nho chi doc

Interface circuitry: mach giao tiep Peripheral devices: ca c thiet b] ngoa i vi Address bus: bus dia chi

Data bus: bus dtr Iieu

Control bus: bus dieu khien

1.3 DdN vr xrr LV TRUNG TAM

CPU, tra i tim cua h~ may tfnh, quan ly ta't ca cac heat do ng cua h~ va thuc hien ta't ca cac thao tac tren dft lieu. H§u he't cac CPU chi bao g6m mot t~p cac mach logic thl!c hi~n lien t1,lc hai thao tac : tim nap l~nh va thl!c thi l~nh. CPU co kha nang hi~u va thuc thi cac lenh dira tren mot hlp cae rna nhi phan, mlii mo t rna nhi phan bi~u thi mo t thao tac d5n gian. Cac l~nh nay thinrng la cac lenh s6 hoc ( nhir cong, trir, nhan, chia ), cac l~nh logic ( nhu AND, OR, NOT, v.v ... ), cac l~nh di chuyen da Iieu hoac cac lenh re nhanh, dircc bi~u thi bdi mo t t~p cac rna nhj phan va duQ'c goi la t~p lerrh ( instruction set ).

Hinh 1.2 cho ta mot cai nhin nft dan gia n ben trong cua CPU. Hinh nay trinh bay mo t tap cac thanh ghi ( register) co nhiern V1,l hru gift tarn tho-i cac thong tin, mo t dan vi s6 hoc logic ALU ( arithmetic-logic unit)

r

~4

H9 vi dieu khien 8051

co nhie m vu thuc hien cac thao tac tran cac thong tin nay, mot don vi gia i rna lenh va dieu khien ( instruction decode and control unit) co nhiern vu xac dinh thao tac can thuc hien va thiet lap cac hoa t di?ng can thiet M thuc hie n thao taco CPU con co hai thanh ghi 1lI1a : thanh ghi le nh IR ( instruction register) luu giu rna nhi phan clla lEmh de diroc

,-- .. .

thuc thi va bi? dem chuong trinh PC ( program counter) luu giu dia ~i

cua l~nh ke tiep trong bi? nhc dn dinrc thuc thi.

CI'U

lustrur-nou n~gH;rl~1' ([H)

Progr-am counter fPC)

Register-s

lnst.rucr ion uccodo and cont rol unit

Aritfnuet.ic and logic um t

Hinh 1.2 : Ban V! xi11y trung tam CPU CPU: dan V! xi11y trung tam

Instruction register ( IR ) : thanh ghi leuh ( IR )

Instruction decode and control unit: dan V! giiii rna Ie nh va di€u khi€n Program counter ( PC ) : hi? de'm chuang trlnh (PC)

Registers : ca c thanh ghi

Viec tim nap mot lenh tit RAM h~ thcng 13 mot trong cac thao tac cd ban nhat rna CPU thuc hien. Vi~c tim nap le nh diroc thuc hien theo cac bunc sau :

ndi dung cua PC duoc dat len bus dia chi

tin hieu dieu khien READ dtt<;fc xac l~p ( chuyen sang- tra ng thai tich cue )

du lieu ( opcode cua lenh ) duoc d9C tir RAM va dira len bus dir Iieu

opcode dtt<;fc ch6t vao thanh ghi l~nh ben trong CPU PC diroc tang M chuan bi tim na p lenh ke' tlt bi? nho

Chuang 1 : Gidi thieu

5 (!l

-----

Hinh 1.3 minh hoa luong thong tin cho viec tim nap l~nh.

CPU
Address bus (
/ '\
I N I I
Program
counter Data bus (
'"
: I Opcode I 1 ~
Instruction
register
RAM
N+Z
Cont rol N + 1
bUH Opcode
Clock N
Head ""L...J":. N·l
~ Hinh 1.3 : HO:;1t dQng cua bus cho chu ky tim na p l~nh CPU: dan vi xii ly trung tam

Program counter: bi? de'm chuang trinh Instruction register: thanh ghi l~nh Clock: chan xung clock

Read: chan di~u khign doc

Address bus : bus dia chi

Data bus: bus du Iieu

Control bus: bus di~u khien

Giai doan thuc thi l~nh bao g6m viec gia i rna opcode va tao ra cac tin hieu di~u khieri, cac tin hieu nay di~u khien vi~c xuat nhap giiia cac thanhghi noi vdi ALU va thong bao d~ ALU thuc hien thao tac da dircc xac dinh. Do cac thao tac co t§m thay d6i rong, pharn vi da nh cho cac giai thich vira neu tren co phan nao bi gioi han, chi ap dung dU<;1c cho cac thao tac dan gian nhu tang noi dung cua mo t thanh ghi. Cac lenh phirc tap han doi hoi them nhieu birdc ntra, chang han nhu d9C byte du li~u thii hai va byte dir Iieu thii ba M thuc hien thao taco

Mi?t chu6i cac lenh duoc ke't hop M thuc hien met cong viec co y nghia dU<;1C goi la mot chuang trinh ( program) hay phan me m ( software ). Mire di? rna nhirng cong viec duoc thuc hien dung va co hieu qua phan Ion dU<;1C xac dinh bdi c4i.t.l!!<;1ng cua ph§n1Jl~m, khcng phai bo i su phirc tap cua CPu. V~y thi cac chuang trmh " dieu khian " CPU trong khi lam viec do i khi d§.n den sai nhdrn, chinh Ia do nhtrng nhinrc di~m cua cac tac gia chuang trinh. Cac diu nhu la " may tinh tao ra mot 16i " la sai. Mac du thiet bi co su c6 la di~u khong the tranh dU<;1C, cac 16i dU<;1C tao ra thinrng la dau hieu cua cac chuang trinh t6i hoac 16i cua ngu'di dieu khi~n.

H<;> vi dieu khign 8051

1.4 BQ NHO BAN DAN: RAM vA ROM

Cac chucng trinh va du Iieu duoc hru giu trong bi? nho. Cac bien the cua bi? nho may tinh va cac thanh phan kern then rat da dang, va co ng nghe thinrng bi dot pha nen viec nghien ciru lien tuc va bao quat bi? nhri do i hoi pha i theo kip cac phat trien mo i nhat. Cac bi? nho duoc truy xuat true ticp bdi CPU bao g6m cac IC ban d§n go i Ia RAM va ROM. Co hai dac trung dung d{'; phan biet RAM va ROM: thir nha t RAM la bi? nho doc / ghi trong khi ROM la bi? nhc chl doc, tha hai RAM khong tie'p tuc luu giu no i dung khi bj mat nguon cap dien trong khi ROM thi nguoc la i.

Hau he't cac he may tinh d~u eo 6 dla va mot dung lucng ROM nho chi can du dg hru giu cac chuong trmh ngan, thinrng sit dung, nharn thuc hien cac thao tac xuat nhap, Cac chuong trinh va du Iieu cua nguni sit dung duoc hru tren dla va duoc na p van RAM M thuc thi. Vdi gia thanh lien tuc duoc giarn thap, cac M may tinh nho thinrng chua bi? nho RAM tU hang tr ieu byte de'n hang tram trieu byte.

1.5 cAc BUS: DJA CHi, DU Ll¢U vA DIEU KHIEN

Mi?t bus la mo t t~p cac day mang thong tin eo cung mot muc dich.

Viec truy xuat tdi mot mach xung quanh CPU sit dung ba bus: bus dia chi, bus du lieu va bus dieu khien. Vdi mbi thao tac doc hoac ghi, CPU xac dinh ro vi tri cua du Iieu ( hoac lenh ) bang each dat mot dia chi len bus dia chi, sau do tieh cue mot tin hieu tre n bus dieu kh ien M chi ra thao tac la doc hay ghi. Thao tac doc lay mot byte du Iieu tir bi? nhri d vi trf da xac dinh va dat byte nay len bus du lieu. CPU doc dtr Iieu va da t dir lieu van mot trong cac thanh ghi no i cua CPU. Vdi thao tac ghi, CPU xua't du lieu len bus dtr lieu. Nho' van tin hieu dieu khien, bi? nho nhan biet day la thao tac ghi va hru du Iieu van vi tri da ducc xac dinh.

Hau he't cac may tinh nho eo tir 16 den 32 dinrng dia chl va eo kha

-- .,

nang truy xuat 2" vi tri nho. Mi?t busdta ehi 16-blt do v~y eo thL!ruy

xuat mot bi? nho eo 64 K vi tri nhd, mot bus dia chi 20-bit eo kha nang truy xuat 1 M vi tri"'nhd va mo t bus dia chi 32-bit eo kha nang truy xua t den 4 G vi tri nho ( 1 K = 1024, 1 M = 1024 K va 1 G = 1024 M ).

Bus du lieu mang thong tin giua CPU va bi? nho ciing nhu giua CPU va cac thiet bi xuat nhap. Viec e6 gang' nghien ciru bao quat phan Ion diroc dung vao viec xac dinh loa i cac hoat dong' lam mat nhieu thoi gian thuc thi dang gia cua may t.inh. Hien nhien la may tinh sit dung den 2/3 t.h<'ti gian vao cac viec di chuyen du Iie u. Vi da s6 cac thao tac di chuyen dif Iieu xay ra giira mo t thanh ghi cua CPU vdi 'ROM va RAM ngoa i, s6 duorig ( hay dQ rong ) cua bus dif Iieu rat quan trong d6i vdi hieu suat, tong' the cua may tinh. Gidi ha n b6'i di? rong nay eo dang e6 ehai : eo thg

Chucng 1 : GiO'i thieu

7~

co mot hrcng r§t len bi? nhd trong he thdng' va CPU co th~' co kha nang tfnh toan r§t 1O'n nhung viec truy xuat dv lieu - di chuyen dv lieu gifra bi? nho va CPU thong qua bus dv lieu - thinrng bi nghen nhu c6 chai do de;> re;>ng cua bus dv lieu.

Di~u nay ra't quan trong nen ngudi ta thucng them mot. tieu to ( trong tieng Anh ) d~ chi ra su md rcng M tranh hie n tucng c6 chai. Cau may tinh 16-bit chi ra ding may tfnh co 16 dUdng dv lieu. Cac may Huh duoc pha n loa i 4-bit, 8-bit, 16-bit, 32-bit co kha nang tmh toan t6'ng the tang khi de;> re;>ng cua bus dv lieu tang.

Liru y la bus dv lieu, nhu ducc chi ra trong hinh 1.1, lit ~us hai chieu con bus dia chi l~ bus me;>t chieu. Cac thong tin dia chi luon luon duoc cung cap bdi CPU ( dircc chi bdi miii ten trong hinh 1.1 ) trong khi dv lieu di chuyen theo c3. hai hirdngtuy thue;>cVao thao tac dircc du dinh la doc hay ghi. Cung hru y lit thua t ngir " dv lieu "du<1c sU' dung thea nghia t6ng quat: " thong tin" di chuyen tren bus dv lieu eo th~ la lerih cua chmrng trinh, dia chi theo sau l~nh hoac dtr lieu ducc ,sU' dung bdi chirorig trinh.

Bus dieu khieri la me;>t h6n hcp cae tin hieu, mo imct tin hieu co mot vai tro rie ng trong viec dieu khien co trat tl/ heat di?ng cua h~ thong. Theo l~ thircng, cac tin hieu dieu kh ieri la cac tin hieu dinh thc i duo'c eung cap bdi CPU M d6ng bi? viec di chuyen thong tin tre n cac bus din chi va dv lieu. Mac du thong thinrng co ba tin hieu nhu la CLOCK, READ va WRITE d6i vdi viec di chuyen dv lieu cd ban giva CPU va be:> nhd, ten va hoat dong cua cac tin hieu dieu khien phu thuoc nhieu VaG CPU cu the. Ta can nghien ciru chi tiet cac tham khao ky thuat cua cdc nha san xuat.

1.6 cAc THlET BJ XUAT NH~P

Cac thie't bi xuat nhap hay cac thiet bi ngoai vi cua may tinh cho ta dUdngtruy~n thong giira he may tinh vdi the' gici ben ngoai. Kho ng eo cac thiet bi ngoa i vi, cac he may tinh chi la nhirng chiec may bi thu hE?P va it diroc sU' dung. T6ng quat co ba loai thie't bi xuat nhap la cac thief bi hru tru 1O'n, cac thief bi giao tiep vO'i con nguo i va cac thiet bi dieu khien ! kiem tra.

1.6.1 Cac tb ie't hi hru trii' IOn

Cung nhu cac bi? nhd ban dan RAM va ROM, cac thiet bi hru tru ldn luon luon tang trucng va phat tri~n. Nhu te n go i, cac thiet bi luu tru IO'n luu trv cac hrcng 1O'n thong tin ( chucng trmh hoac dv lieu ) rna cac thong tin nay khOng the chua du trong RAM tirong doi nho ( con goi Iii bi? nhd chinh ) cua may tinh. Thong tin nay phai ducc nap vao trong bo

HI? vi di~u khien 8051

nhd chinh trudc khi CPU truy xUllt chiing. Neu ta phan loai theo su truy xuat, cac thiet hi hill tru kin hoac thuoc loai online hoac thuoc loai archival. BQ hru tru loai online thinrng la dla tU thich hop vdi CPU khong co sir can thiep cua con nguiri khi yeu du mo t chuong trinh, hQ hru tru archival thinrng la dia hoac hang tli mac du cac dia quang nhu la CD-ROM hoac cong nghe WORM hien dang du«?,c ua chuong va co the thay the cac hq hru tru archival do dq tin cay, kha nang luu tru va gia thanh thap.

1.6.2 Cac thie't hi giao tie'p v6'i eon ngu'oi

Viec lien ket con nguni va may du«?,c thuc hien qua nhieu thiet hi giao tiep vdi con nguci rna thong thinrng nhat la thiet hi dau cudi hien th] video VDT ( video display terminal ) va may in. May in la thiet hi xuat con cac VDT thuc ra la 2 thiet hi vi chung chua mot han phim M nhap va met den tia am eire CRT ( cathode ray tuhe ) M xuat, Mqt llnh vue ky thuat, ducc goi la " cac nhan to' con nguci ", da phat trien tU nhu cau thiet ke cac thiet hi ngoai vi cho con ngtnri vci rnuc dich la an toan, tien nghi va hieu qua cung vdi cac dac tinh cua con nguO'i d6i vo i nhirng may rna con nguui sa dung. Tli do ta tha'y co nhieu cong ty san xuat ra cac thiet hi ngoai vi hen la cac cong ty san xua't ra may tinh.

DO'i vdi hau het cac he may tinh, thutrng' ta co t6i thieu 3 thiet hi : mot ban phim, mot CRT va mot may in. Cac thiet hi khac giao tiep vdi con nguo-i hao g6m : dn dieu khien tro chrri, but sang, con chuot, ong noi, loa v.v ....

l

1.6.3 Cac thie't bi di~u khie'n I kie'm tra

NhO' vao cac thiet hi di~u khien I kiern tra, cac may tinh co the thuc hien vo so cac tac vu hucng dieu khien cling nhu thuc hien chung khong ngoi nghi, khong met mo i va dieu nay vU«?'t xa kha nang cua con nguni. Nhieu li'ng dung trong dO'i song hoac trong cong nghiep sa dung cac thiet hi nay.

Cac thiet hi di~u khien la cac thiet hi xua't hoac cac hi? kich thich ( actuator ), cac thiet hi kiem tra la cac thiet hi nhap hoac cac cam bien bien d6i cac dai hrcng phi dien nhu nhiet, anh sang, ap suat, v.v ... thanh cac dai hrong dien nhu dien ap hay dong dien de may tinh doc. Mach giao tiep bien d6i dien ap hay dong dien nay thanh cac rna nhi pha n hoac nguoc lai va thong qua phan mem, mot quan h~ du«?,c thiet lap giua cac thiet hi nhap va cac thiet hi xua't.

Vi~c giao tiep bang phan cung va phan mem gitra cac thiet hi nay voi cac hi? vi dieu khien la mot trong cac chu de chinh cua quyen sach nay.

Chirong 1 : Gidi thieu

9 ~

1.7 CHUONG TRINH: LON vA NHO

Cac thao luan a trim t!%p trung vao phan cang ciia cac h~ may tinh, cac chuong trinh hoac phan mern dieu khien phan cung lam viec chi mdi d~ cap qua. T§.m quan trong tuong doi ciia phan ciing so vdi pQ;ln me m da dl19'c dich chuyen mot each ro r~t trong thap nien cudi cua the ky 20. Trong khi truce day gia san xUllt va bao trl phan cirng cua may tinh rat diit so vdi gia thanh cua phan mern, ngay nay vdi cac chip co di? tich hcp cao LSI ( large scale integrated) va ra't cao VLSI ( very large scale integrated) gia thanh cua phan cirng giarn di i-a't nhieu. Cac cong viec doi hoi nghien ciiu sau nhu viet, cung cap va thu th!%p tu Iieu, bao tri, cap nhat va phan phoi phan mern chiem phan kin gia thanh trong viec W dQng h6a qua trinh s\t dung cac may tlnh.

system

Operating

(command language, utilitios I

Input/output subroutines Ieceess to hardware i

Hardware

Hinh 1.4 : Cac ca'p phdn m~m Applications software : phan m~m (fng dung

User interface: giao dien v6'i nguoi sli dung

Operating system : h~ di~u hanh

~ Command language, utilities: ngon ngu l~nh, cac ti~n ich Input/output subroutines: cac chuong trlnh con xuti't nhap Access to hardware: troy xua't de'n phrin crrng

Hardware: phdn cung

Ta hay khao sat cac loai phan mern khac nhau. Hinh 1.4 minh hoa ba cap phdn mern co vi tri a giira ngtnri sli' dung va phdn cung cua mi?t h~ may tinh : phan mern ang dung ( application software ), h~ dieu hanh ( operating system) va cac chuong trinh con xua't nhap ( input/output subroutine ).

d cap thap nhat cac chuong trlnh con xuat nhap true tiep quan ly phan cirng cua M th6ng, doc cac ky tlf tit ban phim, dua cac ky W len CRT, doc mi?t khdi thong tin tit dia va V.v ... Do cac chuong trinh con nay

~10

HC? vi dieu khien 8051

lien ket mat thiet vdi phan cirng, chung ducc viet bdi cac chuyen gia thiet ke phan cirng va thinrng diroc hru gift trong ROM ( cluing la h~ xuat nhap co ban BIOS [ basic input output system] tren may tfnh ca nha n PC [ personal computer] cua IBM chang han ) .

..

Be giup cho ngmri lap trinh de dang truy cap den phan cirng cua he thong, cac dieu kie n nhap va thoat duoc xac dinh met each ro rang doi vdi cac chuang trmh con xuat nhap. Ngu<'1i lap trinh chi dn khci'i di?ng cac gia tri cho cac thanh ghi cua CPU va go i chuang trinh con: thao tac can thiet dircc thuc thi va ket qua se tra v~ trong cac thanh ghi cua CPU hoac hru la i trong RAM he thong.

Be b6' sung day du cho cac chuang trinh con xua't nhap, ROM chua mot chuang trinh kho i di?ng ( start-up program ), chuang trmh nay diroc thuc thi khi h~ thong diroc cap dien hoac diroc thiet l~p lai ( reset) bang tay. Ban chat khong bi milt ni?i dung cua ROM duqc sU' dung & day vi chuang trinh khdi di?ng pha i hien hiru trong thc i gian khdi do ng h~ thong. Chuang trinh nay kiem tra cac tuy chon, khdi di?ng bi? nhc, thuc hien viec kiem tra chan doan hu hOng v.v ... Cudi cung nhung khong kern quan trong, mot trinh nap bootstrap ( bootstrap loader) doc track dau tien ( mot chuong trinh nho ) tir dia vao RAM va chuyen dieu khien t.di chuang trinh nho nay de nap phan tlunrng tru trong RAM cua h~ dieu hanh ( mo t chirong trinh 16'n ) tlt dia va chuyen dieu khien tdi chuang trinh krn nay, hoan tilt viec khdi di?ng he thong.

H~ dieu hanh la mo t tap hop Ion cac chuang trinh dircc nap vao trong mdt h~ may tinh nharn cung cap cac co che truy xuat, quan If va sti' dung mo t each co hieu qua cac tai nguyen ( resource) cua may tinh. Cac khd nang nay diroc the hien thong qua ngo n ngir l~nh di~u khien ( command language) va cac chuang trinh ti~n ich ( utility program) cua h~ dieu hanh, va den luqt chiing tao dieu kien thuan lei cho viec phat trien cac phan mern ung dung. Neu mot phan mern ti'ng dung diroc thiet ke' tot, ngmri sU' dung tac dong tirong h6 vo i may tinh rna khcng can co kien thirc nhieu ve h~ dieu ha nh. Cung cap mot giao dien vrii ngire i sti' dung mot each an toan, hieu qua la mo t trong cac muc tieu co ban cua vi~c thiet ke cac phan mern irng' dung.

1.8 MICRO, MINI vA MAINFRAME

Chung ta phan loai may tinh dua theo d(l ldn va kha nang tinh toan : may vi tinh ( microcomputer ), may tinh mini ( minicomputer) va may tinh mainframe ( mainframe computer ). Bi(tc diem chinh cua may vi tlnh 13. kich thirdc va kha nang dong go i cua CPU. May vi tinh chua ben trong met vi mach tich hop dan go i la bi? vi xU' If ( microprocessor ). Cac may tinh mini va mainframe thi phirc tap hon trong tang chi tie't cau

You're Reading a Free Preview

Tải về
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->