Harold S.
Newbie level 1
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!
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!