PaperonReal TimeSystems
PaperonReal TimeSystems
net/publication/360342183
CITATIONS READS
0 1,559
5 authors, including:
All content following this page was uploaded by Obianyo Obianuju on 03 May 2022.
---------------------------------------------------------------------------------------------------------------------------------------
Submitted: 01-04-2022 Revised: 06-04-2022 Accepted: 11-04-2022
----------------------------------------------------------------------------------------------------------------------------------
ABSTRACT system is used when it is imperative that an event
This paper presents the applications of must take place within a strict deadline. Such
microcontrollers in real-time systems. Critical strong guarantee is required of a system for which
analyses of real-time systems and microcontroller if the event does not take place within a certain
were done. A real-time system is a system that its interval of time, would cause a great loss in some
operation is dependent on time condition; while a manner (missing the deadline constitutes failure of
microcontroller is a single chip computer. The type the entire system). For example, a car engine
of microcontroller used in this work for analyses is control system is a hard real-time system because a
AT89C55 microcontroller, and can be used delayed signal may cause an engine failure or
(applied) in several real-time systems. It has a large damage. Other examples of hard real-time
program memory capacity, unlike other embedded systems include medical child incubator
microcontrollers which have little program memory system, industrial process controllers, etc.
capacity. It then means that it can accommodate a
large control program in its memory. Any real-time A soft real-time system on the other hand
system other than the traffic light used as a case will tolerate such lateness, and may respond with
study for this work can as well be handled by just decreased service quality (for example omitting
programming the microcontroller for such frames while displaying a video). Soft real-time
application. Assembly language was used to systems are typically used where there is some
program the microcontroller for different real-time issue of concurrent access and the need to keep a
applications. When the system was tested, it was number of connected systems up to date with
observed that with a good and adequate program, a changing situations; for example, software that
given microcontroller can be used for different maintains and updates the flight plans for
real-time applications. commercial airliners. Live audio-video systems are
also usually soft real-time; violation of constraints
KEYWORDS: Software, microcontroller, real- results in degraded quality, but the system can
time, controller, memory continue to operate [2].
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 97
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
The block diagram of a microcontroller contains at least four or five transistors to store a
like the one used in this research (AT89C55) single bit of data.
consists of the Central Processing Unit (CPU), the The AT89C55 has a bank of 256 bytes of internal
memory unit, and the Input/output unit. RAM.
The CPU - The Central Processing Unit (CPU) of The ROM – A ROM is a non-volatile memory.
AT89C55 microcontroller comprises of the There is an on-chip Read Only Memory (ROM)
Arithmetic and Logic unit (ALU), the Registers, embedded in AT89C55 microcontroller. There are
and the Control unit. different types of ROM: Programmable Read Only
The function of the ALU is to perform all the Memory (PROM), Erasable Programmable Read
arithmetic and logic expressions from or within the Only Memory (EPROM), Electrically Erasable
CPU according to the instruction it receives. Such Programmable Read Only Memory (EEPROM),
arithmetic instructions are addition, subtraction, and Flash. The type of ROM being used by
etc; and logic expressions like AND, OR, NOT, AT89C55 is a 20K EEPROM. Its content can be
etc. erased by applying a suitable electrical voltage to
However, the basic functions performed by the the device.
various registers are essentially the same in all
processors. They are used to store data, addresses, I/O Ports - There are 32 input and output lines,
instruction codes, and information on the status of which make up the four ports of the
various processor operations [3]. microcontroller. The ports enable the
The Control unit controls the internal operations of microcontroller to read and write to external
the microcontroller and sends control signals to memory and other components. The AT89C55 has
other parts of the microcontroller during program four 8-bit I/O ports (Port 0 to 3). As the name
execution. suggests, the ports can act as inputs (to be read) or
outputs (to be written to).
The Memory - Two on-chip memories exist in the
chip. They are the Random Access Memory 1.3 Internal Architecture of AT89C55
(RAM) and Read Only Memory (ROM). Microcontroller
The RAM - This is a volatile type of memory. The The figure 2 shows the internal architecture of a
AT89C55 microcontroller uses the type of RAM typical AT89C55 microcontroller.
called Static RAM (SRAM). Each SRAM cell
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 98
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
The CPU: The Central processing Unit (CPU) of the interrupt. This sequence of actions is handled
the microcontroller comprises of the arithmetic and by the interrupt controller [5].
logic unit (ALU) which performs arithmetic and
logic operations on the data fetched from the data Bus Control: This controls the flow of instructions
memory. It has an instruction decoder that decodes as well as data within the microcontroller. It
machine code instruction words. It also has prevents bus contention.
registers that store operand addresses/instructions
and the control unit [4]. The Timer Counters: Timer 0 and timer 1 provide
time measurement and counts events. It is also
The Interrupt Control: The AT89C55 employed in generating clock pulses (baud rates)
microcontroller has two external interrupt control when the microcontroller is used in serial
pins INT0 and INT1. When the external interrupt communication.
mode is selected, hardware components connected
to these pins can be serviced when they send an The I/O Ports: The AT89C55 microcontroller has
interrupt request IRQ by making either INT0 or I/O ports used for interfacing the microcontroller to
INT1 active (low). When this occurs, the normal external devices like keypads, relays, sensors,
execution of programs stops while the ADCs, etc. Apart from the use as I/O ports, three
microcontroller services the hardware (runs a out of the four ports have alternate functions. Port 0
special subroutine known as the interrupt service and port2 are used when interfacing with external
routine ISR for the interrupting device) and when memory and all the pins in port 3 have alternate
the hardware has been serviced, the program functions as illustrated in Table 1.
execution continues from where it stopped before
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 99
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
Program Memory (On-Chip ROM): This is where addresses 00h-7Fh) are reserved for the user. The
the control programs executed by the remaining 128bytes (memory addresses 80h-FFh)
microcontroller are stored. The sizes and types of are reserved for the special function registers
ROM vary in order to meet consumer’s needs; but (SFR). Figure 3 shows the AT89C55
generally, they are in the other of a few kilobytes microcontroller RAM Structure. However, the
and flash ROMs are common these days [6]. RAM is usually defined with respect to the base
memory available to the user. Hence, if a RAM is
Data Memory (On-Chip RAM): The AT89C55 said to be 128bytes, it means that 128bytes is
microcontroller has an on-chip base memory of available to the user (without taking into account
256bytes; out of which 128bytes (memory the special function registers).
The on-chip data memory is divided as follows: the impracticable. The AT89C55 takes care of the
first 32 bytes made of four memory bank (bank 0- protocols needed for serial communication and all
bank 3) are 8-bit registers with each bank the programmer needs to do is to select the serial
possessing eight registers (R0-R7) of one byte communication mode and the baud rate (number of
each. The next 16 bytes are made up of 128 bit sent/received bits per second) and then the data to
addressable memory locations from 00h through be sent can be placed on the SBUF register [7].
7Fh, occupying 20h to 2Fh of internal RAM. The
remaining 80bytes occupying RAM location 30h to Oscillator: The oscillator produces equalized pulses
7Fh is the general purpose memory/registers. needed to ensure the harmonic and synchronous
operation of all the parts of the microcontroller.
Serial port: The AT89C55 microcontroller has a
universal asynchronous receiver and transmitter 1.4 The Ports/Pins Configuration in AT89C55
(UART) otherwise known as serial port which it Microcontroller
uses for transmission of data in the form of pulses The Ports/Pins Configuration in AT89C55
over longer distances where parallel connection is Microcontroller is shown in Figure 4.
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 100
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
The AT89C55 Microcontroller has four clock, traffic lights, timed bomb, space
ports (P0, P1, P2 and P3). Each of these ports can applications, copiers, cable television terminal
be addressed to in a program for the purpose equipment, lawn sprinkling controllers, credit card
fetching or sending instruction. There are 40 pins in phone equipment, cellular phones, fax machines,
this microcontroller. Of these 40 pins, about eight automotive applications such as engine control
pins are not included in the ports and they are modules, anti-lock braking systems, automobile
called special pins. They are special in the sense suspension control, keyless entry systems, display
that their connections in a circuit are specific. systems, and a host of other industrial and
These eight pins are Pin 9, Pin 18, Pin 19, Pin 20, consumer applications [10]. It should be good to
Pin 29, Pin 30, Pin 31 and Pin 40. The rest of the analyze some of these real-time systems examples
32 pins are used for input and output interfaces [8]. where the AT89C55 microcontroller could be
applied.
II. ANALYSES OF THE APPLICATIONS
OF AT89C55 MICROCONTROLLER IN In a computer storage system having
REAL-TIME SYSTEMS multiple disk drives and multiple power supplies,
Microcontrollers are independently an environmental monitoring unit (EMU) is
programmable and can have a great deal of controlled by a microcontroller. The EMU
additional functionality combined on the same performs a variety of tasks including monitoring
integrated circuit. One good thing about AT89C55 power supply voltage and currents, fan speeds,
microcontroller is that it has a large memory which temperature of the storage system enclosure, and
can allow the microcontroller to perform different the status of the various disk drives in the storage
real-time applications, since it can conveniently system.
hold large programs. Just as it is applicable to other In household appliances, microcontrollers are part
microcontrollers, when applying this type of of microwave ovens, televisions, calculators,
microcontroller for real-time operations, what is remote controls, clocks, etc.
needed is to develop an appropriate control In a car, they are used in the engine
program for the task and “burn” it inside the control modules, the antilock braking systems, the
microcontroller. Of course, without a program sound systems, and automobile suspension control
inside a microcontroller, no control operation can modules. In antilock braking systems, the
take place. With adequate control programs where microcontroller monitors the rotational speed of the
time constraints are included, the use of AT89C55 tires through sensors attached to the tires.
microcontroller will help in monitoring and
controlling several real-time operations [9]. As an example, let us briefly discuss how
a microcontroller is used for display. The display in
AT89C55 Microcontroller can be used in this example is to scroll the word “FULL” on a
achieving different ranges of systems that operate seven segment display.
in real time because of its relatively large memory. Seven segment has a common anode type
This includes temperature controller, real time and a common cathode type. In a common anode
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 101
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
type, all the anodes of the LEDs are tied together letter, the LED of that letter will be ON, but if you
and grounded, while in a common cathode type, the set it one (1), it will be OFF. However, in a
cathodes of all the LEDs are tied together and common cathode, the reverse is the case. If you set
grounded. zero (0) to any letter, the LED of that letter will be
OFF, but if you set it one (1), it will be ON.
Each type contains seven LEDs connected The real-time simulation of AT89C55
in a segmented form lettered a, b, c, d, e, f, and g. microcontroller for scrolling a word “FULL” in a
In a common anode type, if you set zero (0) to any common anode 7-segment is shown in Figure 5.
In designing a program for this, you must In another example, the application of
note that each of the display segments would be AT89C55 microcontroller in real-time system for a
equated to a particular memory location. Also note Five-Way Traffic Light Control System can be
that there are as many as 0 – 127 memory locations analyzed. Its real-time simulation could be
you can use for this equation, and each memory performed using Proteus ISIS Professional
location is 8-bit which is equal to one byte. software. All the electronic components used for
the circuit were sourced from the internal
As usual there must be five subroutine programs. components arrangement within the Proteus
The five subroutines are: Shift, Screen, software. The essence of performing this real-time
Screen_delay, Letters, and Delay subroutines. The simulation is to show how this AT89C55
7-segment codes for the display are represented microcontroller could be applied in the design of a
thus: traffic light control system.
F = 10001110b When the circuit in Figure 6 was connected and run
U = 11000001b in Proteus software, the traffic light controller
L = 11000111b (which is basically the AT89C55 microcontroller
L = 11000111b plus few electronic components) is seen operating
as programmed.
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 102
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 103
International Journal of Advances in Engineering and Management (IJAEM)
Volume 4, Issue 4 Apr 2022, pp: 97-104 www.ijaem.net ISSN: 2395-5252
DOI: 10.35629/5252-040497104 Impact Factor value 7.429 | ISO 9001: 2008 Certified Journal Page 104