Documente Academic
Documente Profesional
Documente Cultură
Ration Distribution
System
INTRODUCTION
Introduction
Embedded systems:
An embedded system is a computer system designed to do one or a
few dedicated and/or specific
functions
often with real-time
computing constraints. It is embedded as part of a complete device often
including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to
meet a wide range of end-user needs. Embedded systems control many
devices in common use today.
Embedded systems are controlled by one or more main processing cores that
are typically either microcontrollers or digital signal processors (DSP). The
key characteristic, however, is being dedicated to handle a particular task.
They may require very powerful processors and extensive communication,
for example air traffic control systems may usefully be viewed as embedded,
even though they involve mainframe computers and dedicated regional and
national networks between airports and radar sites (each radar probably
includes one or more embedded systems of its own).
Since the embedded system is dedicated to specific tasks, design engineers
can optimize it to reduce the size and cost of the product and increase the
reliability and performance. Some embedded systems are mass-produced,
benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital
watches and MP3 players, to large stationary installations like traffic
lights, factory controllers, or the systems controlling nuclear power plants.
Complexity varies from low, with a single microcontroller chip, to very high
with multiple units, peripherals and networks mounted inside a
large chassis or enclosure.
In general, "embedded system" is not a strictly definable term, as most
systems have some element of extensibility or programmability. For
example, handheld computers share some elements with embedded systems
such as the operating systems and microprocessors that power them, but they
allow different applications to be loaded and peripherals to be connected.
Moreover, even systems that do not expose programmability as a primary
feature generally need to support software updates. On a continuum from
"general purpose" to "embedded", large application systems will have
Figure1: Block Diagram of an Embedded System Showing Different Software & Hardware Components.
Looking onto the above block diagram one can easily observe that what all an
embedded system constitutes of.
Our project Electronic RAtion DIstribution System (ERADIS) is also
an Embedded System since it includes a perfect share of hardware and
an appreciable share of software as well.
ERADIS Like in many of the embedded systems consists of Program
source code, a microcontroller, a circuit with which the microcontroller
is interfaced (Weighing machine), a keypad and other keys as user
interface, a display, power supply and other supporting electronic
circuitry.
The actual concept of ERADIS is explained in detail further.
Our group thought of this concept because the increased corruption in the
market sector can be prevented if system becomes automated, increased
adulteration can be prevented as well, the hoarding done by the officials and
labourers of Govt. Super Bazaars (PDS Stores) which in turn leads to price
hike can be prevented using this system.
The apparatus we are designing is cost effective and can prove helpful to Govt.
Of Indias PDS System and to various other disciplines. In terms of feasibility it
is a vast concept and an interesting task to perform and totally feasible in all
aspects technical as well as other.
System Design
Flow Chart
Start
Press
ZERO Key
No
Is Reading
Zero?
Yes
Press SET key to store the value
entered by the user
No
Is Weighing Machine
Reading Equal to the
value entered
(Desired Value)?
Yes
Solenoid closes the flap of the container
Stop
Working
Looking on to the system designs above one can easily predict the working of
ERADIS- Electronic Ration Distribution System. In this system there is a
container in which the items (wheat, rice etc.) are stored. A user enters the
required amount using a Keypad, whenever a key is pressed the buzzer
indicates that a key has been pressed by buzzing, the moment user enters a
value the solenoid releases the flap and the items are collected in a container
which is placed on a weighing machine, and when the load on weighing
machine equals the value entered by the user the solenoid again pushes the
flap back towards the container. Spring is used to keep the flap closed when
the power is off. Also there is a provision of SET and ZERO key which is used
to enter a value and to make the reading of the weighing machine zero
respectively. The power supply used here is 12 Volts Battery for
microcontroller and A.C. Supply for solenoid. A wooden table is used to
showcase the system properly and to demonstrate the intended functions.
The electronics part of the project is aligned systematically in a plastic box so
as to ensure that the connections remain intact.
Snapshot of ERADISs working is given as follows:
1. Setting the value to zero using ZERO Key and storing the entered value
using SET Key:-
3. As soon as the user enters a value the solenoid opens the flap of the
container and the item (wheat) start falling on the collecting tray placed
on weighing machine:-
4. Display showing the amount which has been received in the collecting
tray placed on the weighing machine:-
Block Diagram
The Block diagram of ERADIS depicting the important components is shown
below:
Display
User Interface
Container
Keypad
Solenoid &
Spring
Arrangement
Control
Unit
Weighing
Machine
Power Supply
Figure11: Block Diagram of ERADIS
Container
Weighing Machine
Solenoid & Spring Arrangement
User Interface
Display
Power Supply
Control Unit
SET and
ZERO
Key
Container
The container used in the project is the one used to store mustard oil. The
further changes in the orientation of the container as per requirements are
explained as below:
Weighing Machine
Load Cells
What is a Solenoid?
A solenoid is a coil wound into a tightly packed helix. In physics, the
term solenoid refers to a long, thin loop of wire, often wrapped around
a metallic core, which produces a magnetic field when an electric current is
passed through it. Solenoids are important because they can create controlled
magnetic fields and can be used as electromagnets. The term solenoid refers
specifically to a magnet designed to produce a uniform magnetic field in a
volume of space (where some experiment might be carried out). The term is
also often used to refer to a solenoid valve, which is an integrated device
containing an electromechanical solenoid which actuates either
a pneumatic or hydraulic valve, or a solenoid switch, which is a specific type
of relay that internally uses an electromechanical solenoid to operate an
electrical switch; for example, an automobile starter solenoid, or a linear
solenoid, which is an electromechanical solenoid.
What is a Spring?
A spring is an elastic object used to store mechanical energy. Springs are
usually made out of hardened steel. Small springs can be wound from prehardened stock, while larger ones are made from annealed steel and
hardened after fabrication. Some non-ferrous metals are also used
including phosphor bronze and titanium for parts requiring corrosion
resistance and beryllium copper for springs carrying electrical current
(because of its low electrical resistance).
When a spring is compressed or stretched, the force it exerts is proportional
to its change in length. The rate or spring constant of a spring is the change in
the force it exerts, divided by the change in deflection of the spring. That is, it
is the gradient of the force versus deflection curve.
Depending on the design and required operating environment, any material
can be used to construct a spring, so long as the material has the required
combination of rigidity and elasticity: technically, a wooden bow is a form of
spring.
In ERADIS Spring is used to keep the flap closed when the power is off.
Solenoid is used to stop and allow the flow the flow of items from the
container.
Eppec 513
Keypad
What is a Keypad?
A keypad is a set of buttons arranged in a block or "pad" which usually bear
digits, symbols and usually a complete set of alphabetical letters. If it mostly
contains numbers then it can also be called a numeric keypad. Keypads are
found on many alphanumeric keyboards and on other devices such as
calculators, push-button telephones, combination locks, and digital door
locks, which require mainly numeric input.
In ERADIS the SET & ZERO keys are the important part of the user
interface as it is basically used to activate the keypad.
Buzzer
What is a Buzzer?
A buzzer or beeper is
an audio signaling
device,
which
may
be mechanical, electromechanical, or Piezoelectric. Typical uses of buzzers
and beepers include alarms, timers and confirmation of user input such as a
mouse click or keystroke. The circuit Diagram of the buzzer used in ERADIS is
given as follows.
In ERADIS a Buzzer is just used to indicate that a key has been pressed
on Keypad.
Power Supply
12 Volts Battery (For Microcontroller Circuit)
Pin Description:
Pin Description:
Pin Description:
N.C.(ICL7660): No Connection
CAP+: Connection to positive terminal of Charge-Pump
Capacitor.
GND Ground: For most applications, the positive terminal of
the reservoir capacitor is connected to this pin.
CAP-: Connection to negative terminal of Charge-Pump
Capacitor.
VOUT Negative Voltage Output: For most applications, the
negative terminal of the reservoir capacitor is connected to
this pin.
LV Low-Voltage Operation: Connect to ground for supply
voltages below 3.5V. ICL7660: Leave open for supply voltages
above 5V.
OSC Oscillator Control Input: Connecting an external capacitor
reduces the oscillator frequency. Minimize stray capacitance at
this pin.
V+ Power-Supply Positive Voltage Input: (1.5V to 10V). V+ is
also the substrate connection.
Pin Description:
N/O: Normally Open
N/C: Normally Closed
COMMON: Common Connection
COIL: A.C. Supply to the Coil
Control Unit
Control Unit is the actual intelligence of ERADIS since it constitutes of the
most significant components used in any embedded system eg.
Microcontroller, circuit board, programming (application) etc. The control
unit is responsible for accomplishing the desired operation i.e. it is solely
responsible for automation of the system. The supporting technology behind
control unit is embedded systems.
Hence it is obvious to divide control unit into two parts as follows:
Hardware Platform:
Software:
UMPS Compiler (To program microcontroller AT89S52 )
Topwin Program Burner Software
CORELDRAW (To design the PCBs used in ERADIS)
Additional Hardware:
A plastic box to accommodate all the electronic circuitry so as to avoid
the intermittency in connection as when the circuit will be packed the
connections will remain intact.
A wooden table to demonstrate the desired working.
G
B
Component side
Splder side
The efficient laying out of traces on a PCB is a complex skill, and requires
much patience. This task has been made vastly easier with the advent of
readily available PCB layout software, but it is still challenging.
The PCB Layouts given above are designed using a software named
CORELDRAW.
Pin Description:
VOS TRIM: Input offset voltage.
-IN: Inverting Input
+IN: Non-Inverting Input
V-,V+: ICs Power Supply pins.
OUT: Output of the Operational Amplifier.
NC: No Connection
2. IC-7135: This is an IC of an ADC (Analog to Digital Converter). Pin
Configuration is given as follows-
Pin Description:
V+,V-: ICs Power Supply Pins
AZ: Auto Zero
INT: Signal Integrate
IN HI, IN LO: Internal Input High & Low
ANALOG COMMON: It is used as the input low return during autozero and de-integrate.
REFERENCE: The reference input must be generated as a positive
voltage with respect to COMMON.
Run/HOLD: When high (or open) the A/D will free-run with
equally spaced measurement cycles every 40,002 clock pulses. If
taken low, the converter will continue the full measurement cycle
that it is doing and then hold this reading as long as R/H is held
low.
STROBE: This is a negative going output pulse that aids in
transferring the BCD data to external latches, UARTs, or
microprocessors.
BUSY: This pin goes high at the beginning of signal integrate and
stays high until the first clock pulse after zero crossing (or after
end of measurement in the case of an overrange).
OVERRANGE: This pin goes positive when the input signal
exceeds the range (20,000) of the converter.
UNDERRANGE: This pin goes positive when the reading is 9% of
range or less.
POLARlTY: This pin is positive for a positive input signal. It is
valid even for a zero reading.
DIGIT DRIVES (Pins 12, 17, 18, 19 and 20): Each digit drive is a
positive going signal that lasts for 200 clock pulses. The scan
sequence is D5 (MSD), D4, D3, D2, and D1 (LSD).
BCD (Pins 13, 14, 15 and 16): The Binary coded Decimal bits B8,
B4, B2, and B1 are positive logic signals that go on simultaneously
with the digit driver signal.
Functional Table:
Pin Description:
VDD: Supply voltage
1Y-6Y: Outputs
1A-6A: Inputs
VSS: Ground Supply Voltage
NC: Not Connected
5. IC-74HC390: This is an IC of a Dual Decade Ripple Counter. Pin
Configuration is given as follows-
Pin Description:
1CP0, 2CP0: Clock input divide-by-2 section (HIGH-to-LOW, edgetriggered)
1MR, 2MR: Asynchronous master reset inputs (active HIGH)
1Q0 to 1Q3: Flip-Flop outputs
1CP1, 2CP1: Clock input divide-by-5 section (HIGH-to-LOW, edge
triggered)
GND: Ground (0 V)
2Q0 to 2Q3: Flip-Flop outputs
VCC: Positive Supply Voltage
6. IC-AT89S52: This is an IC of a Microcontroller. Pin Configuration is
given as follows-
Pin Description:
Port0: Port 0 is an 8-bit open drain bidirectional I/O port. As an
output port, each pin can sink eight TTL inputs. When 1s are
written to port 0 pins, the pins can be used as high impedance
inputs.
Port1: Port 1 is an 8-bit bidirectional I/O port with internal pull
ups. The Port 1 output buffers can sink/source four TTL inputs.
Port Pin Alternate Functions:P1.0 T2 (external count input to Timer/Counter 2), clock-out
P1.1 T2EX (Timer/Counter 2 capture/reload trigger and direction
control)
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming
Port2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs.
Port3: Port 3 is an 8-bit bidirectional I/O port with internal
pullups. The Port 3 output buffers can sink/source four TTL
inputs.
Port Pin Alternate Functions:P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
RST: Reset Input
Pin Description:
A0: Address Input 0
A1: Address Input 1
A2: Address Input 2
E1: Enable Input 1
E2: Enable Input 2
E3: Enable Input 3
Y7: Output 7
GND: Ground
Y6: Output 6
Y5: Output 5
Y4: Output 4
Y3: Output 3
Y2: Output 2
Y1: Output 1
Y0: Output 0
VCC: Positive Supply Voltage
8. ULN-2003: This is an IC used as a driver for Display Section i.e. FND
Display. Pin Configuration is given as follows-
Pin Description:
Pin No. 1 to 8: Input pins
Pin No. 11 to 18: Output Pins
Pin No. 9: GND (Ground)
Pin No. 10: Free Wheeling Diode Pins
SOFTWARE SECTION
Screenshots Of CORELDRAW for designing the PCBs used in ERADIS.
Code Description
The Program Source Code to be burned on Microcontroller AT89S52
constitutes following functions:
Hence as per requirements the program has been manipulated and has been
divided into separate functions so that it can be understood easily and also to
provide flexibility so that it can be manipulated further if required. The
program is written using the basic instruction set of the microcontroller used
and has been compiled using a software named Universal Microprocessor
Program Simulator (UMPS) and has been burned to the microcontroller using
a software named TOPWIN.
The complete program source code is given in further sections.
The source code explained is divided according to the functions as declared
above and has been clearly specified. The code is written in assembly level
language using the instruction set of the microcontroller used.
The code is working correctly and has been properly debugged before
burning it to the microcontroller.
70h
ch2 equ
72h
ch3 equ
74h
ch4 equ
76h
ch5 equ
78h
ch6 equ
7ah
org
00h
mov
sp,#0fh
mov
7eh,#00h
;zero
mov
7fh,#00h
;zero
sjmp
fnd
freq:
org
ljmp
0bh
*////
disp
ljmp over
org
2bh
clr tr2
mov
32h,rcap2h
mov
33h,rcap2l
clr
reti
*////
disp:
mov
tl0,#0fbh
mov
th0,#0efh
setb
psw.3
mov
p0,@r0
inc
mov
inc
r0
p2,@r0
r0
cjne r0,#7ch,nxt
mov
r0,#ch1
nxt:
clr
psw.3
reti
Function 2: For FND (Display)
fnd:
setb psw.3
mov r4,#00h
mov
r0,#ch1
mov
tl0,#0fbh
mov
th0,#0efh
mov
tmod,#01h
setb
tcon.4
clr
psw.3
mov
ch1,#00h
mov
71h,#00
mov
ch2,#00h
mov
73h,#00
mov
ch3,#00h
mov
75h,#00
mov
ch4,#00h
mov
77h,#00
mov
ch5,#00h
mov
79h,#00
mov
ch6,#00h
mov
7bh,#00
mov
7ch,#00
setb
psw.3
mov
inc
r0
@r0,#00h
inc
r0
inc
r0
mov
@r0,#01h
inc
r0
inc
r0
mov
inc
(71h,73h,75h,77h,79h,7bh)
r0,#ch1
fnd
mov
@r0,#02h
r0
inc
mov
r0
@r0,#03h
inc
r0
inc
r0
mov
@r0,#04h
inc
r0
inc
r0
mov
@r0,#05h
mov
r0,#ch1
clr
psw.3
jnb
p1.3,ram_zero1
ljmp
over1
ram_zero1:
mov
4ah,#00h
mov
4bh,#00h
mov
4ch,#00h
mov
4dh,#00h
mov
4eh,#00h
mov
4fh,#00h
over1:
mov
rcap2h,#00h
mov
rcap2l,#00h
mov
th2,#00h
mov
tl2,#00h
mov
t2con,#00h
mov
t2mod,#02h
mov
t2con,#0bh
mov
ie,#0a2h
here1:
jnb
p1.1,here1
; busy
setb
tr2
; timer start
lcall
subt
lcall
rutin
lcall
calcu
lcall
bcd10.....
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
over
rcap2h,#00h
mov
rcap2l,#00h
mov
th2,#00h
mov
tl2,#00h
mov
t2con,#00h
mov
t2mod,#02h
mov
t2con,#0bh
mov
ie,#0a2h
*//// in here jump not bit instruction is being used to use the interrupts
here:
jnb
p1.1,here ;busy
setb
tr2
lcall
subt
jnb
;timer start
aee:
*//// in this we called the following instruction set
lcall
rutin
lcall
calcu
lcall
transfar_to_bcd
lcall
bcd
lcall
comp_value
; lcall
delay1
; lcall
delay1
; lcall
delay1
jnb
p1.5, key
; lcall
delay1
lcall
delay1
ljmp
over
*//// after getting the p1.5 high, the execution jump to:
61h,#0h
mov
62h,#0h
mov
63h,#0h
mov
64h,#0h
mov
65h,#0h
lcall
ljmp
bcd
key_board
;most
;list
*//// show the all channels of FND 0.
Zero:
mov
7eh,32h
mov
7fh,33h
ljmp
aee
a,#09
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#08
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#07
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#06
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#05
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#04
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#03
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#02
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#01
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
mov
a,#00
mov
61h,a
mov
62h,a
mov
63h,a
mov
64h,a
mov
65h,a
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
lcall
delay1
ret
delay:
mov
r7,#0ffh
r7,dale
dale:
djnz
ret
lcall convart
mov ch1,a
mov a,61h
lcall convart
mov ch2,a
mov
a,62h
lcall convart
mov
ch3,a
mov
a,63h
lcall convart
mov
ch4,a
mov
a,64h
lcall convart
mov
ch5,a
mov
a,65h
lcall convart
mov
ch6,a
ret
convart:
inc
mov a,@a+ pc
ret
;(-)
db 00h
; (blank)
;***************************************************
rutin:
mov
clr
60h,#0bh
c
mov
a,33h
mov
b,7fh
subb
a,b
mov
3dh,a
mov
a,32h
mov
b,7eh
subb
a,b
jnc
ljmp
nextt1
rev
nextt1:
mov
32h,a
mov
mov
a,32h
cjne
mov
cjne
;high final
;zero chake
a,#00h,as
a,33h
a,#00h,fill_zero
as:
ret
fill_zero:
cjne
a,#01h,fill_zero1
mov
33h,#00h
ljmp
as
fill_zero1:
cjne
a,#02h,fill_zero2
mov
33h,#00h
ljmp
as
fill_zero2
cjne
a,#03h,fill_zero3
mov
33h,#00h
ljmp
as
fill_zero3
cjne
a,#04h,fill_zero4
mov
33h,#00h
ljmp
as
fill_zero4
ljmp
as
rev:
mov
clr
mov
mov
b,33h ;3bh
subb
a,b
mov
33h,a
;high
mov
a,7eh ;32h
mov
b,32h ;3ah
subb
a,b
mov
32h,a
mov
a,32h
cjne
mov
cjne
a,#00h,asr
a,33h
a,#00h,fill_zeror
asr:
ret
fill_zeror:
cjne
a,#01h,fill_zero1r
mov
33h,#00h
ljmp
as
fill_zero1r:
cjne
a,#02h,fill_zero2r
mov
33h,#00h
ljmp
as
fill_zero2r
cjne
a,#03h,fill_zero3r
mov
33h,#00h
ljmp
as
fill_zero3r
cjne
a,#04h,fill_zero4r
mov
33h,#00h
ljmp
as
fill_zero4r
ljmp
as
delay1:
mov
r6,#0ffh
mov
r7,#0ffh
delay2:
djnz r6,delay2
djnz r7,delay2
ret
subt:
clr
mov
a,33h
mov
b,#10h
subb
a,b
mov
33h,a
mov
a,32h
mov
b,#27h
to the a & b
subb
a,b
mov
32h,a
ret
Function 7: For converting the Hexadecimal value into the Decimal value
calcu:
clr
*//// in this the capture hex value convert into the decimal no
c
mov
a,32h
mov
b,#10
;31,34,35h
div ab
mov
35h,b
mov
b,#10
div ab
mov
34h,b
mov
mov
a,35h
mov
b,#6
;35*6
mul ab
mov
b,#10
div ab
mov
39h,b
mov
30h,a ;cary
mov
a,34h
;34*6
mov
b,#6
mul ab
add
a,30h
mov
b,#10
div ab
mov
38h,b
mov
30h,a ;cary
mov
a,31h
mov
b,#6
; 31*6
mul ab
add
a,30h
mov
b,#10
div ab
mov
37h,b
mov
36h,a
mov
a,35h
mov
b,#5
;35*5
mul ab
mov
b,#10
div ab
mov
3dh,b
mov
30h,a ;cary
mov
a,34h
mov
b,#5
;34*5
mul ab
add
a,30h
mov
b,#10
div ab
mov
3ch,b
mov
30h,a ;cary
mov
a,31h
mov
b,#5
;31*5
mul ab
add
a,30h
mov
b,#10
div ab
mov
3bh,b
mov
3ah,a
mov
a,35h
mov
b,#2
;35*2
mul ab
mov
b,#10
div ab
mov
41h,b
mov
30h,a ;cary
mov
a,34h ;34*2
mov
b,#2
mul ab
add
a,30h
mov
b,#10
div ab
mov
40h,b
mov
30h,a ;cary
mov
a,31h
mov
b,#2
;31*2
mul ab
add
mov
a,30h
b,#10
div ab
mov
3fh,b
mul adding
mov
44h,39h ;result
mov
a,38h
add
mov
div ab
a,3dh
b,#10
mov
43h,b
;result
mov
30h,a
;cary
mov
a,37h
add
a,3ch
add
a,41h
add
a,30h
mov
b,#10
div ab
mov
42h,b ;result
mov
30h,a
mov
a,36h
add
a,3bh
add
a,40h
add
a,30h
mov
;cary
b,#10
div ab
mov
41h,b ;result
mov
30h,a
mov
a,3ah
add
a,3fh
add
a,30h
;cary
mov
b,#10
div ab
mov
40h,b
;result
mov
30h,a
;cary
mov
a,33h
mov
b,#10
div ab
mov
35h,b
mov
b,#10
div ab
mov
34h,b
mov
33h,a
mov
a,44h
add
a,35h
mov
b,#10
div ab
mov
44h,b
mov
30h,a
mov
a,43h
add
a,34h
add
a,30h
mov
div ab
b,#10
mov
mov
30h,a
mov
a,42h
add
a,33h
add
a,30h
mov
b,#10
div ab
mov
mov
30h,a
mov
a,41h
add
mov
a,30h
b,#10
div ab
mov
41h,b
mov
30h,a
mov
a,40h
add
mov
a,30h
b,#10
div ab
mov
40h,b
mov
30h,a
ret
;end of calcu prog
transfar_to_bcd:
*//// in this the output of calcu: move into the FND display
mov
65h,44h
mov
64h,43h
mov
63h,42h
mov
62h,41h
mov
61h,40h
ret
;end of b_d_a_d_adding+present:
;result in 45,46,47,48,49
Function 8: For entering the value through keypad.
key_board:
begen:
mov
p3,#0ffh
clr
0b0h
jnb
0b4h,get ;p2.4
jnb
0b5h,get
;p2.5
jnb
0b6h,get
;p2.6
jnb
0b7h,get
lcall
delay1
setb
0b0h
lcall
delay1
clr
0b1h
lcall
delay1
;p2.0
;p2.1
jnb
0b4h,get ;p2.4
jnb
0b5h,get
;p2.5
jnb
0b6h,get
;p2.6
jnb
0b7h,get
lcall
delay1
setb
0b1h
lcall
delay1
clr
0b2h
lcall
delay1
jnb
0b4h,get ;p2.4
jnb
0b5h,get
;p2.5
jnb
0b6h,get
;p2.6
jnb
0b7h,get
lcall
delay1
setb
0b2h
lcall
delay1
clr
0b3h
lcall
delay1
jnb
0b4h,get ;p2.4
jnb
0b5h,get
;p2.5
jnb
0b6h,get
;p2.6
jnb
0b7h,get
lcall
delay1
setb
0b3h
;p2.1
;p2.2
;p2.2
;p2.3
;p2.3
lcall
delay1
ljmp
begen
lcall
delay1
get:
mov
clr
p1.3
lcall
delay1
setb
P1.3
setb
psw.3
inc
r4
cjne
r4,#06h,convert
mov
clr
r4,#0h
psw.3
psw.3
cjne
r2,#07eh,zeroo
setb
psw.3
mov
a,r4
cjne
mov
a,#01h,not_zeroo5
61h,#00h
clr
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_zeroo5:
cjne
mov
clr
a,#02h,not_zeroo4
62h,#00h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_zeroo4:
cjne
mov
clr
a,#03h,not_zeroo3
63h,#00h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_zeroo3:
cjne
mov
clr
a,#04h,not_zeroo2
64h,#00h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_zeroo2:
cjne
mov
clr
a,#05h,not_zeroo1
65h,#00h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_zeroo1:
ljmp
begen
one:
clr
psw.3
cjne
r2,#07dh,one
setb
psw.3
mov
a,r4
cjne
mov
clr
a,#01h,not_one5
61h,#01h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_one5:
cjne
mov
clr
a,#02h,not_one4
62h,#01h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_one4:
cjne
a,#03h,not_one3
mov
clr
63h,#01h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_one3:
cjne
mov
clr
a,#04h,not_one2
64h,#01h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_one2:
cjne
mov
clr
a,#05h,not_one1
65h,#01h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_one1:
ljmp
begen
clr
psw.3
two:
cjne
r2,#07bh,two
setb
psw.3
mov
a,r4
cjne
mov
clr
a,#01h,not_two5
61h,#02h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_two5:
cjne
mov
clr
a,#02h,not_two4
62h,#02h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_two4:
cjne
mov
clr
lcall
a,#03h,not_two3
63h,#02h
psw.3
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_two3:
cjne
mov
clr
a,#04h,not_two2
64h,#02h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_two2:
cjne
mov
clr
a,#05h,not_two1
65h,#02h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_two1:
ljmp
three:
begen
clr
cjne
psw.3
r2,#077h,three
setb
psw.3
mov
a,r4
cjne
mov
clr
a,#01h,not_three5
61h,#03h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_three5:
cjne
mov
clr
a,#02h,not_three4
62h,#03h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_three4:
cjne
a,#03h,not_three3
mov
clr
63h,#03h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_three3:
cjne
mov
clr
a,#04h,not_three2
64h,#03h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_three2:
cjne
mov
clr
a,#05h,not_three1
65h,#03h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_three1:
four:
ljmp
begen
clr
psw.3
cjne
setb
mov
cjne
mov
clr
r2,#0beh,four
psw.3
a,r4
a,#01h,not_four5
61h,#04h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_four5:
cjne
mov
clr
a,#02h,not_four4
62h,#04h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_four4:
cjne
mov
clr
a,#03h,not_four3
63h,#04h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_four3:
cjne
mov
clr
a,#04h,not_four2
64h,#04h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_four2:
cjne
mov
clr
a,#05h,not_four1
65h,#04h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_four1:
ljmp
begen
clr
psw.3
five:
cjne
r2,#0bdh,five
setb
psw.3
mov
a,r4
cjne
mov
clr
a,#01h,not_five5
61h,#05h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_five5:
cjne
mov
clr
a,#02h,not_five4
62h,#05h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_five4:
cjne
mov
clr
a,#03h,not_five3
63h,#05h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_five3:
cjne
mov
clr
a,#04h,not_five2
64h,#05h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_five2:
cjne
mov
clr
lcall
a,#05h,not_five1
65h,#05h
psw.3
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_five1:
ljmp
begen
clr
psw.3
six:
cjne
r2,#0bbh,six
setb
mov
cjne
mov
clr
psw.3
a,r4
a,#01h,not_six5
61h,#06h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_six5:
cjne
mov
clr
a,#02h,not_six4
62h,#06h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_six4:
cjne
mov
clr
a,#03h,not_six3
63h,#06h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_six3:
cjne
mov
clr
a,#04h,not_six2
64h,#06h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_six2:
cjne
mov
clr
a,#05h,not_six1
65h,#06h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_six1:
ljmp
begen
seven:
clr
cjne
psw.3
r2,#0b7h,seven
setb
mov
cjne
mov
clr
a,r4
a,#01h,not_seven5
61h,#07h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_seven5:
psw.3
cjne
mov
clr
a,#02h,not_seven4
62h,#07h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_seven4:
cjne
mov
clr
a,#03h,not_seven3
63h,#07h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_seven3:
cjne
mov
clr
a,#04h,not_seven2
64h,#07h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_seven2:
cjne
mov
clr
a,#05h,not_seven1
65h,#07h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_seven1:
ljmp
begen
clr
psw.3
eight:
cjne
r2,#0deh,eight
setb
mov
cjne
mov
clr
psw.3
a,r4
a,#01h,not_eight5
61h,#08h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_eight5:
cjne
mov
clr
a,#02h,not_eight4
62h,#08h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_eight4:
cjne
mov
clr
a,#03h,not_eight3
63h,#08h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_eight3:
cjne
mov
clr
lcall
a,#04h,not_eight2
64h,#08h
psw.3
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_eight2:
cjne
mov
clr
a,#05h,not_eight1
65h,#08h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_eight1:
ljmp
begen
clr
psw.3
nine:
cjne
r2,#0ddh,nine
setb
mov
cjne
mov
clr
lcall
psw.3
a,r4
a,#01h,not_nine5
61h,#09h
psw.3
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_nine5:
cjne
mov
clr
a,#02h,not_nine4
62h,#09h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_nine4:
cjne
mov
clr
a,#03h,not_nine3
63h,#09h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_nine3:
cjne
a,#04h,not_nine2
mov
clr
64h,#09h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
ljmp
begen
not_nine2:
cjne
mov
clr
a,#05h,not_nine1
65h,#09h
psw.3
lcall
bcd
lcall
delay1
lcall
delay1
lcall
delay1
not_nine1:
ljmp
begen
clr
psw.3
ten:
cjne
r2,#0dbh,ten
lcall
key_store
ljmp
over
key_store:
mov
66h,61h
mov
67h,62h
mov
68h,63h
mov
69h,64h
mov
6ah,65h
clr
p1.4
ret
Function 11: For comparing the value of key store (entered value) &
scale reading
comp_value:
mov
cjne
mov
cjne
mov
cjne
mov
a,66h
a,61h,go_back
a,67h
a,62h,go_back
a,68h
a,63h,go_back
a,69h
cjne
a,64h,go_back
setb
p1.4
clr
p1.3
lcall
delay1
setb
p1.3
go_back:
ret
end
Applications
Electronic Ration Distribution System(ERADIS)- means distribution of
essential commodities to a large number of people through a network on a
recurring basis in an automated way. The ERADIS has many applications
which can easily be implemented in real world.
Future Scope
In this era of automation we see many operations getting automated be it
consumer related operations, be it traffic related operations etc. So why
should the Public Distribution System lags behind? ERADIS is also an
automation technique which can be implemented in various day to day
disciplines and can effectively replace PDS.
Anti-corruption tool:
Because of the automation in this field, the chances of corruption are
reduced, which is a common practice in this industry. The factors such
as Adulteration, Hoarding, Price hike of ration goods can be easily
eliminated using this approach.
Ease of access:
In the present PDS system, the people have to spend long time waiting
in queues to get ration, ERADIS can easily eliminate this problem. Also
the longevity in working is another important factor as a man cannot
work 24 hours a day but a machine can hence it can operate like an
ATM if properly maintained.
Bibliography
While working on project and on project report we referred to the following
sources:
Datasheets of approximately all the ICs present in the circuit (Control Unit
Components)