Final Mini Report 1
Short Description
Download Final Mini Report 1...
Description
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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BLOCK DIAGRAM
TRANSMITER SECTION
16 X 2 LCD
KEY PAD
MCU
RF ENCODER
RF TRANSMITTER
MINI PROJECT, 2011
ELECRTONIC MENU CARD
RECEIVER SECTION
16 X 2 LCD
LED INDICATORS
RF RECEIVER
RF DECODER
MCU
BUSSER
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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
RECEIVER SECTION RF 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 multipleinput, 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.
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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
CIRCUIT DIAGRAM
MINI PROJECT, 2011
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
CIRCUIT DIAGRAM EXPLANATIONS
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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
- PWM maximum resolution is 10-bit • 10-bit multi-channel Analog-to-Digital converter • Universal Synchronous Asynchronous Receiver Transmitter (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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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
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 37th 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 547 NPN general purpose BC547 TO-92 package Small signal Applications: Switching Small signal amplification Low 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.
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
Pin Description of LCD Module
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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
1
Clear display screen
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 ST3654 Serial Interface IC supports any RF based modules/transreceiver which is based on Texas Instrument’s Chipcon
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 receiver Application · 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. High sensitivity (type -104dBm)
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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.
TRANSFORMER
RECTIFIER
FILTER
IC REGULATOR
LOAD
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 sometimes used on inductors for the coupling of signals, and may not necessarily be at the halfway point, but rather, closer to one end.230V /12-0-12 transformer is used here.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 protection all in a single IC chip. They are connected between output of the filter and input of the load.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 and output 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 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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
SOFTWARE SECTION TRANSMITTER START
INITIALISATION OF PORTS, MEMORY LOCATIONS, SERIAL COMMUNICATION AND LCD Z REVIEW ORDER CHECK FOR NEW ORDER OR REVIEW ORDER
X
NEW ORDER DISPLAY ITEM LIST Y NO CHECK FOR INC BUTTON YES DISPLAY NEXT ITEM
NO CHECK FOR DEC BUTTON YES DISPLAY PREVIOUS ITEM
YES CHECK FOR CANCEL BUTTON NO
MINI PROJECT, 2011
ELECRTONIC MENU CARD
NO CHECK FOR ENTER BUTTON
Y YES
DISPLAY ORDERED QUANTITY AND COST
NO CHECK FOR INC BUTTON YES INCREMENT ORDER QUANTITY
CHECK FOR DEC BUTTON
NO
YES
DECREMENT ORDER QUANTITY
STORE OREDER ITEMAND QUANTITY IN RAM BUFFER
CHECK FOR ENTER BUTTON YES
NO
MINI PROJECT, 2011
ELECRTONIC MENU CARD
X
DISPLAY ORDERED ITEM AND QUANTITY AND TOTAL COST
NO
CHECK FOR INC BUTTON YES DISPLAY NEXT ITEM AND QUANTITY ORDERED
NO CHECK FOR DEC BUTTON
DISPLAY PREVIOUS ITEM OAND QUANTITY ORDEREDED YES
YES CHECK FOR CANCEL BUTTON
Z
NO NO CHECK FOR SEND BUTTON YES
MINI PROJECT, 2011
ELECRTONIC MENU CARD
SEND ORDERED ITEM AND QUANTITY THROUGH SERIAL PORT Z
STOP
MINI PROJECT, 2011
RECEIVER
ELECRTONIC MENU CARD START
INITIALISATION OF PORTS, MEMORY, SERIAL COMMUNICATION, INTERREPTS AND LCD
NO CHECK FOR ANY BYTES RECEIVED
DISPLAY AS NO ORDER
STORE RECEIVED BYTES IN RAM ARRAY AND SOUND BUSSER
DISPLAY THE ITEM NAME AND QUANDITY IN LCD
NO CHECK FOR INC BUTTON YES
DISPLAY NEXT ITEM
NO CHECK FOR DEC BUTTON
DISPLAY PREVIOUS ITEMS
STOP
MINI PROJECT, 2011
ELECRTONIC MENU CARD
PROGRAM ;PROGRAM FOR E MENU CARD TRANSMITTER #include __CONFIG _HS_OSC&_PWRTE_ON&_CP_OFF&_WDT_OFF&_LVP_OFF LCD_DATA EQU PORTD LCD_CNTRL EQU PORTC RS EQU 0 RW EQU 1 EN EQU 2 ;LEDS ARE IN PORTB LED1 EQU 2 LED2 EQU 3 BUSSER EQU 4 ;KEYS ARE CONNECTED IN PORTA CANCEL_KEY EQU 0 ENTER_KEY EQU 1 SEND_KEY EQU 2 INC_KEY EQU 3 DEC_KEY EQU 4
TEMP_LCD_COM EQU 0X23 TEMP_LCD_DAT EQU 0X24 PRG_ADDR_MSB EQU 0X25 PRG_ADDR_LSB EQU 0X26 PRG_DAT_MSB EQU 0X27 PRG_DAT_LSB EQU 0X28 MSG_CHR_CNTR EQU 0X29 TEMP_1 EQU 0X33 TEMP_2 EQU 0X34 TEMP_3 EQU 0X35 TEMP_4 EQU 0X36 EEPROM_DATA EQU 0X37
ITEM_COUNTER EQU 0X38 ITEM_QUANTITY EQU 0X39 PRICE_VALUE EQU 0X3A MODE_COUNTER EQU 0X3B TOTAL_COST EQU 0X3C RAM_PNTR EQU 0X3E FLAG_BITS EQU 0X3F ACK_ERROR EQU 0 ERROR1 EQU 1 BCD_1 EQU 0X40
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BCD_2 EQU 0X41 BCD_3 EQU 0X42 MULT_1 EQU 0X43 MULT_2 EQU 0X44 RESMULT_LSB EQU 0X45 RESMULT_MSB EQU 0X46 ADRESS_CODE EQU 0X47 CHAR_SIZE EQU 0X49 TEMP_5 EQU 0X4B CBLOCK 50H R3,R2,R1,R0 COUNT, LBYTE, MBYTE, HBYTE ENDC
;MUST START ON BINARY XXXXX000.
;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,BIT ADDWF RESMULT_MSB,F RRF RESMULT_MSB,F RRF RESMULT_LSB,F ENDM ;END OF MACRO FOR MULTIPLICATION ; ; ;STARTING OF POGRAM START: CALL DELAY_1 CALL INIT_PORTS CALL INIT_SERIAL CALL INIT_LCD ; ;;WELCOME MESSAGE START_DISPLAY: BANKSEL PORTE BSF PORTB,LED1 BSF PORTB,LED2 BSF PORTB,BUSSER BANKSEL EEADR MOVLW LOW(MSG1) MOVWF EEADR MOVLW HIGH(MSG1) BANKSEL EEADRH MOVWF EEADRH
;FORMAL DELAY ;PORT INITILISATION ;LCD INITIAILISATION
MINI PROJECT, 2011 BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_3 CALL STRNG_MSSG
BANKSEL EEADR MOVLW LOW(MSG2) MOVWF EEADR MOVLW HIGH(MSG2) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 BCF PORTB,LED1 BCF PORTB,LED2 BCF PORTB,BUSSER CLRF ITEM_COUNTER CLRF ITEM_QUANTITY CLRF MODE_COUNTER MOVLW 0X50 MOVWF FSR MOVLW 0X0F MOVWF TEMP_3 CALL CLEAR_RAM ;*****************MAIN ROUTINE ***************************** MAIN_LOOP: BANKSEL EEADR MOVLW LOW(MSG3) MOVWF EEADR MOVLW HIGH(MSG3) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X09
ELECRTONIC MENU CARD
MINI PROJECT, 2011 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG MOVF MODE_COUNTER,W BTFSS STATUS,Z GOTO DIS_REVIEW BANKSEL EEADR MOVLW LOW(MSG4) MOVWF EEADR MOVLW HIGH(MSG4) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG BTFSS PORTA,ENTER_KEY GOTO NEW_ORDER GOTO CHECK_KEYS DIS_REVIEW: BANKSEL EEADR MOVLW LOW(MSG5) MOVWF EEADR MOVLW HIGH(MSG5) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG BTFSS PORTA,ENTER_KEY GOTO REVEIW_ORDER CHECK_KEYS: CALL DELAY_1 CALL DELAY_1 BANKSEL PORTA BTFSC PORTA,INC_KEY GOTO CHECK_MODE_DEC MOVF MODE_COUNTER,W BTFSC STATUS,Z INCF MODE_COUNTER,F CHECK_MODE_DEC:
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BTFSC PORTA,DEC_KEY GOTO MAIN_LOOP MOVF MODE_COUNTER,W BTFSS STATUS,Z DECF MODE_COUNTER,F GOTO MAIN_LOOP NEW_ORDER: MOVLW 0X50 MOVWF FSR MOVLW 0X0F MOVWF TEMP_3 CALL CLEAR_RAM CLRF TOTAL_COST MOVLW 0X01 MOVWF ITEM_COUNTER MOVWF ITEM_QUANTITY MOVLW 0X50 MOVWF FSR DIS_ITEM: BANKSEL PORTA BTFSS PORTA,CANCEL_KEY GOTO MAIN_LOOP BANKSEL TEMP_LCD_COM MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD
;CLEAR DISPLAY
MOVF ITEM_COUNTER,W MOVWF MULT_1 MOVLW 0X10 MOVWF MULT_2 CALL MUL_8X8 MOVF RESMULT_LSB,W MOVWF TEMP_1 CALL DISPLAY_ITEM CALL DELAY_1 BANKSEL TEMP_LCD_COM MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD MOVLW HIGH(PRICE_TABLE) MOVWF PCLATH MOVF ITEM_COUNTER,W CALL PRICE_TABLE MOVWF TEMP_1 MOVWF PRICE_VALUE CALL BIN_BCD MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY
;CLEAR DISPLAY
MINI PROJECT, 2011
ELECRTONIC MENU CARD
MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY CALL DELAY_1 BTFSC PORTA,INC_KEY GOTO CHECK_DEC_ITEM BCF STATUS,C MOVF ITEM_COUNTER,W SUBLW 0X05 BTFSS STATUS,Z INCF ITEM_COUNTER,F CHECK_DEC_ITEM: BTFSC PORTA,DEC_KEY GOTO CHECK_QUANTITY MOVF ITEM_COUNTER,W SUBLW 0X01 BTFSS STATUS,Z DECF ITEM_COUNTER,F CHECK_QUANTITY: BTFSC PORTA,ENTER_KEY GOTO DIS_ITEM MOVLW 0X01 MOVWF ITEM_QUANTITY DIS_QTY: BANKSEL TEMP_LCD_COM MOVLW 0XC5 MOVWF TEMP_LCD_COM CALL COMMAND_LCD MOVLW " " CALL LCD_DIS MOVLW "X" CALL LCD_DIS MOVF ITEM_QUANTITY,W MOVWF TEMP_1 CALL BIN_BCD MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY BTFSC PORTA,INC_KEY GOTO CHECK_DEC_QTY MOVF ITEM_QUANTITY,W SUBLW 0X0A BTFSS STATUS,Z
;CLEAR DISPLAY
MINI PROJECT, 2011 INCF ITEM_QUANTITY,F CHECK_DEC_QTY: BTFSC PORTA,DEC_KEY GOTO DIS_TOTAL MOVF ITEM_QUANTITY,W BTFSS STATUS,Z DECF ITEM_QUANTITY,F DIS_TOTAL: MOVLW "=" CALL LCD_DIS MOVF ITEM_QUANTITY,W MOVWF MULT_1 MOVF PRICE_VALUE,W MOVWF MULT_2 CALL MUL_8X8 MOVF RESMULT_LSB,W MOVWF TEMP_1 CALL BIN_BCD MOVF 0X42,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY CALL DELAY_1 CALL DELAY_1 BTFSC PORTA,ENTER_KEY GOTO DIS_QTY MOVF ITEM_QUANTITY,W MOVWF MULT_1 MOVF PRICE_VALUE,W MOVWF MULT_2 CALL MUL_8X8 MOVF RESMULT_LSB,W BCF STATUS,C ADDWF TOTAL_COST,F MOVF TOTAL_COST,W MOVWF 0X5B MOVF ITEM_COUNTER,W MOVWF INDF INCF FSR,F MOVF ITEM_QUANTITY,W MOVWF INDF INCF FSR,F MOVF FSR,W
ELECRTONIC MENU CARD
MINI PROJECT, 2011 SUBLW 0X59 BTFSS STATUS,Z GOTO DIS_ITEM MOVLW 0X59 MOVWF FSR GOTO DIS_ITEM REVEIW_ORDER: BANKSEL EEADR MOVLW LOW(MSG6) MOVWF EEADR MOVLW HIGH(MSG6) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X07 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG MOVF 0X5B,W MOVWF TEMP_1 CALL BIN_BCD MOVF 0X42,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY CALL DELAY_1
MOVLW 0X50 MOVWF FSR SCROLL_REVEIW: BTFSS PORTA,SEND_KEY GOTO SEND_DATA MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD MOVF INDF,W MOVWF MULT_1 MOVLW 0X10 MOVWF MULT_2 CALL MUL_8X8 MOVF RESMULT_LSB,W MOVWF TEMP_1
ELECRTONIC MENU CARD
MINI PROJECT, 2011 CALL DISPLAY_ITEM BANKSEL TEMP_LCD_COM MOVLW 0XCD MOVWF TEMP_LCD_COM CALL COMMAND_LCD INCF FSR MOVF INDF,W MOVWF TEMP_1 CALL BIN_BCD MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 DECF FSR,F BTFSC PORTA,INC_KEY GOTO CHECK_DEC_REVEIW MOVF FSR,W SUBLW 0X59 BTFSS STATUS,C GOTO REVEIW_FULL INCF FSR,F INCF FSR,F CHECK_DEC_REVEIW: BTFSC PORTA,DEC_KEY GOTO CHECK_CANCEL_REVEIW MOVF FSR,W SUBLW 0X50 BTFSC STATUS,Z GOTO REVEIW_FULL DECF FSR,F DECF FSR,F GOTO CHECK_CANCEL_REVEIW REVEIW_FULL: BSF PORTB,BUSSER CALL DELAY_1 CALL DELAY_1 BCF PORTB,BUSSER CHECK_CANCEL_REVEIW: BTFSC PORTA,CANCEL_KEY GOTO SCROLL_REVEIW GOTO MAIN_LOOP
ELECRTONIC MENU CARD
;CLEAR DISPLAY
MINI PROJECT, 2011 SEND_DATA: BANKSEL EEADR MOVLW LOW(MSG7) READ TO EEADR MOVWF EEADR MOVLW HIGH(MSG7) BANKSEL EEADRH READ TO EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MEMORY MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_2 CALL STRNG_MSSG CALL DELAY_1 ;SENDING CODE BYTES CALL WAIT_TX MOVLW "C" BANKSEL TXREG MOVWF TXREG CALL DELAY_2 MOVLW 0X0E MOVWF TEMP_3 MOVLW 0X50 MOVWF FSR CONT_SEND: CALL WAIT_TX MOVF INDF,W BANKSEL TXREG MOVWF TXREG CALL DELAY_2 INCF FSR,F BANKSEL TEMP_3 DECFSZ TEMP_3,F GOTO CONT_SEND MOVLW 0X05 MOVWF TEMP_3 DIS_COMPLTD: BSF PORTB,LED1 ;MESSAGE IN LCD AS COMPLTED BANKSEL EEADR MOVLW LOW(MSG8) MOVWF EEADR MOVLW HIGH(MSG8) BANKSEL EEADRH
ELECRTONIC MENU CARD
;LOAD PROGRAM MEMORY ADDRESS LSB TO BE
;LOAD PROGRAM MEMORY ADDRESS MSB TO BE
;LOAD NO OF BYTES TO BE READ FROM PROGRAM
;COMMAND FOR FIRST LINE
;READ PROGRAM MEMORY AND DISPLAY IN LCD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_2
;COMMAND FOR FIRST LINE
CALL STRNG_MSSG CALL DELAY_1 BCF PORTB,LED1 CALL DELAY_1 DECFSZ TEMP_3,F GOTO DIS_COMPLTD GOTO MAIN_LOOP ;INITIALISATION OF PORTS INIT_PORTS: BANKSEL ADCON1 MOVLW 0X07 MOVWF ADCON1 BANKSEL TRISA MOVLW 0XFF MOVWF TRISA BANKSEL TRISB MOVLW 0X00 MOVWF TRISB BANKSEL TRISC MOVLW 0XF0 MOVWF TRISC BANKSEL TRISD MOVLW 0X00 MOVWF TRISD BANKSEL TRISE MOVLW 0XE0 ANDWF TRISE,F MOVLW 0X00 IORWF TRISE,F MOVLW 0X00 BANKSEL PORTA MOVWF PORTA MOVLW 0XFF BANKSEL PORTB MOVWF PORTB BANKSEL PORTC MOVLW 0XF0 MOVWF PORTC BANKSEL PORTD MOVLW 0X00 MOVWF PORTD
;PORTA AS DIGITAL OUTPUT
;
;RB0 TO RB4 IS INPUT FOR KEY ;RB5 TO RB6 OUTPUT RELAY ;RC0 TO RC2 IS OUTPUT FOR LCD
;PORTD AS OUTPUT ;LCD DATA ;PORTE AS OUTPUT ;RE0 , ;RE1, RE2 AS LED OUTPUT
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BANKSEL PORTD MOVLW 0X00 MOVWF PORTE RETURN ;SERILA COMMUNICATION ENABLE INIT_SERIAL: BANKSEL TRISC MOVLW 0XC0 MOVWF TRISC BANKSEL SPBRG MOVLW 0X19 MOVWF SPBRG BANKSEL TXSTA MOVLW 0X24 ASYNCHROUNOUS MOVWF TXSTA BANKSEL RCSTA MOVLW 0X80 MOVWF RCSTA RETURN
;BAUDRATE REG. IS LOADED BY 19h=25 FOR 9,600 BAUD AT 4MHZ
;00100100 TRANSMIT ENABLED BY BRGH=1 8 BIT TRANSMISSION
;ENABLE PORTC AS TX/RX RECEIVE ENABLED
;*************ROUTINE FOR WAIT TX COMPLETE*********************** WAIT_TX: BANKSEL TXSTA BTFSS TXSTA,TRMT GOTO WAIT_TX RETURN ;INITIALISATION OF LCD MODULE INIT_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,line1 MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display RETURN ;COMMAND TO LCD COMMAND_LCD: CALL DELAY_3 BANKSEL PORTC MOVF TEMP_LCD_COM,W
;DATA FROM RAM TO LCD DATA PORT
MINI PROJECT, 2011 MOVWF LCD_DATA BCF LCD_CNTRL,RS BCF LCD_CNTRL,RW BSF LCD_CNTRL,EN NOP NOP NOP BCF LCD_CNTRL,EN RETURN ; DATA TO LCD MODULE LCD_DIS: BANKSEL LCD_DATA MOVWF LCD_DATA CALL DELAY_3 BSF LCD_CNTRL,RS BCF LCD_CNTRL,RW BSF LCD_CNTRL,EN NOP NOP NOP NOP BCF LCD_CNTRL,EN RETURN
ELECRTONIC MENU CARD
;RS LOW COMMAND REGISTER SELECTED ;RW LOW WRITE OPEARTION SELECTED ;ENABLE LCD
;WAIT FOR DATA READING BY LCD ;DISABLE LCD
;RS HIGH DATA REGISTER SELECTED ;RW LOW WRITE OPEARTION SELECTED ;ENABLE LCD ;WAIT FOR DATA READING BY LCD
;DISABLE LCD
;READ PROGRAM MEMORY AND GIVE STRING DATA TO LCD STRNG_MSSG: BANKSEL EECON1 BSF EECON1,EEPGD ;SELECT PROGRAM MEMORY BSF EECON1,RD ;START READ OPERATION NOP NOP ;WAIT FOR READ CYCLE BANKSEL EEDATA MOVF EEDATA,W ;STORE READ DATA (LSB) BANKSEL PRG_DAT_LSB MOVWF PRG_DAT_LSB BANKSEL EEDATH MOVF EEDATH,W BANKSEL PRG_DAT_MSB MOVWF PRG_DAT_MSB ;STORE RAED DATA(MSB) DECFSZ MSG_CHR_CNTR,F GOTO LCD_DISL RETURN ;********************* 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,C RRF PRG_DAT_LSB,F MOVF PRG_DAT_MSB,W CALL LCD_DIS MOVF PRG_DAT_LSB,W CALL LCD_DIS BANKSEL EEADR
MINI PROJECT, 2011
ELECRTONIC MENU CARD
INCF EEADR,F GOTO STRNG_MSSG ;****************************************************************************** ;ROUTINE FOR DISPLAYING NUMBERS IN LCD LCD_NUM_DISPLY: MOVLW HIGH(ASCII_NUM) MOVWF PCLATH MOVF TEMP_1,W PAGESEL ASCII_NUM CALL ASCII_NUM PAGESEL LCD_DIS CALL LCD_DIS RETURN ;ROUTINR FOR DISPLAY RAM CONTENT DISPLAY_RAM: NOP CONT_DISRAM1: MOVF INDF,W ANDLW 0X7F CALL LCD_DIS INCF FSR,F MOVF TEMP_2,W BCF STATUS,C SUBWF FSR,W BTFSS STATUS,Z GOTO CONT_DISRAM1 MOVLW 0X60 MOVWF FSR RETURN ;ROUTINE FOR DISPLAYING ITEM NAME FROM THE TABLE DISPLAY_ITEM: MOVLW 0X0F MOVWF TEMP_2 CONT_DISPLAY_ITEM: MOVLW HIGH(MENU_TABLE) MOVWF PCLATH MOVF TEMP_1,W CALL MENU_TABLE CALL LCD_DIS INCF TEMP_1,F DECFSZ TEMP_2,F GOTO CONT_DISPLAY_ITEM RETURN
;********************DELAY ROUTINES**************************** DELAY_1: BANKSEL 0X30 MOVLW 0X05 MOVWF 0X30
MINI PROJECT, 2011
ELECRTONIC MENU CARD
DELAY_1A: CALL DELAY_2 DECFSZ 0X30,F GOTO DELAY_1A RETURN DELAY_2: BANKSEL 0X31 MOVLW 0X7F MOVWF 0X31 DELAY_2A: CALL DELAY_3 DECFSZ 0X31,F GOTO DELAY_2A RETURN DELAY_3: BANKSEL 0X32 MOVLW 0XFF MOVWF 0X32 DELY_3A: DECFSZ 0X32,F GOTO DELY_3A RETURN ;ROUTINE FOR CONVERTING PACKED BCD TO HEX ;DATA TO BE CONVERTED IS IN W BCD_PACK_BIN: BANKSEL TEMP_2 MOVWF TEMP_2 ANDLW 0XF0 ;EXTARCT FIRST BCD (MSB) MOVWF MULT_1 SWAPF MULT_1,F ;MULTIPLY WITH 10 MOVLW 0X0A MOVWF MULT_2 CALL MUL_8X8 MOVF TEMP_2,W ANDLW 0X0F ;EXTARCT SECOND BCD(LSB) BCF STATUS,C ADDWF RESMULT_LSB,W ;ADD WITH THE RESULT OF (FIRST BCD X 10) RETURN ;SUBROUTINE FOR 8 X 8 MULTIPLICATION MUL_8X8 CLRF RESMULT_MSB CLRF RESMULT_LSB MOVF MULT_2,W ;MOVE THE MULTIPLICAND TO W REG. BCF STATUS,C ;CLEAR THE CARRY BIT IN THE STATUS REG. MULT 0 MULT 1 MULT 2 MULT 3 MULT 4 MULT 5 MULT 6 MULT 7 RETLW 0
MINI PROJECT, 2011
ELECRTONIC MENU CARD
;******************************BINARY TO BCD CONVERSION*********************** BIN_BCD: MOVLW 0X00 MOVWF TEMP_3 ;TEMPORARY COUNTER MOVWF TEMP_4 MOVWF BCD_1 ;BCD OUTPUT LSB MOVWF BCD_2 ;BCD OUT PUT MOVWF BCD_3 ;BCD OUT PUT MSB MOVF TEMP_1,W BTFSC STATUS,Z RETURN BCD_CONV: INCF BCD_1,F MOVLW 0X0A ;CHECK FOR NUMBER GREATER THAN NINE SUBWF BCD_1,W BTFSS STATUS,Z ;IF YES CLEAR THAT BYTE AND INCREMENT NEXT BYTE GOTO CHECK_CPLTD CLRF BCD_1 INCF BCD_2,F MOVLW 0X0A SUBWF BCD_2,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_2 INCF BCD_3,F MOVLW 0X0A SUBWF BCD_3,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_3 INCF BCD_3,F MOVLW 0X0A SUBWF BCD_3,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_3 CHECK_CPLTD: INCF TEMP_3,F ;CHECK FOR COUNTER REACHED THE BINARY NUNBER TO BE CONVERTED MOVF TEMP_1,W ;IF YES STOP CONVERSION AND RETURN WITH BCD OUTPUTS IN SUBWF TEMP_3,W ;BCD1,BCD2,AND BCD3 BTFSS STATUS,Z GOTO BCD_CONV RETURN ;EEPROM READ EEPROM_RD: BANKSEL TEMP_2 MOVF TEMP_2,W BANKSEL EEADR MOVWF EEADR BANKSEL EECON1 BCF EECON1,EEPGD BSF EECON1,RD RETURN
MINI PROJECT, 2011 ;EEPROM WRITE EEPROM_WR: BANKSEL EECON1 CHK_WR_CPLTD: BTFSC EECON1,WR GOTO CHK_WR_CPLTD BANKSEL TEMP_2 MOVF TEMP_2,W BANKSEL EEADR MOVWF EEADR BANKSEL TEMP_1 MOVF TEMP_1,W BANKSEL EEDATA MOVWF EEDATA BANKSEL EECON1 BCF EECON1,EEPGD BSF EECON1,WREN BCF INTCON,GIE MOVLW 0X55 MOVWF EECON2 MOVLW 0XAA MOVWF EECON2 BSF EECON1,WR BSF INTCON,GIE BCF EECON1,WREN RETURN ;ROUTINE FOR CLEAR RAM LOCATIONS CLEAR_RAM: MOVLW 0X00 MOVWF INDF INCF FSR,F BANKSEL TEMP_3 DECFSZ TEMP_3,F GOTO CLEAR_RAM RETURN LOAD_RAM: MOVLW 0X0A MOVWF TEMP_3 MOVLW 0X57 MOVWF FSR MOVLW 0X00 MOVWF TEMP_2 CONT_READ: CALL EEPROM_RD BANKSEL EEDATA MOVF EEDATA,W MOVWF INDF INCF FSR,F BANKSEL TEMP_2 INCF TEMP_2,F DECFSZ TEMP_3,F GOTO CONT_READ RETURN
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
; ;********************ROUTINE FOR CHECKING RAM BYTES WITH PROGRAM MEMORY BYTES******************* CHK_BYTE: CALL EEPROM_RD BANKSEL EEDATA MOVF EEDATA,W BCF STATUS,C SUBWF INDF,W BTFSS STATUS,Z GOTO NO_MATCH BANKSEL CHAR_SIZE ; INCF TEMP_1,F DECFSZ CHAR_SIZE,F GOTO NOCHK_CPLTD RETURN NOCHK_CPLTD: INCF FSR,F INCF TEMP_2,F GOTO CHK_BYTE NO_MATCH: BANKSEL FLAG_BITS BSF FLAG_BITS,ERROR1 RETURN
;*********************LOOK UP TABLE & PRINTING DETAILS************************************* ORG 0X0700 MSG1: da " ELECTRONIC " MSG2: da " MENU CARD
"
MSG3: da " ENTER A CHOICE
"
MSG4: da " NEW ORDER
"
MSG5: da " REVIEW ORDER
MSG6: da " TOTAL COST=
"
MSG7: da "SENDING ORDER " MSG8: da " COMPLETED..... "
"
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 0X0600 PRICE_TABLE: ADDWF PCL,F dt 0X06 dt 0X05 dt 0X06 dt 0X07 dt 0X0A dt 0X0F dt 0X0A END
;PROGRAM FOR E MENU CARD RECEIVER #include __CONFIG _HS_OSC&_PWRTE_ON&_CP_OFF&_WDT_OFF&_LVP_OFF
W_TEMP EQU 0X4F DURING INTERRUPT STATUS_TEMP EQU 0X4E DURING INTERRUPT PCLATH_TEMP EQU 0X4D DURING INTERRUPT LCD_DATA EQU PORTD LCD_CNTRL EQU PORTC RS EQU 0 RW EQU 1 EN EQU 2 ;LEDS ARE IN PORTB LED1 EQU 2 LED2 EQU 3 BUSSER EQU 4
;TEMPERORY REGISTER FOR W ;TEMPERORY REGISTER FOR STATUS ;TEMPERORY REGISTER FOR PCLATH
MINI PROJECT, 2011
;KEYS ARE CONNECTED IN PORTA CANCEL_KEY EQU 0 ENTER_KEY EQU 1 SEND_KEY EQU 2 INC_KEY EQU 3 DEC_KEY EQU 4
TEMP_LCD_COM EQU 0X23 TEMP_LCD_DAT EQU 0X24 PRG_ADDR_MSB EQU 0X25 PRG_ADDR_LSB EQU 0X26 PRG_DAT_MSB EQU 0X27 PRG_DAT_LSB EQU 0X28 MSG_CHR_CNTR EQU 0X29 TEMP_1 EQU 0X33 TEMP_2 EQU 0X34 TEMP_3 EQU 0X35 TEMP_4 EQU 0X36 EEPROM_DATA EQU 0X37
ITEM_COUNTER EQU 0X38 ITEM_QUANTITY EQU 0X39 PRICE_VALUE EQU 0X3A MODE_COUNTER EQU 0X3B TOTAL_COST EQU 0X3C RAM_PNTR EQU 0X3E FLAG_BITS EQU 0X3F NEW_DATA EQU 0 RECVD EQU 1
BCD_1 EQU 0X40 BCD_2 EQU 0X41 BCD_3 EQU 0X42
MULT_1 EQU 0X43 MULT_2 EQU 0X44 RESMULT_LSB EQU 0X45 RESMULT_MSB EQU 0X46 ADRESS_CODE EQU 0X47 CHAR_SIZE EQU 0X49 TEMP_5 EQU 0X4B CBLOCK 50H
ELECRTONIC MENU CARD
MINI PROJECT, 2011 R3,R2,R1,R0 COUNT, LBYTE, MBYTE, HBYTE ENDC
ELECRTONIC MENU CARD ;MUST START ON BINARY XXXXX000.
;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 routine ORG 0x0004 MOVWF W_TEMP ;saving acccumelator SWAPF STATUS,W ;saving status register CLRF STATUS ;clear status reg. MOVWF STATUS_TEMP ; MOVF PCLATH,W MOVWF PCLATH_TEMP CLRF PCLATH BANKSEL FLAG_BITS BTFSS FLAG_BITS,NEW_DATA ;CHECK FOR NEW DATA FLAG FOR RECEIVE GOTO NO_RECEIVE SAVE_DATA: BSF FLAG_BITS,RECVD BANKSEL RCREG MOVF RCREG,W ;READ RECEIVED BYTE AND SAVE IN RAM ; MOVWF INDF ; MOVWF TXREG INCF FSR,F MOVF FSR,W SUBLW 0X5F BTFSS STATUS,Z GOTO NO_RECEIVE STOP_MSG: BANKSEL FLAG_BITS BCF FLAG_BITS,NEW_DATA BCF RCSTA,CREN NO_RECEIVE: MOVF PCLATH_TEMP,W MOVWF PCLATH SWAPF STATUS_TEMP,W ;retrieving status reg. MOVWF STATUS SWAPF W_TEMP,F ;retreiving accumelator SWAPF W_TEMP,W RETFIE ;exit interrupt routine ;MACRO FOR MULTIPLICATION - 8X8 UNSIGNED ;************************************************************************************** MULT MACRO BIT ;MACRO FOR UNSIGNEDMULTIPLICATION BTFSC MULT_1,BIT
MINI PROJECT, 2011 ADDWF RESMULT_MSB,F RRF RESMULT_MSB,F RRF RESMULT_LSB,F ENDM
ELECRTONIC MENU CARD
;END OF MACRO FOR MULTIPLICATION
; ; ;STARTING OF POGRAM START: CALL DELAY_1 CALL INIT_PORTS CALL INIT_LCD MOVLW 0X50 MOVWF FSR CALL EN_INTR CALL INIT_SERIAL CLRF FLAG_BITS
; ;;WELCOME MESSAGE START_DISPLAY: BANKSEL PORTE BSF PORTB,LED1 BSF PORTB,LED2 BSF PORTB,BUSSER BANKSEL EEADR MOVLW LOW(MSG1) MOVWF EEADR MOVLW HIGH(MSG1) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_3 CALL STRNG_MSSG
BANKSEL EEADR MOVLW LOW(MSG2) MOVWF EEADR MOVLW HIGH(MSG2) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR
;FORMAL DELAY ;PORT INITILISATION ;LCD INITIAILISATION
MINI PROJECT, 2011 MOVLW 0XC0 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG
CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 BCF PORTB,LED1 BCF PORTB,LED2 BCF PORTB,BUSSER CLRF FLAG_BITS CLEAR_MEMORY: MOVLW 0X50 MOVWF FSR MOVLW 0X0F MOVWF TEMP_3 CALL CLEAR_RAM MOVLW 0X4F MOVWF FSR BSF FLAG_BITS,NEW_DATA ;*****************MAIN ROUTINE ***************************** MAIN_LOOP: BANKSEL RCSTA BSF RCSTA,CREN BANKSEL FLAG_BITS BTFSC FLAG_BITS,RECVD GOTO NEW_ORDER BANKSEL EEADR MOVLW LOW(MSG3) MOVWF EEADR MOVLW HIGH(MSG3) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X08 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL STRNG_MSSG CALL DELAY_1 GOTO MAIN_LOOP NEW_ORDER: BSF PORTB,LED1 BSF PORTB,BUSSER CALL DELAY_1
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 CALL DELAY_1 BCF PORTB,LED1 BCF PORTB,BUSSER BCF FLAG_BITS,RECVD BCF FLAG_BITS,NEW_DATA REVEIW_ORDER: BANKSEL EEADR MOVLW LOW(MSG4) MOVWF EEADR MOVLW HIGH(MSG4) BANKSEL EEADRH MOVWF EEADRH BANKSEL MSG_CHR_CNTR MOVLW 0X07 MOVWF MSG_CHR_CNTR MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_3 CALL STRNG_MSSG MOVLW 0X50 MOVWF FSR SCROLL_REVEIW: MOVLW 0X01 MOVWF TEMP_LCD_COM CALL COMMAND_LCD CALL DELAY_1 MOVF INDF,W MOVWF MULT_1 MOVLW 0X10 MOVWF MULT_2 CALL MUL_8X8 MOVF RESMULT_LSB,W MOVWF TEMP_1 CALL DISPLAY_ITEM BANKSEL TEMP_LCD_COM MOVLW 0XC5 MOVWF TEMP_LCD_COM CALL COMMAND_LCD ; ; INCF FSR,F MOVF INDF,W MOVWF TEMP_1
;CLEAR DISPLAY
MINI PROJECT, 2011
ELECRTONIC MENU CARD
CALL BIN_BCD MOVF 0X41,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY ; MOVF 0X40,W MOVWF TEMP_1 CALL LCD_NUM_DISPLY ; CALL DELAY_1 ; ; ;
CALL DELAY_1 DECF FSR,F BTFSC PORTA,INC_KEY GOTO CHECK_DEC_REVEIW MOVF FSR,W SUBLW 0X59 BTFSS STATUS,C GOTO REVEIW_FULL INCF FSR,F INCF FSR,F
; CHECK_DEC_REVEIW: BTFSC PORTA,DEC_KEY GOTO CHECK_CANCEL_REVEIW MOVF FSR,W SUBLW 0X50 BTFSC STATUS,Z GOTO REVEIW_FULL DECF FSR,F DECF FSR,F GOTO CHECK_CANCEL_REVEIW REVEIW_FULL: BSF PORTB,BUSSER CALL DELAY_1 CALL DELAY_1 BCF PORTB,BUSSER ; CHECK_CANCEL_REVEIW: BTFSC PORTA,CANCEL_KEY GOTO SCROLL_REVEIW BSF FLAG_BITS,NEW_DATA GOTO CLEAR_MEMORY ;INITIALISATION OF PORTS INIT_PORTS: BANKSEL ADCON1 MOVLW 0X07 MOVWF ADCON1 BANKSEL TRISA MOVLW 0XFF
;PORTA AS DIGITAL OUTPUT
;
MINI PROJECT, 2011 MOVWF TRISA BANKSEL TRISB MOVLW 0X00 MOVWF TRISB BANKSEL TRISC MOVLW 0XF0 MOVWF TRISC BANKSEL TRISD MOVLW 0X00 MOVWF TRISD
ELECRTONIC MENU CARD
;RB0 TO RB4 IS INPUT FOR KEY ;RB5 TO RB6 OUTPUT RELAY ;RC0 TO RC2 IS OUTPUT FOR LCD
;PORTD AS OUTPUT ;LCD DATA
BANKSEL TRISE MOVLW 0XE0 ANDWF TRISE,F MOVLW 0X00 IORWF TRISE,F
;PORTE AS OUTPUT ;RE0 , ;RE1, RE2 AS LED OUTPUT
MOVLW 0X00 BANKSEL PORTA MOVWF PORTA MOVLW 0XFF BANKSEL PORTB MOVWF PORTB BANKSEL PORTC MOVLW 0XF0 MOVWF PORTC BANKSEL PORTD MOVLW 0X00 MOVWF PORTD BANKSEL PORTD MOVLW 0X00 MOVWF PORTE RETURN ;SERILA COMMUNICATION ENABLE INIT_SERIAL: BANKSEL TRISC MOVLW 0XC0 MOVWF TRISC BANKSEL SPBRG MOVLW 0X19 MOVWF SPBRG BANKSEL TXSTA MOVLW 0X24 ASYNCHROUNOUS MOVWF TXSTA BANKSEL RCSTA MOVLW 0X90 MOVWF RCSTA RETURN
;BAUDRATE REG. IS LOADED BY 19h=25 FOR 9,600 BAUD AT 4MHZ
;00100100 TRANSMIT ENABLED BY BRGH=1 8 BIT TRANSMISSION
;ENABLE PORTC AS TX/RX RECEIVE ENABLED
;INTERRUPT ENABLE FOR SERIAL RECEIVE EN_INTR: BANKSEL INTCON MOVLW 0XC0
MINI PROJECT, 2011 MOVWF INTCON BANKSEL PIE1 BSF PIE1,RCIE RETURN
ELECRTONIC MENU CARD ;
;*************ROUTINE FOR WAIT TX COMPLETE*********************** WAIT_TX: BANKSEL TXSTA BTFSS TXSTA,TRMT GOTO WAIT_TX RETURN ;INITIALISATION OF LCD MODULE INIT_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,line1 MOVWF TEMP_LCD_COM CALL COMMAND_LCD ;strobe command to display RETURN ;COMMAND TO LCD COMMAND_LCD: CALL DELAY_3 BANKSEL PORTC MOVF TEMP_LCD_COM,W ;DATA FROM RAM TO LCD DATA PORT MOVWF LCD_DATA BCF LCD_CNTRL,RS ;RS LOW COMMAND REGISTER SELECTED BCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTED BSF LCD_CNTRL,EN ;ENABLE LCD NOP NOP NOP ;WAIT FOR DATA READING BY LCD BCF LCD_CNTRL,EN ;DISABLE LCD RETURN ; DATA TO LCD MODULE LCD_DIS: BANKSEL LCD_DATA MOVWF LCD_DATA CALL DELAY_3 BSF LCD_CNTRL,RS ;RS HIGH DATA REGISTER SELECTED BCF LCD_CNTRL,RW ;RW LOW WRITE OPEARTION SELECTED BSF LCD_CNTRL,EN ;ENABLE LCD NOP ;WAIT FOR DATA READING BY LCD
MINI PROJECT, 2011 NOP NOP NOP BCF LCD_CNTRL,EN RETURN
ELECRTONIC MENU CARD
;DISABLE LCD
;READ PROGRAM MEMORY AND GIVE STRING DATA TO LCD STRNG_MSSG: BANKSEL EECON1 BSF EECON1,EEPGD ;SELECT PROGRAM MEMORY BSF EECON1,RD ;START READ OPERATION NOP NOP ;WAIT FOR READ CYCLE BANKSEL EEDATA MOVF EEDATA,W ;STORE READ DATA (LSB) BANKSEL PRG_DAT_LSB MOVWF PRG_DAT_LSB BANKSEL EEDATH MOVF EEDATH,W BANKSEL PRG_DAT_MSB MOVWF PRG_DAT_MSB ;STORE RAED DATA(MSB) DECFSZ MSG_CHR_CNTR,F GOTO LCD_DISL RETURN ;********************* 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,C RRF PRG_DAT_LSB,F MOVF PRG_DAT_MSB,W CALL LCD_DIS MOVF PRG_DAT_LSB,W CALL LCD_DIS BANKSEL EEADR INCF EEADR,F GOTO STRNG_MSSG ;****************************************************************************** ;ROUTINE FOR DISPLAYING NUMBERS IN LCD LCD_NUM_DISPLY: MOVLW HIGH(ASCII_NUM) MOVWF PCLATH MOVF TEMP_1,W PAGESEL ASCII_NUM CALL ASCII_NUM PAGESEL LCD_DIS CALL LCD_DIS RETURN ;ROUTINR FOR DISPLAY RAM CONTENT DISPLAY_RAM: NOP
MINI PROJECT, 2011
CONT_DISRAM1: MOVF INDF,W ANDLW 0X7F CALL LCD_DIS INCF FSR,F MOVF TEMP_2,W BCF STATUS,C SUBWF FSR,W BTFSS STATUS,Z GOTO CONT_DISRAM1 MOVLW 0X60 MOVWF FSR RETURN ;ROUTINE FOR DISPLAYING ITEM NAME FROM THE TABLE DISPLAY_ITEM: MOVLW 0X0F MOVWF TEMP_2 CONT_DISPLAY_ITEM: MOVLW HIGH(MENU_TABLE) MOVWF PCLATH MOVF TEMP_1,W CALL MENU_TABLE CALL LCD_DIS INCF TEMP_1,F DECFSZ TEMP_2,F GOTO CONT_DISPLAY_ITEM RETURN
;********************DELAY ROUTINES**************************** DELAY_1: BANKSEL 0X30 MOVLW 0X05 MOVWF 0X30 DELAY_1A: CALL DELAY_2 DECFSZ 0X30,F GOTO DELAY_1A RETURN DELAY_2: BANKSEL 0X31 MOVLW 0X7F MOVWF 0X31 DELAY_2A: CALL DELAY_3 DECFSZ 0X31,F GOTO DELAY_2A RETURN DELAY_3: BANKSEL 0X32 MOVLW 0XFF MOVWF 0X32
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
DELY_3A: DECFSZ 0X32,F GOTO DELY_3A RETURN ;ROUTINE FOR CONVERTING PACKED BCD TO HEX ;DATA TO BE CONVERTED IS IN W BCD_PACK_BIN: BANKSEL TEMP_2 MOVWF TEMP_2 ANDLW 0XF0 ;EXTARCT FIRST BCD (MSB) MOVWF MULT_1 SWAPF MULT_1,F ;MULTIPLY WITH 10 MOVLW 0X0A MOVWF MULT_2 CALL MUL_8X8 MOVF TEMP_2,W ANDLW 0X0F ;EXTARCT SECOND BCD(LSB) BCF STATUS,C ADDWF RESMULT_LSB,W ;ADD WITH THE RESULT OF (FIRST BCD X 10) RETURN ;SUBROUTINE FOR 8 X 8 MULTIPLICATION MUL_8X8 CLRF RESMULT_MSB CLRF RESMULT_LSB MOVF MULT_2,W ;MOVE THE MULTIPLICAND TO W REG. BCF STATUS,C ;CLEAR THE CARRY BIT IN THE STATUS REG. MULT 0 MULT 1 MULT 2 MULT 3 MULT 4 MULT 5 MULT 6 MULT 7 RETLW 0 ;******************************BINARY TO BCD CONVERSION*********************** BIN_BCD: MOVLW 0X00 MOVWF TEMP_3 ;TEMPORARY COUNTER MOVWF TEMP_4 MOVWF BCD_1 ;BCD OUTPUT LSB MOVWF BCD_2 ;BCD OUT PUT MOVWF BCD_3 ;BCD OUT PUT MSB MOVF TEMP_1,W BTFSC STATUS,Z RETURN BCD_CONV: INCF BCD_1,F MOVLW 0X0A ;CHECK FOR NUMBER GREATER THAN NINE SUBWF BCD_1,W BTFSS STATUS,Z ;IF YES CLEAR THAT BYTE AND INCREMENT NEXT BYTE GOTO CHECK_CPLTD CLRF BCD_1 INCF BCD_2,F
MINI PROJECT, 2011 MOVLW 0X0A SUBWF BCD_2,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_2 INCF BCD_3,F MOVLW 0X0A SUBWF BCD_3,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_3 INCF BCD_3,F MOVLW 0X0A SUBWF BCD_3,W BTFSS STATUS,Z GOTO CHECK_CPLTD CLRF BCD_3 CHECK_CPLTD: INCF TEMP_3,F BE CONVERTED MOVF TEMP_1,W OUTPUTS IN SUBWF TEMP_3,W BTFSS STATUS,Z GOTO BCD_CONV RETURN ;EEPROM READ EEPROM_RD: BANKSEL TEMP_2 MOVF TEMP_2,W BANKSEL EEADR MOVWF EEADR BANKSEL EECON1 BCF EECON1,EEPGD BSF EECON1,RD RETURN ;EEPROM WRITE EEPROM_WR: BANKSEL EECON1 CHK_WR_CPLTD: BTFSC EECON1,WR GOTO CHK_WR_CPLTD BANKSEL TEMP_2 MOVF TEMP_2,W BANKSEL EEADR MOVWF EEADR BANKSEL TEMP_1 MOVF TEMP_1,W BANKSEL EEDATA MOVWF EEDATA BANKSEL EECON1 BCF EECON1,EEPGD BSF EECON1,WREN
ELECRTONIC MENU CARD
;CHECK FOR COUNTER REACHED THE BINARY NUNBER TO ;IF YES STOP CONVERSION AND RETURN WITH BCD ;BCD1,BCD2,AND BCD3
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BCF INTCON,GIE MOVLW 0X55 MOVWF EECON2 MOVLW 0XAA MOVWF EECON2 BSF EECON1,WR BSF INTCON,GIE BCF EECON1,WREN RETURN ;ROUTINE FOR CLEAR RAM LOCATIONS CLEAR_RAM: MOVLW 0X00 MOVWF INDF INCF FSR,F BANKSEL TEMP_3 DECFSZ TEMP_3,F GOTO CLEAR_RAM RETURN LOAD_RAM: MOVLW 0X0A MOVWF TEMP_3 MOVLW 0X57 MOVWF FSR MOVLW 0X00 MOVWF TEMP_2 CONT_READ: CALL EEPROM_RD BANKSEL EEDATA MOVF EEDATA,W MOVWF INDF INCF FSR,F BANKSEL TEMP_2 INCF TEMP_2,F DECFSZ TEMP_3,F GOTO CONT_READ RETURN ;*********************LOOK UP TABLE & PRINTING DETAILS*************************************
ORG 0X0700 MSG1: da " E MENU CARD
"
MSG2: da " RECEIVER
"
MSG3: da " NO ORDER
"
MSG4: da "RECEIVED ORDER "
MINI PROJECT, 2011 ORG 0X0900 ASCII_NUM: ADDWF PCL,F dt "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 0X0600 PRICE_TABLE: ADDWF PCL,F dt 0X06 dt 0X05 dt 0X06 dt 0X07 dt 0X0A END
ELECRTONIC MENU CARD
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. Centerto-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 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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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
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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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 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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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.
MINI PROJECT, 2011
ELECRTONIC MENU CARD
PCB LAYOUT: COMPONENT SIDE
MINI PROJECT, 2011
ELECRTONIC MENU CARD
MINI PROJECT, 2011
ELECRTONIC MENU CARD
PCB LAYOUT: SOLDER SIDE
MINI PROJECT, 2011
ELECRTONIC MENU CARD
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
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.
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:BANERJEE
WWW.DATASHEETCATALOG.COM
WWW.TEXASINSTRUMENTS.COM
WWW.NATIONAL SEMICONDUCTORS.COM
WWW.PHILIPS.COM
DENU STREETMAN, SANJAY
MINI PROJECT, 2011
ELECRTONIC MENU CARD
TECHNICAL DETAILS AND DATASHEETS 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
MINI PROJECT, 2011
ELECRTONIC MENU CARD
BLOCK DIAGRAM OF PIC 16F877A
MINI PROJECT, 2011
ELECRTONIC MENU CARD
View more...
Comments