Page 73 - CITS - Electronic Mechanic - TT - 2024
P. 73

ELECTRONICS MECHANIC - CITS


            Input/Output Ports (I/O Ports)


           All 8051 microcontrollers have 4 I/O ports each comprising 8 bits which can be configured as inputs or outputs.
           Accordingly, in total 32 input/output pins enabling the microcontroller to be connected to peripheral devices are
           available for use. Pin configuration, i.e. whether it is to be configured as an input (1) or an output (0), depends
           on its logic state. To configure a microcontroller pin as an output, it is necessary to apply a logic zero (0) to
           appropriate I/O port bit. In this case, the voltage level on the appropriate pin will be 0. Similarly, to configure a
           microcontroller pin as an input, it is necessary to apply a logic one (1) to appropriate port. In this case, the voltage
           level on the appropriate pin will be 5V (as is the case with any TTL input). This may seem confusing but don’t lose
           your patience. It all becomes clear after studying simple electronic circuits connected to an I/O pin.














































           Input/Output (I/O) pin
           Figure above illustrates a simplified schematic of all circuits within the microcontroller connected to one of its pins.
           It refers to all the pins except those of the P0 port which do not have pull-up resistors built in.























                                                           58

                                    CITS : E & H - Electronics Mechanic - Lesson 34 - 42
   68   69   70   71   72   73   74   75   76   77   78