PORT P2 (Pins 21 To 28) Can Also Be Used As A General Purpose 8-Bit Port When No
PORT P2 (Pins 21 To 28) Can Also Be Used As A General Purpose 8-Bit Port When No
1. The Intel 8051 is an 8-bit microcontroller which means that most available operations
are limited to 8 bits. There are 3 basic "sizes" of the 8051: Short, Standard, and
Extended. The Short and Standard chips are often available in DIP (dual in-line
package) form, but the Extended 8051 models often have a different form factor, and are
not "drop-in compatible". All these things are called 8051 because they can all be
programmed using 8051 assembly language, and they all share certain features
(although the different models all have their own special features). They consist of 32
bank register + 16-bit addressable register + 80 general purpose register]
BASIC PINS AND OPERATIONS
1. PORT P1 (pins 1 to 8) is an 8-bit bi-directional I/O port with internal pullups. The
port 1 output buffers can sink/source four TTL inputs. When 1s are written to port 1
pins they pulled high by the internal pullups and can be used as inputs. As in this
project port 1.0 and 1.1 is connected to switch which acts when its pressed it
increases the value of the 7-line segment display. While the port 1.3 is used for
2.
buzzer.
PORT P2 (pins 21 to 28) can also be used as a general purpose 8-bit port when no
external memory is present, but if external memory access is required then PORT P2
will act as an address bus in conjunction with PORT P0 to access external memory.
PORT P2 acts as A8-A15. In this project the 7-line segment display is connected to
pins, 2 external counter inputs, read and write pins for memory access. In this
project the USB with the TXD-3.1 (serial output port) and RXD-3.0 (serial input
port) was used to transmit data from the incremented value to the internet
(freeboard.io).
4. PORT P0 (pins 32 to 39) PORT P0 can be used as a general purpose 8 bit port
when no external memory is present, but if external memory access is required then
PORT P0 acts as a multiplexed address and data bus that can be used to access
external memory in conjunction with PORT P2. P0 acts as AD0-AD7. In this project
the port was used connect the microcontroller to all the 7-line segment. The
incremented values in registers will be send to all the 7-line segment.
5. PIN 9: PIN 9 is the reset pin which is used to reset the microcontrollers internal
registers and ports upon starting up.
6. PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only
connect a crystal at these pins to provide clock pulses to the circuit. Hence a crystal
oscillator was used to provide the clock pulse thats is with 12Mhz.
7. PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively.
7 LINE SEGMENT
This 7-line segment was used in the project to show the service and queue number.
FIGURE 1
1. A seven segment display consists of seven LEDs arranged in the form of a
squarish 8 slightly inclined to the right and a single LED as the dot character.
Different characters can be displayed by selectively glowing the required LED
segments. Seven segment displays are of two types, common cathode and common
anode. In common cathode type, the cathode of all LEDs are tied together to a single
terminal which is usually labelled as com and the anode of all LEDs are left alone as
individual pins labelled as a, b, c, d, e, f, g & h (or dot). In common anode type, the
anode of all LEDs are tied together as a single terminal and cathodes are left alone as
individual pins.
2. In this project, common cathode was used. According to figure 1 of common cathode
7-line segment. The pin of a was connected to port 0.0, b was connected to port
0.1, c was connected to port 0.2, d was connected to port 0.3, e was connected to
port 0.4, f was connected to port 0.5 and g to port 0.6.
3. The wiring from the first 7-line segment display was then connected accordingly to
the second 7-line segment display.
4. The com 1 and com 2 of both 7-line segment display is connected to a transistor
collector leg and the respective wire of base is then connected to port 2.0 to 2.3. The
emitter of transistor leg was connected to ground.