Escolar Documentos
Profissional Documentos
Cultura Documentos
# @ sens)vel a n)vel;
% @ sens)vel a borda;
Interrupes %-ternas do 8051 Interrupes %-ternas do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
4 interrupo $erial"
E(erc)cio
O circuito
Interrupes do 8051 Interrupes do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
O +rograma
#include <reg52.h>
sbit LED !2"#$%% de&ine ' v'ri'vel LED
%% vincul'd' 'o pino !2.#
bit (led 0$ %% de&ine ' v'ri'vel )ue indic'
%% o est'do do LED
%% De&ine ' &unc'o de 'tendi*ento ' interrupc'o
void 'cendeled (void) interrupt 0
{
i&((led0) %% veri&ic' o est'do 'tu'l do LED
{
(led+$ %% *ud' o est'do p'r' 'ceso
LED+$ %% 'cende o LED
}
else
{
(led0$ %% *ud' o est'do p'r' 'p'g'do
LED0$ %% 'p'g' o LED
}
}
Interrupes do 8051 Interrupes do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
void *'in()
{
,E 0-.+$ %% h'bilit' ' interrupc'o e-tern' 0
/012 0-0+$ %% con&igur' ' interrupc'o e-tern' 0
%% co*o bord' de descid'
(led 0-00$ %% de&ine est'do inici'l do LED co*o
%% 'p'g'do
LED 0-00$ %% 'p'g' o LED
3hile(+)$ %% per*'nece e* loop in&inito
}
Te*pori3adores do 8051 Te*pori3adores do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
T%+4!I5$#4!%0624'T$#4!%0
T%+4!I5$#4!%0624'T$#4!%0
Te*pori3adores do 8051 Te*pori3adores do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
contagem de tempo;
contagem de eventos;
etc2
Te*pori3adores do 8051 Te*pori3adores do 8051
2011 - Gabriel Kovalhuk 2011 - Gabriel Kovalhuk
UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial UTF! " #$%&' - Te(nolo)ia e* +e(atr,ni(a Industrial
;egistrador -:O!
-;# -<# -;% -<% *-# *E# *-% *E%
":' "=' "E' "<' ""' ">' "0' "?'
-:O!
,G.