saurabheda
Junior Member level 3
AT89S51 microcontroller..
FACT 1 : power ON reset IMPLIES that all the 4 ports are
configured as output by default initially..
FACT 2 : to make a port an input port it is given 0xFF and to make it an output port it is given 0x00..
NOW, take the following scenario-
the microcontroller is powered ON.
now since all the ports are by default OUTPUT , i use P2 to serve some LEDs ..
now i want to make all the 8 LEDs to glow..
i would probably write-
P2=0xFF; <<----
now the DOUBT is, wheather the LEDs will be served or the port P2 will be configured as an input port..?
i.e. the arrowed statement would be considered as a data or a command to configure port..?
FACT 1 : power ON reset IMPLIES that all the 4 ports are
configured as output by default initially..
FACT 2 : to make a port an input port it is given 0xFF and to make it an output port it is given 0x00..
NOW, take the following scenario-
the microcontroller is powered ON.
now since all the ports are by default OUTPUT , i use P2 to serve some LEDs ..
now i want to make all the 8 LEDs to glow..
i would probably write-
P2=0xFF; <<----
now the DOUBT is, wheather the LEDs will be served or the port P2 will be configured as an input port..?
i.e. the arrowed statement would be considered as a data or a command to configure port..?