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.

8051 compatible MCU (Atmel 89S52) : Input questions

Status
Not open for further replies.

Harold S.

Newbie level 1
Joined
Jun 8, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
8051 questions

I'm completely new to microcontrollers. I decided to start my experiences with a 8051 compatible MCU (Atmel 89S52).

Prior to learning assembler programming I find it very important to fully understand the internal architecture, but there's a confusing point for me:

In a 8051 textbook I read the following phrase :

"Never forget setting the port(pins) to '1' before any attempt of reading it!"

Please assume that the pin is hooked to Vcc via an external 10K Pullup resistor and the Switch directly to GND.

case 1)
Port pin set to '1': (e.g.: SETB P1.0 ;Port 1 , Pin 0 = 1 )
Switch open: Pin remains High ('logic 1')
Switch closed: Pin easily pulled down to GND (because of the very weak internal Pullup), so Latch is now 'logic 0'

Question: Is this a typical "active low" - confíguration??


case 2)
Port pin set to '0':
Switch open: Pin remains High (pulled up by Vcc through external pullup resistor). => latch = '1'
Switch closed: Pin pulled down to to GND, so latch is '0' now.

According to different 8051 sources, case 2) doesn't work. But why??

Question: Please explain why case 2) is impossible? I really don't understand...

Thx in advance!
 

8051 input

**broken link removed**
 

8051: Input questions

I'm not familiar with the part that you are using, but generally microcontrollers can set the direction of IO pins. Effectively there is a second register for each pin which sets the pin into tristate. This must be what your textbook is telling you to do. If you do not set the pin to tristate (or input state), applying any external signal could result in a short.

Your case 1 is definitely a typical active low setup - provided that the input mode or tristate is activated.

You can even consider using a 20k - 100k pullup. The value depends mostly on your application.
 

Re: 8051: Input questions

Your specsheet will show you high/low levels.
In condition 2, outputting a '0' causes the pin to sink. You would then need to overdrive it's sinking capacity to create a high state. Not advised.
 

Re: 8051: Input questions

8051 output structure,
week 1
strong 0
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top