P. 1
The 8051 Micro Controller and Embedded Systems Using Assembly and C-2nd-Ed

The 8051 Micro Controller and Embedded Systems Using Assembly and C-2nd-Ed

4.5

|Views: 336|Likes:
Published by api-27236542
The 8051 Microcontroller and Embedded Systems Using Assembly and C-2nd-ed.pdf by Muhammad Ali Mazidi, Janice Mazidi and Rolin McKinlay.......full book
The 8051 Microcontroller and Embedded Systems Using Assembly and C-2nd-ed.pdf by Muhammad Ali Mazidi, Janice Mazidi and Rolin McKinlay.......full book

More info:

Published by: api-27236542 on Oct 18, 2008
Copyright: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

11/21/2015

pdf

text

original

Assume that bit P2.3 is an input and represents the condition of an
oven. If it goes high, it means that the oven is hot. Monitor the bit
continuously. Whenever it goes high, send a high-to-low pulse to port
P1.5 to turn on a buzzer.

Solution:

HERE: JNB P2.3,HERE ;keep monitoring for high

SETB P1.5

;set bit P1.5=1

CLR P1.5

;make high-to-low

SJMP HERE

;keep repeating

Department of Computer Science and Information Engineering
National Cheng Kung University, TAIWAN

22

HANEL

I/O BIT
MANIPULATION
PROGRAMMING

Checking an
Input Bit

(cont’)

You're Reading a Free Preview

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