Final Mini Report 1

90
MINI PROJECT, 2011 ELECRTONIC MENU CARD INTRODUCTION In the last years the restaurant industry has lived through many changes. Anyway, there is an area that was not improved since several decades. While technology is changing the way we do almost everything, menu cards are still mostly untouched - although they have several disadvantages that can be improved significantly by a digital approach. The Digital Menu for Restaurants project aims to improve this situation. Consumers today are adapted to interact with computer systems in many aspects of their day to day life. Sometimes we even prefer them to traditional methods, especially when they help to provide fast and convenient service. One of the most import areas for the restaurant industry is obviously the customer service. To engage friendly and obliging service staff is most challenging for the majority of restaurant managers. But this is not the only issue in this area. It’s also hard to motivate people every day, because the customer service in restaurants might become very stressful. Most of the stress occurs as soon as one customer service member needs to take care of way too many customers at once. That’s why this project aims to support processes needed for the restaurant staff and allow them to focus on the important part – friendly customer service. Adapting this goal for the customers this project increases the overall experience at the next trip to a restaurant. The project is focused on the order process; the kitchen organization and business processes like invoice management. It provides a digital management system for each of these processes.

Transcript of Final Mini Report 1

Page 1: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

INTRODUCTION

In the last years the restaurant industry has lived through many changes. Anyway, there is an area that was not improved since several decades. While technology is changing the way we do almost everything, menu cards are still mostly untouched - although they have several disadvantages that can be improved significantly by a digital approach. The Digital Menu for Restaurants project aims to improve this situation.

Consumers today are adapted to interact with computer systems in many aspects of their day to day life. Sometimes we even prefer them to traditional methods, especially when they help to provide fast and convenient service.

One of the most import areas for the restaurant industry is obviously the customer service. To engage friendly and obliging service staff is most challenging for the majority of restaurant managers. But this is not the only issue in this area. It’s also hard to motivate people every day, because the customer service in restaurants might become very stressful.

Most of the stress occurs as soon as one customer service member needs to take care of way too many customers at once. That’s why this project aims to support processes needed for the restaurant staff and allow them to focus on the important part – friendly customer service. Adapting this goal for the customers this project increases the overall experience at the next trip to a restaurant.

The project is focused on the order process; the kitchen organization and business processes like invoice management. It provides a digital management system for each of these processes.

Page 2: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BLOCK DIAGRAM

TRANSMITER SECTION

MCU KEY PAD

16 X 2 LCD

RF ENCODER

RF TRANSMITTER

Page 3: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

RECEIVER SECTION

MCURF RECEIVER RF DECODER

16 X 2 LCD

LED INDICATORS

BUSSER

Page 4: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BLOCK DIAGRAM EXPLANATION

TRANSMITTER SECTION

KEY PAD

Here five selection switches are used, INC, DEC, ENTER, SEND and CANCEL. By using INC and DEC keys, the customer can selects the particular items; the selected items are transmitted only after the SEND key is pressed. CANCEL key is for cancelling the item that was mistakenly added. If we want to add a new item in the list, for this ENTER key used.

MCU (MICROCONTROLLER UNIT)

MCU is the central processing unit, which controls all the functions of other blocks in this system. MCU takes or read data from the keypad and controls all the functions of the whole system by manipulating these data. If the customers selects the items on the card and press the SEND key, then the MCU gives a digital data corresponding to the entered items to the encoder. An LCD is interfaced with the MCU; it displays the food items with their prices.

RF ENCODER

The purpose of digital encoders is for security. Any digital data is first converted to a coded form before sending wirelessly to get ensure data integrity from noises and offers security from other faulty messages. The encoded data is decoded in the receiver side and the original data is recovered. Here encoder receives data input from the MCU and convert it into a coded output signal. This coded output is corresponds to the selected items.

RF TRANSMITTER RF transmitter is used to transmit the customer’s selection details. So the data is digital encoded form and the RF transmitter module should have the capability of transmitting digital data. The data rate for the address selection operation is very slow, so a slow speed high range RF module is preferred for the application. The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz.

DISPLAY SECTION

Display unit is interfaced with the system for user information. Here it displays the items along with their prices that were available to the customer. It also displays the total cost of the selected items. LCD module is a dot matrix liquid crystal display that displays alphanumeric, kana (Japanese character) and symbols. The CMOS technology makes the device ideal for applications in handheld portable and other powered instruments with low power consumptions.

Page 5: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

RECEIVER SECTIONRF RECEIVER

The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter. Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources.

RF DECODER

A decoder is a device which does the reverse of an encoder, undoing the encoding so that the original information can be retrieved. The same method used to encode is usually just reversed in order to decode. In digital electronics, a decoder can take the form of a multiple-input, multiple-output logic circuit that converts coded inputs into coded outputs, where the input and output codes are different. e.g. n-to-2n, binary-coded decimal decoders. Decoders are used in counter system, analog to digital converters and the output can be used to drive display system.

It accepts data from RF receiver and compares received address with its own address. If it

matches, the decoder decodes the data and provides it to MCU.

MCU (MICROCONTROLLER UNIT)

MCU receives a digital data, which is corresponds to the items in the menu card that was ordered by the customer. When MCU receives input from the decoder it displays the ordered items on the display unit.

DISPLAY SECTION

The display unit interfaced at the receiver section displays the ordered items by the customer to the kitchen people.

LED INDICATIONS

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices, and are increasingly used for lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness.

Page 6: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows.

WORKING

Digital menu card is a system which is used to overcome the limitation of currently followed system in the restaurant industry. Our digital menu card will provide an automated, fast and accurate care to each customer by allowing customers to transmit orders directly to the kitchen through an electronic card provided at each table.

Transmitter section: An electronic card is provided on each table. It consists of a keypad, MCU, encoder, an RF transmitter and an LCD. MCU displays the food items on the LCD screen with their prices. The customer can select the items by using the INC and DEC key. In order to send the selected items press SEND key. MCU reads data from the keypad and gives corresponding digital output to an encoder. It encodes one of the active inputs to a coded binary output. RF transmitter transmits this coded binary output from the encoder. The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. Here we are using 2.4GHz band. Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications and the RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable.

Receiver section: The receiver section is placed in the kitchen, it consists of an RF receiver, RF decoder, MCU, display unit, audio and visual indications. RF receiver receives the coded binary data transmitted by the RF transmitter and given to the RF decoder. RF decoder decodes the input and gives four bit digital data to the MCU only if the address bit of encoder and decoder matches. MCU receives a digital data, which is corresponds to the selected items. When MCU receives input from the decoder it controls the display unit in order to display the ordered items. Audio and visual indications are also interfaced with the MCU for intimating the kitchen people.

CIRCUIT DIAGRAM

Page 7: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CIRCUIT DIAGRAM EXPLANATIONS

Page 8: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MICROCONTROLLER UNIT

Here the popular microcontroller PIC 16F877A from MICROCHIP Corporation is used as the CPU of the system. PIC microcontrollers are the most popular 8 bit microcontroller in the world. They are available in wide variety in pin outs, memory capacity and have lots of integrated peripherals like ADCs, SERIAL modules and EEPROM. .

The PIC 16F877A is available in 40 pin DIP package and have program memory capacity of 8kb , ram of 368 bytes and 256 bytes of EEPROM. They are working in clock speed range of 0 Hz to 20 MHz and the operation is fully static also. They have 5 I/O ports named as PORTA, PORTB, PORTC, PORTD and PORTE. Among these PORT A is 6 bit wide and PORT E is 3bit wide and all other ports are 8 bit wide. Most of the peripheral I/O functions are multiplexed with PORTC pins .The ADC inputs are available in PORT A and PORT E.

The PIC controllers have 14 bit wide program memory space by which an instruction occupies only one memory space. This allows more program density. These are addressed with a 13 bit wide program counter during execution .The program memory is addressed from 0000h to 1fffh and the reset vector is at 0000h and interrupt vector is at 0004h. The program counter points the address of the memory location to be executed next and increments in every machine cycles. One machine cycle consists of 4 clock cycles.

Generally they are low power devices and works in voltage range of 2v to 5.5v. They have 13 interrupt sources like external pulse interrupt and serial receive interrupt etc.

These chips are supplied with in circuit serial programming facility and are flash technology also. The flash memory can be re written 100O times.

The peripheral features are given below

• Timer0: 8-bit timer/counter with 8-bit prescaler• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external crystal/clock• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler• Two Capture, Compare, PWM modules- Capture is 16-bit, maximum resolution is 12.5 ns- Compare is 16-bit, maximum resolution is 200 ns

Page 9: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

- PWM maximum resolution is 10-bit• 10-bit multi-channel Analog-to-Digital converter• Synchronous Serial Port (SSP) with SPI (Master mode) and I2C (Master/Slave)• Universal Synchronous Asynchronous ReceiverTransmitter (USART/SCI) with 9-bit address detection• Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls (40/44-pin only)

PIN DIAGRAM

Page 10: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Page 11: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CONTROL KEY (KEY PAD)

5 SPST switches are used here that are placed in a column in order to control 3 systems. In this, one point of each switch in is shorted and grounded. And the other point of each switch is connected to MCU through 2nd - 6th pins and a high voltage is provided. Then the microcontroller will check whether any key is pressed. If a key is pressed, then the input of the pressed switch will also get grounded. Thus we can find out which key is pressed. LED can be used for this purpose.The first two switches are for incrementing and decrementing the scroll, third for entering new item name into the list, fourth for sending the selected items and the fifth for cancelling the order.

VISUAL INDICATION

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices, and are increasingly used for lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet and infrared wavelengths, with very high brightness.

LEDs are based on the semiconductor diode. When the diode is forward biased (switched on), electrons are able to recombine with holes and energy is released in the form of light. This effect is called electroluminescence and the color of the light is determined by the energy gap of the semiconductor. The LED is usually small in area (less than 1 mm2) with integrated optical components to shape its radiation pattern and assist in reflection.

GREEN and RED LEDs are used here as the visual indicators and are connected MCU through 35th and 36th pin. LED will glow when outing ‘1’ from MCU. And also it is connected at the 25th pin of MCU and 6th pin of RF encoder.

BUZZER

A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles, household appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed, and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical system which was identical to an electric bell without

Page 12: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

the metal gong (which makes the ringing noise). Often these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Here BC547 act as the interfacing transistor and is connected to MCU through 37 th pin. And the buzzer will produce audible sound when outing ‘1’ from MCU.

BC 547

The cut off and saturation conditions of these transistors are used here for the switching actions. Here we use a combination of NPN transistor BC 547. This device is designed for used as a general purpose amplifiers and switches requiring collector current to 300mA.

Features: BC 547NPN general purpose BC547 TO-92 packageSmall signal Applications:SwitchingSmall signal amplificationLow power

LIQUID CRYSTAL DISPLAY (HD 44780)

The HD 44780 is a liquid crystal dot matrix display module that consists of LCD panel, LCD control driver, driver and is capable of providing 16 characters x 2 lines display. It contains a controller, a data RAM and a character generator ROM required for providing display. Data interfacing is in 8-bit parallel or 4-bit parallel and data can be written in or read from a microprocessor.

Its control lines are connected to 15th, 16th and 17th pin of MCU. Data lines are connected to 19- 22nd and 27- 30th pins of MCU. It is used for displaying the name of the items.

Page 13: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Circuit diagram of HD 44780 (LCD Module)

Pin Symbol I/O Description

1 GND - Ground

2 Vcc - +5V power supply

3 VEE - Contrast control

4 RS I command/data register selection

5 R/W I write/read selection

6 E I/O Enable

7-14 DB0-DB7 I/O The 8-bit data bus

Page 14: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Pin Description of LCD Module

Liquid Crystal Display has 16 pins in which first three and 15th pins are used for power supply. 4th pin is RS (Register Selection) if it is low data and if it is high command will be displayed. 5th pin is R/W if it is low it performs write operation. 6th pin act as enable and remaining pins are data lines

RS - Register Select:

The RS pin is used for the selection of register. If RS = 0, the instruction command code register is selected, allowing the user to send a command such as clear display, cursor at home, etc. If RS = 1 the data register is selected, allowing the user to send data to be displayed on the LCD.

R/W - Read/Write:

R/W input allows the user to write information to the LCD or read information from it. R/W = 1 when reading; R/W =0 when writing.

E - Enable:

The enable pin is used by the LCD to latch information presented to its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD to latch in the data present at the data pins. This pulse must be a minimum of 450 ns wide.

D0 – D7:

The 8 bit data pins, D0 – D7, are used to send information to the LCD or read the contents of the LCD’s internal registers.

To display letters and numbers, we send ASCII codes for the letters A – Z, a – z, and numbers 0 – 9 to these pins while making RS = 1. RS = 0 is used to check the busy flag bit to see if the LCD is ready to receive information. The busy flag is D7 and can be read when R/W =1 and RS = 0, as follows: if R/W =1, RS =0. When D7 = 1(busy flag = 1), then the LCD is busy taking care of internal operations and will not accept any new information. When D7 = 0, the LCD is ready to receive new information. It is always recommended to check the busy flag before writing any data to the LCD.

There are also instructions command codes that can be sent to the LCD to clear the display or force the cursor to the home position or blink the cursor.

Instruction command Command to LCD

Codes Code (hex) Instruction Register

Page 15: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

1 Clear display screen

2 Return home

4 Shift cursor to left

5 Shift display right

6 Shift cursor to right

7 Shift display left

8 Display off, Cursor off

A Display off, Cursor on

C Display on, cursor off

E Display on, cursor blinking

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right

80 Force cursor to beginning of 1st line

C0 Force cursor to beginning of 2nd line

38 2 lines and 5x7 matrix

Instruction command codes to the LCD instruction register

ST3654 – Serial Interface IC

Page 16: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

ST3654 Serial Interface IC supports any RF based modules/transreceiver which is based on Texas Instrument’s Chipcon ICs like CC1100/CC1101(433 MHz) and CC2500(2.4 GHz). It provides a simple UART interface for transmission and reception of serial data at various baud rates. It can be used for applications that need two way wireless data transmission. The communication protocol is self controlled and completely transparent to user interface. The IC can be embedded to your current design so that wireless communication can be set up easily. ST3654 replaces our earlier chip ST1197 with similar functionality but different IC package.

It is connected to MCU through 25th and 26th pins. Its output pins are 1st, 2nd, 17th and 18th and are connected to RF transmitter.Features· Automatic switching between TX and RX mode with LED indication· Adjustable baud rate setting of 9600, 4800, 38400 and 19200· Frequency Channel can be set to operating multiple pairs in same area· FSK technology, half duplex mode, robust interference· Protocol translation is self controlled, easy to use· High sensitivity, optimized transmission range.· Standard UART interface, TTL(3-5V) logic level with any microcontroller· Very reliable, small size, easier mounting· No tuning required, PLL based self tuned· Error checking (CRC) to prevent corrupted data output at receiverApplication· Robotics, Sensor Networks, Wireless metering & Weather stations· Remote control/measurement system, Access control & Identity discrimination· Data collection, IT home appliance, Smart house products, Security Systems

RF TRANSRECEIVER 2.4 GHZ

This RF transceiver is having a 30 meter range with onboard antenna of transceiver based on the ‘Texas Instruments Chipcon IC (CC2500)’.In a typical system, this transceiver will be used together with a microcontroller. It provides extensive hardware support for packet handling, data buffering, burst transmissions, clear channel assessment, link quality indication and wake on radio. It can be used in 2400-2483.5 MHz ISM/SRD band systems. (E.g. RKE-two way Remote Keyless Entry, wireless alarm and security systems, AMR-automatic Meter Reading, Consumer Electronics. Industrial monitoring and control, Wireless Game Controllers, Wireless Audio/Keyboard/Mouse)

Features

Low power consumption. Integrated bit synchronizer. Integrated IF and data filters.

Page 17: Final Mini Report 1

TRANSFORMER RECTIFIER FILTER IC REGULATOR LOAD

MINI PROJECT, 2011 ELECRTONIC MENU CARD

High sensitivity (type -104dBm) Programmable output power -20dBm~1dBm Operation temperature range : -40~+85 deg C Operation voltage: 1.8~3.6 Volts. Available frequency at : 2.4~2.483 GHz Digital RSSI

Applications 2.4 Ghz ISM/SRD band systems Consumer Electronics Industrial monitoring and control Wireless alarm and security systems Home and building automation AMR – Automatic Meter Reading RKE – Two-way Remote Keyless Entry Wireless Game Controllers/Audio/Keyboard/Mouse

POWER SUPPLY

The ac voltage, typically 220V rms, is connected to a transformer, which steps that ac voltage down to the level of the desired dc output. A diode rectifier then provides a full-wave rectified voltage that is initially filtered by a simple capacitor filter to produce a dc voltage. This resulting dc voltage usually has some ripple or ac voltage variation.

A regulator circuit removes the ripples and also remains the same dc value even if the input dc voltage varies, or the load connected to the output dc voltage changes. This voltage regulation is usually obtained using one of the popular voltage regulator IC units.

Block diagram (Power supply

Working principle

Centre tap transformer

In electronics, a center tap is a connection made to a point half way along a winding of a transformer or inductor, or along the element of a resistor or a potentiometer. Taps are

Page 18: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

sometimes used on inductors for the coupling of signals, and may not necessarily be at the half-way point, but rather, closer to one end.230V /12-0-12 transformer is used here.

Centre tap rectifier

Rectifier :

A rectifier is an electrical device that converts alternating current (AC), which periodically reverses direction, to direct current (DC), which is in only one direction, a process known as rectification. Here bridge rectifiers are used. The bridge rectifier circuit produces a higher output voltage than the conventional full-wave rectifier circuit.

FILTER:

The capacitor is used after rectification for filtering or smoothening the rectified output. Then the regulated by using regulator IC LM7805. The capacitor C2 is connected to the input of the regulator to eliminate inductive effect due to long distribution leads. The output capacitor C6 improves the transient response.

IC voltage regulators

The power supply is the most indispensible part of any project. IC regulators are versatile and relatively inexpensive. The regulated circuit is used to maintain constant output level. The integrated circuit regulator, some time called the three terminal regulators contains the circuitry of reference source error amplitude control device and overloaded

Page 19: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

protection all in a single IC chip. They are connected between output of the filter and input of the load.

The 78xx series consist of three terminal +ve voltage regulators. With adequate heat sinking they can deliver output current in excess of 1A. For proper operation, there should be a common ground between the input andoutput voltages. Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the circuitry for reference source, comparator amplifier, control device, and overload protection all in a single IC. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. The regulators can be selected for operation with load currents from hundreds of milli amperes to tens of amperes, corresponding to power ratings from milli watts to tens of watts.

A fixed three-terminal voltage regulator has an unregulated dc input voltage, Vi, applied to one input terminal, a regulated dc output voltage, Vo, from a second terminal, with the third terminal connected to ground.

The series 78 regulators provide fixed positive regulated voltages from 5 to 24 volts. Similarly, the series 79 regulators provide fixed negative regulated voltages from 5 to 24 volts.

For ICs, microcontroller, LCD --------- 5 volts For alarm circuit, motor, relay circuits --------- 12 volts

 

RECEIVER SECTION

This section also contains the components explained in the transmitter section except the control switches. This section is placed at the kitchen. It also contains MCU, RF transceiver, RF

Page 20: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

interface, LCD, LED and a buzzer. Here the RF transceiver receives the data transmitted by the transmitter and gives it to MCU through RF interface. The MCU displays the received data on LCD after processing. Thus a waiter can easily find out the requirements of a customer.

SOFTWARE SECTION TRANSMITTER

START

INITIALISATION OF PORTS, MEMORY LOCATIONS, SERIAL COMMUNICATION AND LCD

CHECK FOR NEW ORDER OR REVIEW ORDER

CHECK FOR INC BUTTON

DISPLAY ITEM LIST

DISPLAY NEXT ITEM

DISPLAY PREVIOUS ITEM

CHECK FOR DEC BUTTON

X

Y

Z

REVIEW ORDER

NEW ORDER

NO

YES

NO

YES

YES

Page 21: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CHECK FOR CANCEL BUTTON

NO

CHECK FOR ENTER BUTTON

DISPLAY ORDERED QUANTITY AND COST

CHECK FOR INC BUTTON

INCREMENT ORDER QUANTITY

DECREMENT ORDER QUANTITY

CHECK FOR DEC BUTTON

CHECK FOR ENTER BUTTON

Y

NO

YES

NO

YES

NO

YES

NOYES

STORE OREDER ITEMAND QUANTITY IN RAM BUFFER

Page 22: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

X

CHECK FOR INC BUTTON

DISPLAY NEXT ITEM AND QUANTITY ORDERED

DISPLAY PREVIOUS ITEM OAND QUANTITY ORDEREDED

CHECK FOR DEC BUTTON

CHECK FOR CANCEL BUTTON

CHECK FOR SEND BUTTON

Z

NO

YES

NO

YES

NO

YES

NO

DISPLAY ORDERED ITEM AND QUANTITY AND TOTAL COST

Page 23: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

SEND ORDERED ITEM AND QUANTITY THROUGH SERIAL PORT

STOP

Z

YES

Page 24: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

RECEIVERSTART

INITIALISATION OF PORTS, MEMORY, SERIAL COMMUNICATION, INTERREPTS AND LCD

STORE RECEIVED BYTES IN RAM ARRAY AND SOUND BUSSER

DISPLAY THE ITEM NAME AND QUANDITY IN LCD

DISPLAY NEXT ITEM

CHECK FOR ANY BYTES RECEIVED

DISPLAY AS NO ORDER

CHECK FOR DEC BUTTON

CHECK FOR INC

BUTTON

NO

YES

NO

NO

Page 25: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

PROGRAM

;PROGRAM FOR E MENU CARD TRANSMITTER

#include <p16f877A.inc> __CONFIG _HS_OSC&_PWRTE_ON&_CP_OFF&_WDT_OFF&_LVP_OFF

LCD_DATA EQU PORTDLCD_CNTRL EQU PORTCRS EQU 0RW EQU 1EN EQU 2

;LEDS ARE IN PORTBLED1 EQU 2LED2 EQU 3BUSSER EQU 4

;KEYS ARE CONNECTED IN PORTACANCEL_KEY EQU 0ENTER_KEY EQU 1SEND_KEY EQU 2INC_KEY EQU 3DEC_KEY EQU 4

TEMP_LCD_COM EQU 0X23TEMP_LCD_DAT EQU 0X24PRG_ADDR_MSB EQU 0X25PRG_ADDR_LSB EQU 0X26PRG_DAT_MSB EQU 0X27PRG_DAT_LSB EQU 0X28 MSG_CHR_CNTR EQU 0X29TEMP_1 EQU 0X33TEMP_2 EQU 0X34TEMP_3 EQU 0X35TEMP_4 EQU 0X36EEPROM_DATA EQU 0X37

ITEM_COUNTER EQU 0X38ITEM_QUANTITY EQU 0X39

PRICE_VALUE EQU 0X3A

MODE_COUNTER EQU 0X3BTOTAL_COST EQU 0X3C

RAM_PNTR EQU 0X3E

DISPLAY PREVIOUS ITEMS

STOP

Page 26: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

FLAG_BITS EQU 0X3F

ACK_ERROR EQU 0ERROR1 EQU 1

BCD_1 EQU 0X40BCD_2 EQU 0X41BCD_3 EQU 0X42

MULT_1 EQU 0X43MULT_2 EQU 0X44

RESMULT_LSB EQU 0X45RESMULT_MSB EQU 0X46ADRESS_CODE EQU 0X47

CHAR_SIZE EQU 0X49TEMP_5 EQU 0X4B CBLOCK 50H R3,R2,R1,R0 ;MUST START ON BINARY XXXXX000. COUNT, LBYTE, MBYTE, HBYTE ENDC

;RAM LOCATIONS 0X60 TO 0X6A ARE USED FOR STORING ORDERED LIST;5 ITEM PER ORDER;ORDER CODE IS STORED IN ONE LOCATION AND ORDER QUANTITY IS IN PRECEEDING ;LOCATION

ORG 0x0000

;MACRO FOR MULTIPLICATION - 8X8 UNSIGNED;**************************************************************************************MULT MACRO BIT ;MACRO FOR UNSIGNEDMULTIPLICATION

BTFSC MULT_1,BITADDWF RESMULT_MSB,FRRF RESMULT_MSB,FRRF RESMULT_LSB,FENDM ;END OF MACRO FOR MULTIPLICATION

;;;STARTING OF POGRAM

START:CALL DELAY_1 ;FORMAL DELAY

CALL INIT_PORTS ;PORT INITILISATIONCALL INIT_SERIALCALL INIT_LCD ;LCD INITIAILISATION

;;;WELCOME MESSAGE

START_DISPLAY:BANKSEL PORTEBSF PORTB,LED1

Page 27: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BSF PORTB,LED2BSF PORTB,BUSSERBANKSEL EEADRMOVLW LOW(MSG1)MOVWF EEADRMOVLW HIGH(MSG1)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCD

CALL DELAY_3

CALL STRNG_MSSG

BANKSEL EEADRMOVLW LOW(MSG2)MOVWF EEADRMOVLW HIGH(MSG2)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0XC0MOVWF TEMP_LCD_COMCALL COMMAND_LCD

CALL STRNG_MSSG

CALL DELAY_1CALL DELAY_1

CALL DELAY_1CALL DELAY_1

BCF PORTB,LED1BCF PORTB,LED2BCF PORTB,BUSSER

CLRF ITEM_COUNTER CLRF ITEM_QUANTITY CLRF MODE_COUNTER

MOVLW 0X50MOVWF FSRMOVLW 0X0FMOVWF TEMP_3CALL CLEAR_RAM

;*****************MAIN ROUTINE *****************************

Page 28: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MAIN_LOOP:BANKSEL EEADRMOVLW LOW(MSG3)MOVWF EEADRMOVLW HIGH(MSG3)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X09MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL STRNG_MSSG

MOVF MODE_COUNTER,WBTFSS STATUS,ZGOTO DIS_REVIEW

BANKSEL EEADRMOVLW LOW(MSG4)MOVWF EEADRMOVLW HIGH(MSG4)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0XC0MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL STRNG_MSSG

BTFSS PORTA,ENTER_KEYGOTO NEW_ORDERGOTO CHECK_KEYS

DIS_REVIEW:BANKSEL EEADRMOVLW LOW(MSG5)MOVWF EEADRMOVLW HIGH(MSG5)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0XC0MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL STRNG_MSSG

BTFSS PORTA,ENTER_KEYGOTO REVEIW_ORDER

CHECK_KEYS:

Page 29: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CALL DELAY_1CALL DELAY_1BANKSEL PORTABTFSC PORTA,INC_KEYGOTO CHECK_MODE_DEC MOVF MODE_COUNTER,WBTFSC STATUS,ZINCF MODE_COUNTER,F

CHECK_MODE_DEC:BTFSC PORTA,DEC_KEYGOTO MAIN_LOOPMOVF MODE_COUNTER,WBTFSS STATUS,ZDECF MODE_COUNTER,FGOTO MAIN_LOOP

NEW_ORDER:MOVLW 0X50MOVWF FSRMOVLW 0X0FMOVWF TEMP_3CALL CLEAR_RAM

CLRF TOTAL_COST

MOVLW 0X01MOVWF ITEM_COUNTERMOVWF ITEM_QUANTITYMOVLW 0X50MOVWF FSR

DIS_ITEM:BANKSEL PORTABTFSS PORTA,CANCEL_KEYGOTO MAIN_LOOPBANKSEL TEMP_LCD_COMMOVLW 0X01MOVWF TEMP_LCD_COM ;CLEAR DISPLAYCALL COMMAND_LCD

MOVF ITEM_COUNTER,WMOVWF MULT_1MOVLW 0X10MOVWF MULT_2CALL MUL_8X8MOVF RESMULT_LSB,WMOVWF TEMP_1CALL DISPLAY_ITEMCALL DELAY_1

BANKSEL TEMP_LCD_COMMOVLW 0XC0MOVWF TEMP_LCD_COM ;CLEAR DISPLAYCALL COMMAND_LCD

Page 30: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVLW HIGH(PRICE_TABLE) MOVWF PCLATHMOVF ITEM_COUNTER,WCALL PRICE_TABLEMOVWF TEMP_1MOVWF PRICE_VALUECALL BIN_BCDMOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLYMOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLYCALL DELAY_1

BTFSC PORTA,INC_KEYGOTO CHECK_DEC_ITEMBCF STATUS,CMOVF ITEM_COUNTER,WSUBLW 0X05BTFSS STATUS,ZINCF ITEM_COUNTER,F

CHECK_DEC_ITEM:BTFSC PORTA,DEC_KEYGOTO CHECK_QUANTITYMOVF ITEM_COUNTER,WSUBLW 0X01BTFSS STATUS,ZDECF ITEM_COUNTER,F

CHECK_QUANTITY:BTFSC PORTA,ENTER_KEYGOTO DIS_ITEMMOVLW 0X01MOVWF ITEM_QUANTITY

DIS_QTY:BANKSEL TEMP_LCD_COMMOVLW 0XC5MOVWF TEMP_LCD_COM ;CLEAR DISPLAYCALL COMMAND_LCD

MOVLW " "CALL LCD_DIS

MOVLW "X"CALL LCD_DIS

MOVF ITEM_QUANTITY,WMOVWF TEMP_1CALL BIN_BCDMOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

Page 31: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

BTFSC PORTA,INC_KEYGOTO CHECK_DEC_QTY

MOVF ITEM_QUANTITY,WSUBLW 0X0ABTFSS STATUS,ZINCF ITEM_QUANTITY,F

CHECK_DEC_QTY:BTFSC PORTA,DEC_KEYGOTO DIS_TOTALMOVF ITEM_QUANTITY,WBTFSS STATUS,ZDECF ITEM_QUANTITY,F

DIS_TOTAL:MOVLW "="CALL LCD_DIS

MOVF ITEM_QUANTITY,WMOVWF MULT_1MOVF PRICE_VALUE,WMOVWF MULT_2CALL MUL_8X8MOVF RESMULT_LSB,WMOVWF TEMP_1

CALL BIN_BCDMOVF 0X42,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

MOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLYMOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLYCALL DELAY_1CALL DELAY_1

BTFSC PORTA,ENTER_KEYGOTO DIS_QTY

MOVF ITEM_QUANTITY,WMOVWF MULT_1MOVF PRICE_VALUE,WMOVWF MULT_2CALL MUL_8X8MOVF RESMULT_LSB,WBCF STATUS,C

Page 32: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

ADDWF TOTAL_COST,F

MOVF TOTAL_COST,WMOVWF 0X5BMOVF ITEM_COUNTER,WMOVWF INDFINCF FSR,FMOVF ITEM_QUANTITY,WMOVWF INDFINCF FSR,FMOVF FSR,WSUBLW 0X59BTFSS STATUS,ZGOTO DIS_ITEMMOVLW 0X59MOVWF FSRGOTO DIS_ITEM

REVEIW_ORDER:BANKSEL EEADRMOVLW LOW(MSG6)MOVWF EEADRMOVLW HIGH(MSG6)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X07MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL STRNG_MSSG

MOVF 0X5B,WMOVWF TEMP_1

CALL BIN_BCDMOVF 0X42,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

MOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLYMOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLYCALL DELAY_1

MOVLW 0X50MOVWF FSR

SCROLL_REVEIW:BTFSS PORTA,SEND_KEYGOTO SEND_DATA

Page 33: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVLW 0XC0MOVWF TEMP_LCD_COMCALL COMMAND_LCD

MOVF INDF,WMOVWF MULT_1MOVLW 0X10MOVWF MULT_2CALL MUL_8X8MOVF RESMULT_LSB,WMOVWF TEMP_1CALL DISPLAY_ITEMBANKSEL TEMP_LCD_COMMOVLW 0XCDMOVWF TEMP_LCD_COM ;CLEAR DISPLAYCALL COMMAND_LCD

INCF FSRMOVF INDF,WMOVWF TEMP_1CALL BIN_BCDMOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

MOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

CALL DELAY_1CALL DELAY_1

CALL DELAY_1

DECF FSR,F

BTFSC PORTA,INC_KEYGOTO CHECK_DEC_REVEIW

MOVF FSR,WSUBLW 0X59BTFSS STATUS,CGOTO REVEIW_FULLINCF FSR,FINCF FSR,F

CHECK_DEC_REVEIW:BTFSC PORTA,DEC_KEYGOTO CHECK_CANCEL_REVEIWMOVF FSR,WSUBLW 0X50BTFSC STATUS,ZGOTO REVEIW_FULLDECF FSR,FDECF FSR,FGOTO CHECK_CANCEL_REVEIW

Page 34: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

REVEIW_FULL:BSF PORTB,BUSSERCALL DELAY_1CALL DELAY_1BCF PORTB,BUSSER

CHECK_CANCEL_REVEIW:BTFSC PORTA,CANCEL_KEYGOTO SCROLL_REVEIWGOTO MAIN_LOOP

SEND_DATA:BANKSEL EEADRMOVLW LOW(MSG7) ;LOAD PROGRAM MEMORY ADDRESS LSB TO BE

READ TO EEADR MOVWF EEADRMOVLW HIGH(MSG7) BANKSEL EEADRH ;LOAD PROGRAM MEMORY ADDRESS MSB TO BE

READ TO EEADRH MOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08 ;LOAD NO OF BYTES TO BE READ FROM PROGRAM

MEMORYMOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COM ;COMMAND FOR FIRST LINECALL COMMAND_LCDCALL DELAY_2CALL STRNG_MSSG ;READ PROGRAM MEMORY AND DISPLAY IN LCDCALL DELAY_1

;SENDING CODE BYTESCALL WAIT_TXMOVLW "C"BANKSEL TXREGMOVWF TXREG

CALL DELAY_2

MOVLW 0X0EMOVWF TEMP_3 MOVLW 0X50MOVWF FSR

CONT_SEND:CALL WAIT_TX

MOVF INDF,W BANKSEL TXREGMOVWF TXREGCALL DELAY_2INCF FSR,FBANKSEL TEMP_3DECFSZ TEMP_3,FGOTO CONT_SEND

Page 35: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVLW 0X05MOVWF TEMP_3

DIS_COMPLTD:BSF PORTB,LED1

;MESSAGE IN LCD AS COMPLTEDBANKSEL EEADRMOVLW LOW(MSG8)MOVWF EEADRMOVLW HIGH(MSG8)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTR

MOVLW 0X01MOVWF TEMP_LCD_COM ;COMMAND FOR FIRST LINECALL COMMAND_LCDCALL DELAY_2

CALL STRNG_MSSGCALL DELAY_1BCF PORTB,LED1CALL DELAY_1DECFSZ TEMP_3,FGOTO DIS_COMPLTD

GOTO MAIN_LOOP

;INITIALISATION OF PORTS

INIT_PORTS:BANKSEL ADCON1 ;PORTA AS DIGITAL OUTPUTMOVLW 0X07MOVWF ADCON1BANKSEL TRISA ;MOVLW 0XFFMOVWF TRISA

BANKSEL TRISB ;RB0 TO RB4 IS INPUT FOR KEYMOVLW 0X00 ;RB5 TO RB6 OUTPUT RELAYMOVWF TRISBBANKSEL TRISC ;RC0 TO RC2 IS OUTPUT FOR LCDMOVLW 0XF0MOVWF TRISCBANKSEL TRISDMOVLW 0X00 ;PORTD AS OUTPUTMOVWF TRISD ;LCD DATA

BANKSEL TRISE ;PORTE AS OUTPUTMOVLW 0XE0 ;RE0 ,ANDWF TRISE,F ;RE1, RE2 AS LED OUTPUTMOVLW 0X00IORWF TRISE,F

MOVLW 0X00

Page 36: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BANKSEL PORTAMOVWF PORTAMOVLW 0XFFBANKSEL PORTBMOVWF PORTBBANKSEL PORTCMOVLW 0XF0MOVWF PORTCBANKSEL PORTDMOVLW 0X00MOVWF PORTDBANKSEL PORTDMOVLW 0X00MOVWF PORTERETURN

;SERILA COMMUNICATION ENABLE

INIT_SERIAL:BANKSEL TRISCMOVLW 0XC0MOVWF TRISCBANKSEL SPBRGMOVLW 0X19 ;BAUDRATE REG. IS LOADED BY 19h=25 FOR 9,600 BAUD AT 4MHZMOVWF SPBRGBANKSEL TXSTAMOVLW 0X24 ;00100100 TRANSMIT ENABLED BY BRGH=1 8 BIT TRANSMISSION

ASYNCHROUNOUSMOVWF TXSTABANKSEL RCSTA ;ENABLE PORTC AS TX/RX RECEIVE ENABLEDMOVLW 0X80MOVWF RCSTARETURN

;*************ROUTINE FOR WAIT TX COMPLETE***********************WAIT_TX:

BANKSEL TXSTABTFSS TXSTA,TRMTGOTO WAIT_TXRETURN

;INITIALISATION OF LCD MODULEINIT_LCD:

BANKSEL TEMP_LCD_COM MOVLW 0X3C ;lcd declaration as 8bit/char,2rows,5x10dots/char MOVWF TEMP_LCD_COM

CALL COMMAND_LCD ;strobe command to display MOVLW 0X0C ;screen ON and cursor OFF on,no blink

MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display MOVLW 0X06 ;shift cursor right MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display MOVLW 0X01 ;clear memory and home cursor MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display

Page 37: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CALL DELAY_1MOVLW 0X81 ;move cursor space to 3,line1MOVWF TEMP_LCD_COM

CALL COMMAND_LCD ;strobe command to displayRETURN

;COMMAND TO LCDCOMMAND_LCD:

CALL DELAY_3BANKSEL PORTCMOVF TEMP_LCD_COM,W ;DATA FROM RAM TO LCD DATA PORTMOVWF LCD_DATABCF LCD_CNTRL,RS ;RS LOW COMMAND REGISTER SELECTEDBCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTEDBSF LCD_CNTRL,EN ;ENABLE LCDNOPNOPNOP ;WAIT FOR DATA READING BY LCDBCF LCD_CNTRL,EN ;DISABLE LCDRETURN

; DATA TO LCD MODULELCD_DIS:

BANKSEL LCD_DATAMOVWF LCD_DATACALL DELAY_3BSF LCD_CNTRL,RS ;RS HIGH DATA REGISTER SELECTEDBCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTEDBSF LCD_CNTRL,EN ;ENABLE LCDNOP ;WAIT FOR DATA READING BY LCDNOPNOPNOPBCF LCD_CNTRL,EN ;DISABLE LCDRETURN

;READ PROGRAM MEMORY AND GIVE STRING DATA TO LCD

STRNG_MSSG:BANKSEL EECON1BSF EECON1,EEPGD ;SELECT PROGRAM MEMORYBSF EECON1,RD ;START READ OPERATIONNOPNOP ;WAIT FOR READ CYCLEBANKSEL EEDATAMOVF EEDATA,W ;STORE READ DATA (LSB)BANKSEL PRG_DAT_LSBMOVWF PRG_DAT_LSBBANKSEL EEDATHMOVF EEDATH,WBANKSEL PRG_DAT_MSBMOVWF PRG_DAT_MSB ;STORE RAED DATA(MSB)DECFSZ MSG_CHR_CNTR,FGOTO LCD_DISLRETURN

;********************* ROUTINE FOR REALIGN OF 14 BIT PACKED BCD TO NORMAL 16 BIT UNPACKED BCD**************

Page 38: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

LCD_DISL:BCF STATUS,C

RLF PRG_DAT_LSB,F RLF PRG_DAT_MSB,F

BCF STATUS,CRRF PRG_DAT_LSB,FMOVF PRG_DAT_MSB,WCALL LCD_DISMOVF PRG_DAT_LSB,WCALL LCD_DISBANKSEL EEADRINCF EEADR,FGOTO STRNG_MSSG

;******************************************************************************;ROUTINE FOR DISPLAYING NUMBERS IN LCDLCD_NUM_DISPLY:

MOVLW HIGH(ASCII_NUM) MOVWF PCLATHMOVF TEMP_1,WPAGESEL ASCII_NUMCALL ASCII_NUMPAGESEL LCD_DISCALL LCD_DISRETURN

;ROUTINR FOR DISPLAY RAM CONTENTDISPLAY_RAM:

NOP

CONT_DISRAM1:MOVF INDF,WANDLW 0X7FCALL LCD_DISINCF FSR,F

MOVF TEMP_2,WBCF STATUS,CSUBWF FSR,WBTFSS STATUS,ZGOTO CONT_DISRAM1MOVLW 0X60MOVWF FSRRETURN

;ROUTINE FOR DISPLAYING ITEM NAME FROM THE TABLEDISPLAY_ITEM:

MOVLW 0X0FMOVWF TEMP_2

CONT_DISPLAY_ITEM:MOVLW HIGH(MENU_TABLE) MOVWF PCLATHMOVF TEMP_1,WCALL MENU_TABLECALL LCD_DISINCF TEMP_1,F

Page 39: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

DECFSZ TEMP_2,FGOTO CONT_DISPLAY_ITEMRETURN

;********************DELAY ROUTINES****************************

DELAY_1:BANKSEL 0X30MOVLW 0X05MOVWF 0X30

DELAY_1A:CALL DELAY_2DECFSZ 0X30,FGOTO DELAY_1ARETURN

DELAY_2:BANKSEL 0X31MOVLW 0X7FMOVWF 0X31

DELAY_2A:CALL DELAY_3DECFSZ 0X31,FGOTO DELAY_2ARETURN

DELAY_3:BANKSEL 0X32MOVLW 0XFFMOVWF 0X32

DELY_3A:DECFSZ 0X32,FGOTO DELY_3ARETURN

;ROUTINE FOR CONVERTING PACKED BCD TO HEX;DATA TO BE CONVERTED IS IN WBCD_PACK_BIN:

BANKSEL TEMP_2MOVWF TEMP_2ANDLW 0XF0 ;EXTARCT FIRST BCD (MSB)MOVWF MULT_1SWAPF MULT_1,F ;MULTIPLY WITH 10MOVLW 0X0AMOVWF MULT_2CALL MUL_8X8MOVF TEMP_2,WANDLW 0X0F ;EXTARCT SECOND BCD(LSB)BCF STATUS,CADDWF RESMULT_LSB,W ;ADD WITH THE RESULT OF (FIRST BCD X 10)RETURN

;SUBROUTINE FOR 8 X 8 MULTIPLICATIONMUL_8X8

CLRF RESMULT_MSB

Page 40: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CLRF RESMULT_LSBMOVF MULT_2,W ;MOVE THE MULTIPLICAND TO W REG.BCF STATUS,C ;CLEAR THE CARRY BIT IN THE STATUS REG.MULT 0MULT 1MULT 2MULT 3MULT 4MULT 5MULT 6MULT 7RETLW 0

;******************************BINARY TO BCD CONVERSION***********************BIN_BCD:

MOVLW 0X00MOVWF TEMP_3 ;TEMPORARY COUNTER MOVWF TEMP_4MOVWF BCD_1 ;BCD OUTPUT LSBMOVWF BCD_2 ;BCD OUT PUTMOVWF BCD_3 ;BCD OUT PUT MSBMOVF TEMP_1,WBTFSC STATUS,ZRETURN

BCD_CONV:INCF BCD_1,FMOVLW 0X0A ;CHECK FOR NUMBER GREATER THAN NINESUBWF BCD_1,WBTFSS STATUS,Z ;IF YES CLEAR THAT BYTE AND

INCREMENT NEXT BYTEGOTO CHECK_CPLTD CLRF BCD_1INCF BCD_2,FMOVLW 0X0ASUBWF BCD_2,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_2INCF BCD_3,FMOVLW 0X0ASUBWF BCD_3,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_3INCF BCD_3,FMOVLW 0X0ASUBWF BCD_3,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_3

CHECK_CPLTD:INCF TEMP_3,F ;CHECK FOR COUNTER REACHED THE BINARY NUNBER TO

BE CONVERTEDMOVF TEMP_1,W ;IF YES STOP CONVERSION AND RETURN WITH BCD

OUTPUTS INSUBWF TEMP_3,W ;BCD1,BCD2,AND BCD3BTFSS STATUS,Z

Page 41: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

GOTO BCD_CONV RETURN

;EEPROM READEEPROM_RD:

BANKSEL TEMP_2MOVF TEMP_2,WBANKSEL EEADRMOVWF EEADRBANKSEL EECON1BCF EECON1,EEPGDBSF EECON1,RDRETURN

;EEPROM WRITE

EEPROM_WR:BANKSEL EECON1

CHK_WR_CPLTD:BTFSC EECON1,WRGOTO CHK_WR_CPLTDBANKSEL TEMP_2MOVF TEMP_2,WBANKSEL EEADRMOVWF EEADRBANKSEL TEMP_1MOVF TEMP_1,WBANKSEL EEDATAMOVWF EEDATABANKSEL EECON1BCF EECON1,EEPGDBSF EECON1,WRENBCF INTCON,GIEMOVLW 0X55MOVWF EECON2MOVLW 0XAAMOVWF EECON2BSF EECON1,WRBSF INTCON,GIEBCF EECON1,WRENRETURN

;ROUTINE FOR CLEAR RAM LOCATIONS

CLEAR_RAM:MOVLW 0X00MOVWF INDFINCF FSR,FBANKSEL TEMP_3DECFSZ TEMP_3,FGOTO CLEAR_RAMRETURN

LOAD_RAM:MOVLW 0X0AMOVWF TEMP_3 MOVLW 0X57MOVWF FSR MOVLW 0X00

Page 42: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVWF TEMP_2CONT_READ:

CALL EEPROM_RDBANKSEL EEDATAMOVF EEDATA,WMOVWF INDFINCF FSR,FBANKSEL TEMP_2INCF TEMP_2,FDECFSZ TEMP_3,FGOTO CONT_READRETURN

;;********************ROUTINE FOR CHECKING RAM BYTES WITH PROGRAM MEMORY BYTES*******************

CHK_BYTE:CALL EEPROM_RDBANKSEL EEDATAMOVF EEDATA,WBCF STATUS,CSUBWF INDF,WBTFSS STATUS,ZGOTO NO_MATCHBANKSEL CHAR_SIZE

; INCF TEMP_1,FDECFSZ CHAR_SIZE,FGOTO NOCHK_CPLTDRETURN

NOCHK_CPLTD:INCF FSR,FINCF TEMP_2,FGOTO CHK_BYTE

NO_MATCH:BANKSEL FLAG_BITSBSF FLAG_BITS,ERROR1RETURN

;*********************LOOK UP TABLE & PRINTING DETAILS*************************************

ORG 0X0700MSG1:

da " ELECTRONIC "MSG2:

da " MENU CARD "

MSG3:da " ENTER A CHOICE "

MSG4:da " NEW ORDER "

Page 43: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MSG5:da " REVIEW ORDER "

MSG6:da " TOTAL COST= "

MSG7:da "SENDING ORDER "

MSG8:da " COMPLETED..... "ORG 0X0900

ASCII_NUM:ADDWF PCL,F

dt "0123456789:/ abcdefijk"

ORG 0X0500

MENU_TABLE:ADDWF PCL,F

dt " NO ITEM "dt "01.POROTTA "dt "02.CHAPPATHI "dt "03.TEA "dt "04.COFFEE "

dt "05.CURRY " dt "END OF MENU "

ORG 0X0600PRICE_TABLE:

ADDWF PCL,Fdt 0X06dt 0X05dt 0X06dt 0X07dt 0X0Adt 0X0Fdt 0X0A

END

;PROGRAM FOR E MENU CARD RECEIVER

#include <p16f877A.inc> __CONFIG _HS_OSC&_PWRTE_ON&_CP_OFF&_WDT_OFF&_LVP_OFF

W_TEMP EQU 0X4F ;TEMPERORY REGISTER FOR W DURING INTERRUPTSTATUS_TEMP EQU 0X4E ;TEMPERORY REGISTER FOR STATUS DURING INTERRUPT

Page 44: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

PCLATH_TEMP EQU 0X4D ;TEMPERORY REGISTER FOR PCLATH DURING INTERRUPT

LCD_DATA EQU PORTDLCD_CNTRL EQU PORTCRS EQU 0RW EQU 1EN EQU 2

;LEDS ARE IN PORTBLED1 EQU 2LED2 EQU 3BUSSER EQU 4

;KEYS ARE CONNECTED IN PORTACANCEL_KEY EQU 0ENTER_KEY EQU 1SEND_KEY EQU 2INC_KEY EQU 3DEC_KEY EQU 4

TEMP_LCD_COM EQU 0X23TEMP_LCD_DAT EQU 0X24PRG_ADDR_MSB EQU 0X25PRG_ADDR_LSB EQU 0X26PRG_DAT_MSB EQU 0X27PRG_DAT_LSB EQU 0X28 MSG_CHR_CNTR EQU 0X29TEMP_1 EQU 0X33TEMP_2 EQU 0X34TEMP_3 EQU 0X35TEMP_4 EQU 0X36EEPROM_DATA EQU 0X37

ITEM_COUNTER EQU 0X38ITEM_QUANTITY EQU 0X39

PRICE_VALUE EQU 0X3A

MODE_COUNTER EQU 0X3BTOTAL_COST EQU 0X3C

RAM_PNTR EQU 0X3E

FLAG_BITS EQU 0X3F

NEW_DATA EQU 0RECVD EQU 1

BCD_1 EQU 0X40BCD_2 EQU 0X41BCD_3 EQU 0X42

Page 45: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MULT_1 EQU 0X43MULT_2 EQU 0X44

RESMULT_LSB EQU 0X45RESMULT_MSB EQU 0X46ADRESS_CODE EQU 0X47

CHAR_SIZE EQU 0X49

TEMP_5 EQU 0X4B

CBLOCK 50H R3,R2,R1,R0 ;MUST START ON BINARY XXXXX000. COUNT, LBYTE, MBYTE, HBYTE ENDC

;RAM LOCATIONS 0X60 TO 0X6A ARE USED FOR STORING ORDERED LIST;5 ITEM PER ORDER;ORDER CODE IS STORED IN ONE LOCATION AND ORDER QUANTITY IS IN PRECEEDING ;LOCATION

ORG 0x0000

GOTO START

;interrupt routineORG 0x0004

MOVWF W_TEMP ;saving acccumelatorSWAPF STATUS,W ;saving status registerCLRF STATUS ;clear status reg.MOVWF STATUS_TEMP ;MOVF PCLATH,WMOVWF PCLATH_TEMPCLRF PCLATHBANKSEL FLAG_BITSBTFSS FLAG_BITS,NEW_DATA ;CHECK FOR NEW DATA FLAG FOR RECEIVE GOTO NO_RECEIVE

SAVE_DATA:BSF FLAG_BITS,RECVDBANKSEL RCREGMOVF RCREG,W ;READ RECEIVED BYTE AND SAVE IN RAM;

MOVWF INDF; MOVWF TXREG

INCF FSR,FMOVF FSR,WSUBLW 0X5FBTFSS STATUS,ZGOTO NO_RECEIVE

STOP_MSG:BANKSEL FLAG_BITSBCF FLAG_BITS,NEW_DATABCF RCSTA,CREN

Page 46: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

NO_RECEIVE:MOVF PCLATH_TEMP,WMOVWF PCLATHSWAPF STATUS_TEMP,W ;retrieving status reg.MOVWF STATUSSWAPF W_TEMP,F ;retreiving accumelatorSWAPF W_TEMP,WRETFIE ;exit interrupt routine

;MACRO FOR MULTIPLICATION - 8X8 UNSIGNED;**************************************************************************************MULT MACRO BIT ;MACRO FOR UNSIGNEDMULTIPLICATION

BTFSC MULT_1,BITADDWF RESMULT_MSB,FRRF RESMULT_MSB,FRRF RESMULT_LSB,FENDM ;END OF MACRO FOR MULTIPLICATION

;;;STARTING OF POGRAM

START:CALL DELAY_1 ;FORMAL DELAY

CALL INIT_PORTS ;PORT INITILISATION

CALL INIT_LCD ;LCD INITIAILISATIONMOVLW 0X50MOVWF FSRCALL EN_INTRCALL INIT_SERIALCLRF FLAG_BITS

;;;WELCOME MESSAGE

START_DISPLAY:BANKSEL PORTEBSF PORTB,LED1BSF PORTB,LED2BSF PORTB,BUSSERBANKSEL EEADRMOVLW LOW(MSG1)MOVWF EEADRMOVLW HIGH(MSG1)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCD

Page 47: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CALL DELAY_3

CALL STRNG_MSSG

BANKSEL EEADRMOVLW LOW(MSG2)MOVWF EEADRMOVLW HIGH(MSG2)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0XC0MOVWF TEMP_LCD_COMCALL COMMAND_LCD

CALL STRNG_MSSG

CALL DELAY_1CALL DELAY_1

CALL DELAY_1CALL DELAY_1

BCF PORTB,LED1BCF PORTB,LED2BCF PORTB,BUSSERCLRF FLAG_BITS

CLEAR_MEMORY:MOVLW 0X50MOVWF FSRMOVLW 0X0FMOVWF TEMP_3CALL CLEAR_RAMMOVLW 0X4FMOVWF FSRBSF FLAG_BITS,NEW_DATA

;*****************MAIN ROUTINE *****************************MAIN_LOOP:

BANKSEL RCSTABSF RCSTA,CRENBANKSEL FLAG_BITSBTFSC FLAG_BITS,RECVDGOTO NEW_ORDERBANKSEL EEADRMOVLW LOW(MSG3)MOVWF EEADRMOVLW HIGH(MSG3)BANKSEL EEADRHMOVWF EEADRH

Page 48: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BANKSEL MSG_CHR_CNTRMOVLW 0X08MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL STRNG_MSSG

CALL DELAY_1GOTO MAIN_LOOP

NEW_ORDER:BSF PORTB,LED1BSF PORTB,BUSSERCALL DELAY_1CALL DELAY_1CALL DELAY_1CALL DELAY_1CALL DELAY_1CALL DELAY_1CALL DELAY_1CALL DELAY_1

BCF PORTB,LED1BCF PORTB,BUSSERBCF FLAG_BITS,RECVDBCF FLAG_BITS,NEW_DATA

REVEIW_ORDER:BANKSEL EEADRMOVLW LOW(MSG4)MOVWF EEADRMOVLW HIGH(MSG4)BANKSEL EEADRHMOVWF EEADRHBANKSEL MSG_CHR_CNTRMOVLW 0X07MOVWF MSG_CHR_CNTRMOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCDCALL DELAY_3CALL STRNG_MSSG

MOVLW 0X50MOVWF FSR

SCROLL_REVEIW:MOVLW 0X01MOVWF TEMP_LCD_COMCALL COMMAND_LCD

CALL DELAY_1MOVF INDF,WMOVWF MULT_1

Page 49: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVLW 0X10MOVWF MULT_2CALL MUL_8X8MOVF RESMULT_LSB,WMOVWF TEMP_1CALL DISPLAY_ITEMBANKSEL TEMP_LCD_COMMOVLW 0XC5MOVWF TEMP_LCD_COM ;CLEAR DISPLAYCALL COMMAND_LCD

;;

INCF FSR,FMOVF INDF,W

MOVWF TEMP_1CALL BIN_BCDMOVF 0X41,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

;MOVF 0X40,WMOVWF TEMP_1CALL LCD_NUM_DISPLY

;CALL DELAY_1

;; CALL DELAY_1;

DECF FSR,F

BTFSC PORTA,INC_KEYGOTO CHECK_DEC_REVEIW

MOVF FSR,WSUBLW 0X59BTFSS STATUS,CGOTO REVEIW_FULLINCF FSR,FINCF FSR,F

;CHECK_DEC_REVEIW:

BTFSC PORTA,DEC_KEYGOTO CHECK_CANCEL_REVEIWMOVF FSR,WSUBLW 0X50BTFSC STATUS,ZGOTO REVEIW_FULLDECF FSR,FDECF FSR,FGOTO CHECK_CANCEL_REVEIW

REVEIW_FULL:BSF PORTB,BUSSERCALL DELAY_1CALL DELAY_1

Page 50: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BCF PORTB,BUSSER;CHECK_CANCEL_REVEIW:

BTFSC PORTA,CANCEL_KEYGOTO SCROLL_REVEIWBSF FLAG_BITS,NEW_DATAGOTO CLEAR_MEMORY

;INITIALISATION OF PORTS

INIT_PORTS:BANKSEL ADCON1 ;PORTA AS DIGITAL OUTPUTMOVLW 0X07MOVWF ADCON1BANKSEL TRISA ;MOVLW 0XFFMOVWF TRISA

BANKSEL TRISB ;RB0 TO RB4 IS INPUT FOR KEYMOVLW 0X00 ;RB5 TO RB6 OUTPUT RELAYMOVWF TRISBBANKSEL TRISC ;RC0 TO RC2 IS OUTPUT FOR LCDMOVLW 0XF0MOVWF TRISCBANKSEL TRISDMOVLW 0X00 ;PORTD AS OUTPUTMOVWF TRISD ;LCD DATA

BANKSEL TRISE ;PORTE AS OUTPUTMOVLW 0XE0 ;RE0 ,ANDWF TRISE,F ;RE1, RE2 AS LED OUTPUTMOVLW 0X00IORWF TRISE,F

MOVLW 0X00BANKSEL PORTAMOVWF PORTAMOVLW 0XFFBANKSEL PORTBMOVWF PORTBBANKSEL PORTCMOVLW 0XF0MOVWF PORTCBANKSEL PORTDMOVLW 0X00MOVWF PORTDBANKSEL PORTDMOVLW 0X00MOVWF PORTERETURN

;SERILA COMMUNICATION ENABLE

INIT_SERIAL:BANKSEL TRISCMOVLW 0XC0MOVWF TRISC

Page 51: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BANKSEL SPBRGMOVLW 0X19 ;BAUDRATE REG. IS LOADED BY 19h=25 FOR 9,600 BAUD AT 4MHZMOVWF SPBRGBANKSEL TXSTAMOVLW 0X24 ;00100100 TRANSMIT ENABLED BY BRGH=1 8 BIT TRANSMISSION

ASYNCHROUNOUSMOVWF TXSTABANKSEL RCSTA ;ENABLE PORTC AS TX/RX RECEIVE ENABLEDMOVLW 0X90MOVWF RCSTARETURN

;INTERRUPT ENABLE FOR SERIAL RECEIVEEN_INTR:

BANKSEL INTCONMOVLW 0XC0MOVWF INTCON ;BANKSEL PIE1BSF PIE1,RCIERETURN

;*************ROUTINE FOR WAIT TX COMPLETE***********************WAIT_TX:

BANKSEL TXSTABTFSS TXSTA,TRMTGOTO WAIT_TXRETURN

;INITIALISATION OF LCD MODULEINIT_LCD:

BANKSEL TEMP_LCD_COM MOVLW 0X3C ;lcd declaration as 8bit/char,2rows,5x10dots/char MOVWF TEMP_LCD_COM

CALL COMMAND_LCD ;strobe command to display MOVLW 0X0C ;screen ON and cursor OFF on,no blink

MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display MOVLW 0X06 ;shift cursor right MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display MOVLW 0X01 ;clear memory and home cursor MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display CALL DELAY_1

MOVLW 0X81 ;move cursor space to 3,line1MOVWF TEMP_LCD_COM

CALL COMMAND_LCD ;strobe command to displayRETURN

;COMMAND TO LCDCOMMAND_LCD:

CALL DELAY_3BANKSEL PORTCMOVF TEMP_LCD_COM,W ;DATA FROM RAM TO LCD DATA PORTMOVWF LCD_DATABCF LCD_CNTRL,RS ;RS LOW COMMAND REGISTER SELECTED

Page 52: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTEDBSF LCD_CNTRL,EN ;ENABLE LCDNOPNOPNOP ;WAIT FOR DATA READING BY LCDBCF LCD_CNTRL,EN ;DISABLE LCDRETURN

; DATA TO LCD MODULELCD_DIS:

BANKSEL LCD_DATAMOVWF LCD_DATACALL DELAY_3BSF LCD_CNTRL,RS ;RS HIGH DATA REGISTER SELECTEDBCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTEDBSF LCD_CNTRL,EN ;ENABLE LCDNOP ;WAIT FOR DATA READING BY LCDNOPNOPNOPBCF LCD_CNTRL,EN ;DISABLE LCDRETURN

;READ PROGRAM MEMORY AND GIVE STRING DATA TO LCD

STRNG_MSSG:BANKSEL EECON1BSF EECON1,EEPGD ;SELECT PROGRAM MEMORYBSF EECON1,RD ;START READ OPERATIONNOPNOP ;WAIT FOR READ CYCLEBANKSEL EEDATAMOVF EEDATA,W ;STORE READ DATA (LSB)BANKSEL PRG_DAT_LSBMOVWF PRG_DAT_LSBBANKSEL EEDATHMOVF EEDATH,WBANKSEL PRG_DAT_MSBMOVWF PRG_DAT_MSB ;STORE RAED DATA(MSB)DECFSZ MSG_CHR_CNTR,FGOTO LCD_DISLRETURN

;********************* ROUTINE FOR REALIGN OF 14 BIT PACKED BCD TO NORMAL 16 BIT UNPACKED BCD**************LCD_DISL:

BCF STATUS,C RLF PRG_DAT_LSB,F RLF PRG_DAT_MSB,F

BCF STATUS,CRRF PRG_DAT_LSB,FMOVF PRG_DAT_MSB,WCALL LCD_DISMOVF PRG_DAT_LSB,WCALL LCD_DISBANKSEL EEADRINCF EEADR,FGOTO STRNG_MSSG

Page 53: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

;******************************************************************************;ROUTINE FOR DISPLAYING NUMBERS IN LCDLCD_NUM_DISPLY:

MOVLW HIGH(ASCII_NUM) MOVWF PCLATHMOVF TEMP_1,WPAGESEL ASCII_NUMCALL ASCII_NUMPAGESEL LCD_DISCALL LCD_DISRETURN

;ROUTINR FOR DISPLAY RAM CONTENTDISPLAY_RAM:

NOP

CONT_DISRAM1:MOVF INDF,WANDLW 0X7FCALL LCD_DISINCF FSR,F

MOVF TEMP_2,WBCF STATUS,CSUBWF FSR,WBTFSS STATUS,ZGOTO CONT_DISRAM1MOVLW 0X60MOVWF FSRRETURN

;ROUTINE FOR DISPLAYING ITEM NAME FROM THE TABLEDISPLAY_ITEM:

MOVLW 0X0FMOVWF TEMP_2

CONT_DISPLAY_ITEM:MOVLW HIGH(MENU_TABLE) MOVWF PCLATHMOVF TEMP_1,WCALL MENU_TABLECALL LCD_DISINCF TEMP_1,FDECFSZ TEMP_2,FGOTO CONT_DISPLAY_ITEMRETURN

;********************DELAY ROUTINES****************************

DELAY_1:BANKSEL 0X30MOVLW 0X05MOVWF 0X30

DELAY_1A:

Page 54: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CALL DELAY_2DECFSZ 0X30,FGOTO DELAY_1ARETURN

DELAY_2:BANKSEL 0X31MOVLW 0X7FMOVWF 0X31

DELAY_2A:CALL DELAY_3DECFSZ 0X31,FGOTO DELAY_2ARETURN

DELAY_3:BANKSEL 0X32MOVLW 0XFFMOVWF 0X32

DELY_3A:DECFSZ 0X32,FGOTO DELY_3ARETURN

;ROUTINE FOR CONVERTING PACKED BCD TO HEX;DATA TO BE CONVERTED IS IN WBCD_PACK_BIN:

BANKSEL TEMP_2MOVWF TEMP_2ANDLW 0XF0 ;EXTARCT FIRST BCD (MSB)MOVWF MULT_1SWAPF MULT_1,F ;MULTIPLY WITH 10MOVLW 0X0AMOVWF MULT_2CALL MUL_8X8MOVF TEMP_2,WANDLW 0X0F ;EXTARCT SECOND BCD(LSB)BCF STATUS,CADDWF RESMULT_LSB,W ;ADD WITH THE RESULT OF (FIRST BCD X 10)RETURN

;SUBROUTINE FOR 8 X 8 MULTIPLICATIONMUL_8X8

CLRF RESMULT_MSBCLRF RESMULT_LSBMOVF MULT_2,W ;MOVE THE MULTIPLICAND TO W REG.BCF STATUS,C ;CLEAR THE CARRY BIT IN THE STATUS REG.MULT 0MULT 1MULT 2MULT 3MULT 4MULT 5MULT 6MULT 7RETLW 0

;******************************BINARY TO BCD CONVERSION***********************BIN_BCD:

MOVLW 0X00

Page 55: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

MOVWF TEMP_3 ;TEMPORARY COUNTER MOVWF TEMP_4MOVWF BCD_1 ;BCD OUTPUT LSBMOVWF BCD_2 ;BCD OUT PUTMOVWF BCD_3 ;BCD OUT PUT MSBMOVF TEMP_1,WBTFSC STATUS,ZRETURN

BCD_CONV:INCF BCD_1,FMOVLW 0X0A ;CHECK FOR NUMBER GREATER THAN NINESUBWF BCD_1,WBTFSS STATUS,Z ;IF YES CLEAR THAT BYTE AND

INCREMENT NEXT BYTEGOTO CHECK_CPLTD CLRF BCD_1INCF BCD_2,FMOVLW 0X0ASUBWF BCD_2,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_2INCF BCD_3,FMOVLW 0X0ASUBWF BCD_3,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_3INCF BCD_3,FMOVLW 0X0ASUBWF BCD_3,WBTFSS STATUS,ZGOTO CHECK_CPLTD CLRF BCD_3

CHECK_CPLTD:INCF TEMP_3,F ;CHECK FOR COUNTER REACHED THE BINARY NUNBER TO

BE CONVERTEDMOVF TEMP_1,W ;IF YES STOP CONVERSION AND RETURN WITH BCD

OUTPUTS INSUBWF TEMP_3,W ;BCD1,BCD2,AND BCD3BTFSS STATUS,ZGOTO BCD_CONV RETURN

;EEPROM READEEPROM_RD:

BANKSEL TEMP_2MOVF TEMP_2,WBANKSEL EEADRMOVWF EEADRBANKSEL EECON1BCF EECON1,EEPGDBSF EECON1,RDRETURN

;EEPROM WRITE

Page 56: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

EEPROM_WR:BANKSEL EECON1

CHK_WR_CPLTD:BTFSC EECON1,WRGOTO CHK_WR_CPLTDBANKSEL TEMP_2MOVF TEMP_2,WBANKSEL EEADRMOVWF EEADRBANKSEL TEMP_1MOVF TEMP_1,WBANKSEL EEDATAMOVWF EEDATABANKSEL EECON1BCF EECON1,EEPGDBSF EECON1,WRENBCF INTCON,GIEMOVLW 0X55MOVWF EECON2MOVLW 0XAAMOVWF EECON2BSF EECON1,WRBSF INTCON,GIEBCF EECON1,WRENRETURN

;ROUTINE FOR CLEAR RAM LOCATIONS

CLEAR_RAM:MOVLW 0X00MOVWF INDFINCF FSR,FBANKSEL TEMP_3DECFSZ TEMP_3,FGOTO CLEAR_RAMRETURN

LOAD_RAM:MOVLW 0X0AMOVWF TEMP_3 MOVLW 0X57MOVWF FSR MOVLW 0X00MOVWF TEMP_2

CONT_READ:CALL EEPROM_RDBANKSEL EEDATAMOVF EEDATA,WMOVWF INDFINCF FSR,FBANKSEL TEMP_2INCF TEMP_2,FDECFSZ TEMP_3,FGOTO CONT_READRETURN

Page 57: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

;*********************LOOK UP TABLE & PRINTING DETAILS*************************************

ORG 0X0700MSG1:

da " E MENU CARD "MSG2:

da " RECEIVER "

MSG3:da " NO ORDER "

MSG4:da "RECEIVED ORDER "

ORG 0X0900ASCII_NUM:

ADDWF PCL,Fdt "0123456789:/ abcdefijk"

ORG 0X0500

MENU_TABLE:ADDWF PCL,F

dt " NO ITEM "dt " POROTTA 06"dt " CHAPPATHI 05"dt " TEA 06"dt " COFFEE 07"

dt " CURRY 10" dt " CHICKEN 30"

ORG 0X0600PRICE_TABLE:

ADDWF PCL,Fdt 0X06dt 0X05dt 0X06dt 0X07dt 0X0A

END

Page 58: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

PCB LAYOUT AND FABRICATION METHODE

PCB FABRICATION:

PCB PREPARATION TECHNIQUES

You need to generate a positive (copper black) UV translucent art work film. You will never get a good board without good art work, so it is important to get the best possible quality at this stage. The most important thing is to get a clear sharp image with a very solid opaque black. Art work is done using ORCAD software. It is absolutely essential that your PCB software prints holes in the middle of pads, which will act as centre marks when drilling. It is virtually impossible to accurately hand-drill boards without these holes. If you are looking to buy PCB software at any cost level and want to do hand-prototyping of boards before production, check that this facility is available when defining pad and line shapes, the minimum size recommended (through-linking holes) for reliable result is 50 mil, assuming 0.8mm drill size; 1 mil=(1/1000)th of an inch. You can go smaller drill sizes, but through linking will be harder. 65 mil round or square pads for normal components.

COPPER CLAD LAMINATE:

ICs, with 0.8 mm hole, will allow a 12.5mil, down to 10mil if you really need to. Center-to-centre spacing of 12.5 mil tracks should be 25 mil-slightly less may b possible if your printer can manage it. Take care to preserve the correct diagonal track-track spacing on mitered

Page 59: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

corners; grid is 25 mil and track width 12.5mil. The art work must be printed such that the printed side is in contact with PCB surface when exposing, to avoid blurred edges. In practice, this means that if you design the board as seen from the component side, the bottom (solder side) layer should be printed the ‘correct’ way round, and top side of the double-sided board must be printed mirrored.

Etching

Ferric chloride etchant is a messy stuff, but easily available and cheaper than most alternatives. It attacks any metal including stainless steel. So when setting up a PCB etching area, use a plastic or ceramic sink, with plastic fitting and screws wherever possible, and seal any metal screws with silicon. Copper water pipes may be splashed or dripped-on, so sleeve or cover them in plastic; heat-shrink sleeve is great if you are installing new pipes. Fume extraction is not normally required, although a cover over the tank or tray when not in use is a good idea. You should always use the hex hydrate type of ferric chloride, which should be dissolved in warm water until saturation. Adding a teaspoon of table salt helps to make the etchant clearer for easier inspection. Avoid anhydrous ferric chloride. It creates a lot of heat when dissolved. So always add the powder very slowly to water; do not add water to the powder, and use gloves and safety glasses. The solution made from anhydrous ferric chloride doesn’t etch at all, so you need to add a small amount of hydrochloric acid and leave it for a day or two. Always take extreme care to avoid splashing when dissolving either type of ferric chloride, acid tends to clump together and you often get big chunks coming out of the container and splashing into the solution. It can damage eyes and permanently stain clothing. If you are making PCBs in a professional environment where time is money you should get a heated bubble-etch tank. With fresh hot ferric chloride, the PCB will etch in well under 5 minutes. Fast etching produces better edge-quality and consistent line widths. If you aren’t using a bubble tank, you need to agitate frequently to ensure even etching. Warm the etchant by putting the etching tray inside a larger tray filled with boiling water.

Drilling

DRILLING OF PCB :

If you have fiber glass (FR4) board, you must use tungsten carbide drill bits. Fiber glass eats normal high-speed steel (HSS) bits very rapidly, although HSS drills are alright for older larger sizes (> 2mm). Carbide drill bits are available as straight-shank or thick-shank. In

Page 60: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

straight shank, the hole bit is the diameter of the hole, and in thick shank, a standard size (typically about 3.5 mm) shank tapers down to the hole size. The straight-shank drills are usually preferred because they break less easily and are usually cheaper. The longer thin section provides more flexibility. Small drills for PCB use usually come with either a set of collets of various sizes or a three-jaw chuck. Sometimes the 3-jaw chuck is an optional extra and is worth getting for the time it saves on changing collets. For accuracy, however, 3-jaw chucks are not brilliant, and small drill sizes below 1 mm quickly formed grooves in the jaws, preventing good grip. Below 1 mm, you should use collets, and buy a few extra of the smallest ones; keeping one collect per drill size as using a larger drill in a collet will open it out and it no longer grips smaller drills well. You need a good strong light on the board when drilling, to ensure accuracy. A dichroic halogen lamp, under run at 9V to reduce brightness, can be mounted on a microphone gooseneck for easy positioning. It can be useful to raise the working surface above 15 cm above the normal desk height for more comfortable viewing. Dust extraction is nice, but not essential and occasional blow does the trick! A foot-pedal control to switch the drill ‘off’ and ‘on’ is very convenient, especially when frequently changing bits. Avoid hole sizes less than 0.8 mm unless you really need them. When making two identical boards, drill them both together to save time. To do this, carefully drill a 0.8 mm whole in the pad near each corner of each of the two boards, getting the center as accurately as possible. For larger boards, drill a hole near the centre of each side as well. Lay the boards on the top of each other and insert a 0.8 mm track pin in two opposite corners, using the pins as pegs to line the PCBs up. Squeeze or hammer the pins into boards, and then into the remaining holes. The two PCBs are now ‘nailed’ together accurately and can be drilled together.

Soldering

Page 61: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Soldering is the joining together of two metals to give physical bonding and good electrical conductivity. It is used primarily in electrical and electronic circuitry. Solder is a combination of metals, which are solid at normal room temperatures and become liquid between 180 and 200 degree Celsius. Solder bonds well to various metals, and extremely well to copper. Soldering is a necessary skill you need to learn to successfully build electronics circuits. To solder you need a soldering iron. A modern basic electrical soldering iron consists of a heating element, a soldering bit (often called a tip), a handle and a power cord. The heating element can be either a resistance wire wound around a ceramic tube, or a thick film resistance element printed on to a ceramic base. The element is then insulated and placed into a metal tube for strength and protection. This is then thermally insulated from the handle. The heating element of soldering iron usually reaches temperatures of around 370 to 400 degree Celsius (higher than need to melt the solder). The strength or power of a soldering iron is usually expressed in watts. Irons generally used in electronics are typically in the range of 12 to 25 watts. Higher powered iron will not run hotter. Most irons are available in a variety of voltages; 12V, 24V, 115V and 230V are most popular. Today most laboratories and repair shops use soldering irons, which operate at 24V. You should always use this low voltage where possible, as it is much safer. For advanced soldering work, you will need a soldering iron with temperature control. In this type of soldering irons, the temperature may be usually set between 200 and 450 degree Celsius.

Many temperature control soldering iron designed for electronics have a power rating of around 40 to 50 watt. They will heat fast and give enough power for operation, but are mechanically small.

You will occasionally see gas-powered soldering irons which use butane rather than the main electrical supply to operate. They have a catalytic element which once warmed up, continues to glow hot when gas passes over them. Gas powered soldering irons are designed for occasional ‘on the spot’ used for quick repairs, rather than for main stream construction or for assembly work.

Currently, the best commonly available, workable, and safe solder alloy is 63/37. That is, 63% lead, 37% tin. It is also known as eutectic solder. Its most desirable characteristic is that it solids (‘pasty’) state, and its liquid state occur at the same temperature -361 degree Fahrenheit. The combination of 63% lead and 37% tin melts at the lowest possible temperature. Nowadays there is tendency to move to use lead free solders, but it will take years until they catch on normal soldering work. Lead free solders are nowadays available, but they are generally more expensive or harder to work on than traditional solders that they have lead in them.

The metals involved are not the only things to consider in a solder. Flux is vital to a good solder joint. Flux is an aggressive chemical that removes oxide and impurities from the parts to be soldered. The chemical reactions at the point(s) of connection must take place for the metal

Page 62: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

to fuse. RMA type flux (Rosin Mildly Active) is the least corrosive of the readily available materials, and provides an adequate oxide removal.

In electronics, a 60/40 fixed core solder is used. This consists of 60% lead and 40% tin, with flux cores added to the length of solder.

There are certain safety measures which you should keep in mind when soldering. The tin material used in soldering contains dangerous substances like lead (40-60% of typical soldering tins are lead and lead is poisonous). Also the various fumes from the soldering flux can be dangerous. While it is true that lead does not vaporize at the temperature at which soldering is typically done.

When soldering, keep the room well ventilated and use a small fan or fume trap. A proper fume trap of a fan will keep the most pollution away from your face. Professional electronic workshops use expensive fume extraction systems to protect their workers. Those fume extraction devices have a special filter which filters out the dangerous fumes. If you can connect a duct to the output from the trap to the outside, that would be great.

Always wash hands prior to smoking, eating, drinking or going to the bathroom. When you handle soldering tin, your hands will pick up lead, which needs to be washed out from it before it gets to your body. Do not eat, drink or smoke while working with soldering iron. Do not place cups, glasses or a plate of food near your working area.

Wash also the table sometimes. As you solder, at times there will be a bit of spitting or sputtering. If you look you will see tiny balls of solder that shoot out and can be found on your soldering table.

Page 63: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

PCB LAYOUT: COMPONENT SIDE

Page 64: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Page 65: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Page 66: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

PCB LAYOUT: SOLDER SIDE

Page 67: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Page 68: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

ADVANTAGE AND APPLICATION

This will avoid the time delay usually experienced during bearer coming, collecting order and finally passes to the kitchen manually.

The cost of the product less because we use pic micropcontroller

Simple circuit

Page 69: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

CONCLUSION

.

Electronic menu card is concept to realize the automation in restaurants or hotels. In our project we have designed an electronic system to order through wireless communication using an electronic menu card provided on each table. We can select the items shown in its display along with its price and can order the selected items by pressing a send button provided. The total cost of the items is also displayed. This order details are collected by wireless receiver placed in the kitchen and will display the items in its display. So the kitchen people can supply those items to the customer after preparing it. This will give advantage to avoid the time delay usually experienced during bearer coming, collecting order and finally passes to the kitchen manually.

Also we can modify the sys tem with improved display or graphical display .so we can also display the image of the item listed.

Page 70: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

BIBLIOGRAPHY

POWER ELECTRONICS:- Dr . B.S BIMBRA

LINEAR INTEGRATED CIRCUITS:- Dr. ROY CHOUDHARY, SHAIL.D.JAIN

ELECTRONIC CIRCUITS & DEVICES:- J.B GUPTA

SOLID STATE ELECTRONIC DEVICES:- DENU STREETMAN, SANJAY BANERJEE

WWW.DATASHEETCATALOG.COM

WWW.TEXASINSTRUMENTS.COM

WWW.NATIONAL SEMICONDUCTORS.COM

WWW.PHILIPS.COM

TECHNICAL DETAILS AND DATASHEETS

Page 71: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Microcontroller Core Features:

• High performance RISC CPU• Only 35 single word instructions to learn• All single cycle instructions except for program branches which are two cycle• Operating speed: DC - 20 MHz clock input

DC - 200 ns instruction cycle

• Up to 8K x 14 words of FLASH Program Memory,Up to 368 x 8 bytes of Data Memory (RAM)

Up to 256 x 8 bytes of EEPROM Data Memory

• Pinout compatible to the PIC16C73B/74B/76/77• Interrupt capability (up to 14 sources)• Eight level deep hardware stack• Direct, indirect and relative addressing modes• Power-on Reset (POR)• Power-up Timer (PWRT) and Oscillator Start-up Timer (OST)• Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation• Programmable code protection• Power saving SLEEP mode• Selectable oscillator options• Low power, high speed CMOS FLASH/EEPROM technology• Fully static design• In-Circuit Serial Programming™ (ICSP) via two pins• Single 5V In-Circuit Serial Programming capability• In-Circuit Debugging via two pins• Processor read/write access to program memory• Wide operating voltage range: 2.0V to 5.5V• High Sink/Source Current: 25 mA• Commercial, Industrial and Extended temperature ranges• Low-power consumption:

Peripheral Features:

• Timer0: 8-bit timer/counter with 8-bit prescaler• Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external

crystal/clock• Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler• Two Capture, Compare, PWM modules- Capture is 16-bit, max. resolution is 12.5 ns- Compare is 16-bit, max. resolution is 200 ns- PWM max. resolution is 10-bit• 10-bit multi-channel Analog-to-Digital converter• Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C (Master/Slave)• Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit address

detection

BLOCK DIAGRAM OF PIC 16F877A

Page 72: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD

Page 73: Final Mini Report 1

MINI PROJECT, 2011 ELECRTONIC MENU CARD