Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Basic query of reset in 8051 uC

Status
Not open for further replies.

Monu johar

Newbie level 5
Joined
Aug 19, 2012
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
I am using 8051...and burn a programm in it as :-


Code ASM - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
org 000h
mov tmod,#20h
mov scon,#50h
mov th1,#-3
setb tr1
clr ri
here: jnb ri,here
clr ri
mov a,sbuf
mov p2,a
sjmp here
end



now my query is that if i reset microcontroller from 9th pin..after burning the program...then all ports become input ports...if value in sbuf is 00110101. That should be present on port2 ,as by the code.. Here the port 2 is acting like output port..but on reset it is input port..now i want to know that will the data bits of sbuf come on port pins or not?
 
Last edited by a moderator:

are you getting the data without resetting it?? if not then do mov a,sbuf before clearing ri
 

For 8051, unlike PIC, the I/O pin is input as long it is 1 (due to its open collector output). Also it acts anytime as an output pin if it is set by the program as 1 or 0.

Notes:

(1) While a pin is set as 0, the pin cannot be used as an input terminal.
(2) Usually when a pin is needed as an output terminal, an external pull-up resistor may be added for its 1 state since its internal pull-up (if it exists) is rather of a high resistance.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top