EE 477 Final Report - Purdue University



ECE 477 Final Report ( Spring 2008

Team 13 ( Touch 2 Order

[pic]

Team Members:

#1: Srichand Yella Signature: ____________________ Date: 04/28/2008

#2: Anvesh Dasari Signature: ____________________ Date: 04/28/2008

#3: Varun Vallabhaneni Signature: ____________________ Date: 04/28/2008

#4: Madhu Tummala Signature: ____________________ Date: 04/28/2008

|CRITERION |SCORE |MPY |PTS |

|Technical content |0 1 2 3 4 5 6 7 8 9 10 |3 | |

|Design documentation |0 1 2 3 4 5 6 7 8 9 10 |3 | |

|Technical writing style |0 1 2 3 4 5 6 7 8 9 10 |2 | |

|Contributions |0 1 2 3 4 5 6 7 8 9 10 |1 | |

|Editing |0 1 2 3 4 5 6 7 8 9 10 |1 | |

|Comments: |TOTAL | |

| |

TABLE OF CONTENTS

|Abstract |1 |

| 1.0 Project Overview and Block Diagram |? |

| 2.0 Team Success Criteria and Fulfillment |? |

| 3.0 Constraint Analysis and Component Selection |? |

| 4.0 Patent Liability Analysis |? |

| 5.0 Reliability and Safety Analysis |? |

| 6.0 Ethical and Environmental Impact Analysis |? |

| 7.0 Packaging Design Considerations |? |

| 8.0 Schematic Design Considerations |? |

| 9.0 PCB Layout Design Considerations |? |

|10.0 Software Design Considerations |? |

|11.0 Version 2 Changes |? |

|12.0 Summary and Conclusions |? |

|13.0 References |? |

|Appendix A: Individual Contributions |? |

|Appendix B: Packaging |? |

|Appendix C: Schematic |? |

|Appendix D: PCB Layout Top and Bottom Copper |? |

|Appendix E: Parts List Spreadsheet |? |

|Appendix F: Software Listing |? |

|Appendix G: FMECA Worksheet |? |

Abstract

As a part of the ECE 477 – Digital Systems Senior Design Project course our team of Srichand Yella, Anvesh Dasari, Varun Vallabhaneni and Madhu Tummala were able to finish design our project the ‘Touch 2 Order’, a portable touch screen based menu for restaurants which wirelessly transmits the order and has an integrated RFID reader. We started with the concept at the beginning of the semester and were able to complete the project at the end of the semester facing many challenges through various phases of design. But we had overcome all those problems with the help provided by all the course staff and material provided to us. All the Project Specific Success Criteria are successfully demonstrated to the course staff. The design considerations, specifications modifications, challenges for the project are detailed in this report.

1. Project Overview and Block Diagram

The ‘Touch 2 Order’ is a device which enables restaurant patrons to order food from the comfort of the table. The user is provided with a touch screen menu through which he can navigate through various options and food items to the cart. After selecting the items and the order placed it is wirelessly transmitted once the payment is done with the RFID card or the Cash/Credit option.

The ‘Touch 2 Order’ has an 8.7 inch touch screen which displays the restaurant menu to the user. With a single touch the user can select the food and beverage items and add to cart. At the cart the user can increase or decrease the quantity of food items ordered or remove them from the cart. When finished ordering and when the submit order is selected the display shows two options to pay the bill, using the RFID card which can be done through the integrated card reader in the device or through cash/credit done manually.

When the transaction is done the order is wirelessly sent to the server in the kitchen through a Zig Bee wireless transceiver where it is placed in the order queue. The device also has an option for customizable menu which can be done through the RFID card. The device is entirely portable and can run with rechargeable batteries when not plugged to external power supply.

[pic]

Figure 1.1 Overall Block Diagram for the ‘Touch 2 Order’

[pic]

Figure 1.2 The ‘Touch 2 Order’

2. Team Success Criteria and Fulfillment

PSSC#1 - An ability to display information (menus, items ordered, etc.) on an LCD.

The ‘Touch 2 Order’ successfully displays all the menus and when the food or beverage items are selected, it displays the items ordered and the total cost when the display cart option is selected.

PSSC#2 - An ability to enter choices and select functions via touch screen entry.

User can select food items and navigate through various menus successfully with a single touch.

PSSC#3 - An ability to read an RFID card and use decoded user ID to look up personal account information.

The integrated RFID reader detects the RFID tags and loads the ID into the microcontroller which can be later used to retrieve personal information such as customized menus.

PSSC#4 - An ability to transmit menu choices over a wireless interface (e.g.,

802.15.4)

Once the order is placed it is wirelessly transmitted through the Zig Bee wireless interface and the order is shown up on the server on the kitchen which is received through the receiver module connected through the USB port.

PSSC#5 - An ability to charge the batteries using a charger circuit.

The ‘Touch 2 Order’ once connected to external power supply stops taking power from the batteries and instead charges the batteries while taking power through the 12 V adapter.

Constraint Analysis and Component Selection

1. Design Constraint Analysis

The major design constraints that will be considered in this report are cost, durability and functionality. Since the finished product is going to be mounted on a restaurant table and since the restaurant has a lot of tables the product needs to be inexpensive. The durability factor comes in because the product will be used on a daily basis by a lot of customers and needs to be robust. It needs to be functional and include some convenience functions in order for the restaurants to use them.

2. Computation Requirements

The touch 2 order system is not computational intensive, rather it is mostly interrupt driven. Since it uses a user interface, a touch screen, a critical function would be to update the touch screen graphics quickly in response to the user input. Another requirement would be to update the menu according to individual preferences if a card is read from the user. The microcontroller will only get this information when interrupted by the RFID reader. After the individual data is retrieved from the server, the screen is updated. When the user makes the selection, the order is sent to the ZigBee transmitter through a SCI interface.

Since the graphic controller contains a built in SD card reader, all the images that are needed for the touch screen can be stored in the SD card reader. In order to change the menus automatically for breakfast, lunch and dinner, we will need to implement a timer module in the microcontroller with an estimated clock speed 8 MHz and 128K memory.

3. Interface Requirements

There are no peripherals in the touch 2 order system that interface to the microcontroller through general-purpose I/O pins. All the peripherals are interfaced to the microcontroller through either SCI or SPI modules. The baud rate is about 9,600. An LED will be connected to the GPIO.

4. On-Chip Peripheral Requirements

The touch 2 order system has three important components that are interfaced to the microcontroller. LCD and Touch panel are connected to the graphical controller. Graphical controller is connected to the microcontroller using SCI and TIM channel. TIM channel is used to update the menu according to the time. The RFID reader which is connected to the microcontroller through SCI is used for detection of RFID tags. The RFID reader has an in-built antenna. It identifies the transponder and sends the 64 bit transponder id to the microcontroller. ZigBee transceiver is connected to the microcontroller using SCI interface. The transceiver communicates with UART. One TIM channel of the microcontroller is used to implement accurate system clock. The following table gives a brief overview of the on chip peripheral requirements.

|Component |Interface |Part number (Make) |

|LCD and Touch Panel |SCI (1) |42-0105-01(Reach Technologies) |

| |TIM (1) | |

|RFID Card Reader |SCI (1) |RFID Reader ID-12(Spark Fun Electronics) |

|ZigBee Transceiver |SCI (1) |XBee Pro RF module (Digi) |

|System Clock |TIM (1) |Using microcontroller TIM port |

Table 3.4.1 On-Chip Peripheral Requirements

5. Off-Chip Peripheral Requirements

The Touch 2 order system has no off-chip peripherals.

6. Power Constraints

The ‘Touch 2 Order’ is an A.C powered device. There wasn’t any need for a battery as it is fixed on the table top. Since there is no battery back up the device needs to be continuously connected to power source. There may be little heat dissipation as it does not involve any heavy machinery or high speed processors. The maximum power consuming component is the backlight inverter. It consumes about 240 mA at 12 V threshold voltage. The ZigBee wireless transceiver also consumes larger currents up to 210 mA at 3.4 threshold voltage. To reduce this voltage strain the backlight will shut off automatically by a timer. The wireless and RFID modules will also be working only when the necessity arrives, thereby reducing the power consumption of the overall device. So it may require a voltage regulator of 12 V which is the maximum required for the design. The threshold voltages and maximum currents consumed for the major components of the ‘Touch 2 Order’ are listed in the table 2.5.1 below.

|Component |Voltage Threshold (V) |Maximum Current (mA) |

|Touch screen LCD |3.3 |92 |

|LCD graphic controller |3.3 |60 |

|Backlight Inverter |12 |240 |

|RFID card reader |5.4 |30 |

|ZigBee Wireless Transceiver |3.4 |215 |

|Microcontroller |3.3 |65 |

Table 3.6.1 Power Requirements of Major Components

7. Packaging Constraints

The ‘Touch 2 order’ is intended especially for use in fast food restaurants where the food service needs to be quick. These types of fast food restaurants are usually crowded. So our device should be able to withstand heavy daily usage. The device must also be packaged so that it should be protected from any food and drink spills. Our total packaging would consist of LCD touch screen panel, LCD graphical controller, Backlight inverter, RFID reader, wireless transceiver, microcontroller, PCB and any other circuitry required. The packaging should be made so that there are enough gaps between the components and the overall product should also be compact. The RFID reader should be placed so that it would easily detect the RFID tags. Similar is the case with the wireless transceiver, it should be placed so that its signals are properly transmitted to the kitchen server. Since the range of the wireless transmitter is good enough, there would not be any shielding effects due to the packaging. Since the device is always connected to power and is fixed at some place it is not required that it should be portable and light. But as the device runs directly with DC voltage and has no major heavy components it should be light enough to be transported if required. So the main constraint would be the outer packaging to make it withstand heavy and harsh usage rather making it lighter and portable. The package we chose was a perfect fit for the design and spacious enough to fit in all the components of our design.

8. Cost Constraints

At present there are no such devices in market which allow the user to order and pay. Some fast food restaurants such as McDonalds do have such a kind of devices but they do not allow the user to select his choice, whereas the ‘Touch 2 Order’ is unique in its kind which also wirelessly transmits the order to the server in the kitchen thereby making it quicker. The estimated cost of the device would be approximately $800 which is quite high. But this is a one time investment. Once implemented it would be cost effective for the restaurant owner as it reduces the manual work so the cost of the device can be recovered in no time. Also if the product is manufactured in bulk, it would also reduce the price of the device there by making it more cost effective.

9. Component Selection Rationale

The touch 2 order system that is being made consists of mainly a touch screen kit, microcontroller, RFID reader and a ZigBee transceiver. The above devices are discussed in detail in the following sections:

RFID Reader:

RFID reader is used to detect the Transponder. Transponders are used to pay the bill. Short range RFID reader is sufficient as the reader should not detect the other readers present at the other tables. Following table gives specifications for two short range RFID readers. Cost, Power and range are the important constraints in selecting the correct part required for the project. Spark Fun Electronics reader is very cost effective and consumes low power.

|Manufacturer |Texas Instruments |Spark Fun Electronics |

|Part number |RI-STU-MRD1 |ID-12 |

|Voltage Supply |5VDC |5VDC |

|Current |100mA |30mA |

|Interface |SCI (1) |SCI (1) |

|Integrated Antenna |Not present |Present |

|Frequency |134.2 kHz |125 kHz |

|Cost |$91 |$29.95 |

Table 3.9.1 RFID Comparison

ZigBee Wireless Transceiver:

Wireless Transceiver is used to send the data from the ‘Touch 2 order’ system to the kitchenette. To implement this ZigBee technology is selected as it is a standard technology. The technology meets 802.15.4 standards. Wide varieties of ZigBee modules are available. The table compares wide variety of ZigBee modules and there specifications.

|Manufacturer |Atmel |Maxstream |

|Part Number |ATmega64RZAPV |XBee Pro |

|Interface |SPI (1) and 4 I/Os |SCI (1) |

|Supply voltage |3.6VDC |3.3VDC |

|Current |16.5mA |215mA |

|Cost |$12 |$32 |

|Range |120mts |1000mts |

|Power |10dBm |20dBm |

In selecting the ZigBee module range is given more importance. So, XBee Pro is selected as the ZigBee Transceiver [10].

Table 3.9.2 ZigBee Transceiver Comparison

Touch Screen:

Choosing the touch screen was an important task. We needed a large screen size to display the graphics so that the user will be able to read the text and operate with bare hand. Since it would be convenient to buy a touch screen kit with LCD, touch overlay and a graphics controller, we compared two touch screen kits, one from Reach and one from Apollo [5] , [6]. The LCD’s were of the same size and the graphics controllers came with very good documentation. The Reach module supports SD card for external memory [5]. Finally the Reach module was chosen because it has been used in the previous semesters and it is well documented [5].

|Make |Reach Technologies |Apollo Display Technologies |

|Model |42-0105-01 |T-51638D084J-FW-A-AB-V399B |

|Touch-Screen |Yes |Yes |

|Display Size |8.4” |8.4” |

|Backlight |Yes |Yes |

|Memory Type |External SD |On board flash |

|Interface |RS232 |RS232 |

|Price |$699.00 |$649.00 |

Table 3.9.3 Touch Screen Comparison

Microcontroller:

The main constraints that were considered in choosing the microcontroller are the number of SCI and SPI modules and the amount of flash memory on the microcontroller. The touch 2 order system needs 3 SCI modules one each for ZigBee transceiver, RFID reader and graphics controller. It also needs a TIM module to maintain the system clock. Since we are going to configure the menu system, we needed a large flash memory (128 kB). Three microcontrollers were compared one from Freescale, one from Atmel and one from PIC. PIC microcontroller has been ruled out because of the 2 SCI modules but the system needed 3 SCI modules [8], [7]. In comparing the Atmel microcontroller and the Freescale one, Atmel one is more expensive and has less RAM on board [8],[7]. And also the Freescale one has more clock speed and the development group has experience with the Freescale microcontrollers [7].

|Make |Freescale |Atmel |PIC |

|Model |MC9S12E128 |ATMega1280 |dsPIC33FJ128MC706 |

|Bits |16 |8 |16 |

|Clock speed |25 MHz |16 MHz |40 MHz |

|Pins |80 |86 |64 |

|SCI |3 |4 |2 |

|SPI |1 |2 |2 |

|Flash memory |128 kB |128 kB |128 kB |

|RAM |16 kB |8 kB |16 kB |

|Development Tools |Code Warrior |AVR Studio |MP Lab |

|Price |$14.00 |$15.76 |$6.77 |

Table 3.9.4 Microcontroller Comparison

3. Patent Liability Analysis

4.1.0 Introduction

The patent liability issues would be regarding the usage and features of these components but as far as the interfacing or licensing is concerned it is automatically covered with the purchase of the product.

2. Results of Patent and Product Search

Three patents have been found that have similar functionality as the T2O system. These patents have been found based on the functions of the T2O system like the touch screen display, radio frequency link, RFID card reader and the method of display of the menu. The following are the patents that are found:

1. Portable point of sale terminal (US Patent #: 5408077) [1];

2. Apparatus for order entry in a restaurant (US Patent #: 5003472) [2]; and

3. Customer self-ordering system using information displayed on a screen

(US Patent #: 5235509) [3].

1. Portable point of sale terminal (US Patent #: 5408077)

Filing Date: 04/25/1994

Abstract: Data can be input to the terminal via a keyboard assembly, a touch-screen display or a signature-capture screen assembly, or via an antenna and radio link from an associated bar code scanner. Data may be communicated at any time to a remote host computer via a radio link. The communication links with the host computer and the bar code scanner operate independently and simultaneously [1].

Relevant Claims:

a) A hand-carryable housing having a front face

b) A display mounted on the front-face of the housing

c) A power source located within the housing

3. Apparatus for order entry in a restaurant (US Patent #: 5003472)

Filing Date: 12/06/1989

Abstract: Apparatus for order entry in a restaurant consists of a host computer and remote portable terminals. Orders are sent from the remote terminals to the host system through a radio frequency communication. The terminals include a bar code template of menu items and a light pen for scanning menu items. Printers are used at the host system to print receipts for the cooks in the kitchen [2].

Relevant Claims:

a) A portable terminal consisting of a display

b) Wireless communication for sending data to host

c) Display means at host for conveying information to the cooks

4. Customer self-ordering system using information displayed on a screen

(US Patent #: 5235509)

Filing Date: 11/15/1989

Abstract: This apparatus facilitates a self-ordering system for a fast food environment. This apparatus includes a terminal having a touch screen for self-ordering operation. Food items are arranged according to food categories. Primary display contains indicia representing categories for food items. By touching the screen, the user can navigate and select the food items of choice. Some indicia also initiate some predetermined functions such as cancellation of a previously selected items or an indication that order has been completed. One of the screens requests as to whether the customer wants to take out the ordered foot items [3].

Relevant Claims:

a) Customer terminal includes a touch screen wherein solid food items are selected by the customer by touching indicia associated with selected solid food items on touch screen

b) Food indicia representing a plurality of solid food items

c) A cashier terminal having a display with functions like cashing out an order, entering discount information and changing an order

5. Analysis of Patent Liability

4.5.1 Portable point of sale terminal (US Patent #: 5408077)

The Portable Point of Sale is similar to the ‘Touch 2 Order’ in few ways. One of them is that in Claim #1 in the patent it mentions it is a hand-carryable housing having a front face which is a common point in our ‘Touch 2 Order’ [1]. It also has display and a keyboard on the front face. Although our device consists of a display on the front face our project doesn’t consist of a keyboard as it is completely operated by the touch screen interface. In Claim #2 it mentions about the card reader the front face has a slot to accept one edge of the card [1]. The ‘T2O’ also has a card reader but since it is a RFID based it doesn’t require a slot for swiping the card in. Instead it just requires the card to be scanned over within its range to get detected by the card reader. So it can be said that our device has some important similarities with the Portable Point of Sale device.

2. Apparatus for order entry in a restaurant (US Patent #: 5003472)

The main purpose of this device is to enable the servers in the restaurant to enter the food orders whereas the ‘T2O’ is for the customers of the restaurant. In its Claim #1 in the patent it mentions about consisting a display which our ‘T2O’ also does [2]. Also mentioned is a wireless communication means for sending data communications to said host means which is also incorporated by our device [2]. But the difference here is the type of wireless interface we are using. The Zig Bee Wireless technology is entirely different from the radio link technology that is incorporated in this device. The final similarity is the display at the host for conveying information to the cooks. The ‘T2O’ also implements this feature. The order sent wirelessly from the device is shown in the host server kitchen which is a PC in our case. So similarities with this device are more but they are different in their own way.

3. Customer self-ordering system using information displayed on a screen

(US Patent #: 5235509)

This product is almost similar to our device in terms of purpose and working. In its patent it mentions about touch screen interface presented to the user where food items can be selected and the order can be placed [3]. This feature has been incorporated in the ‘T2O’. The patent also shows that the device has food indicia representing plurality of solid food items and a cashier terminal having a display with functions like cashing out an order etc. [3]. But the “T2O’ instead is a device which favors the customer more than the cashier. At the cashier terminal i.e. the host server can retrieve information of the RFID card being used. Although it has some share of similarities the ‘T2O’ is advanced in its own way with features such as wireless transmission of orders and a battery charger for the portability.

6. Action Recommended

1. Portable point of sale terminal (US Patent #: 5408077)

As far as the patent liability issues with this product are concerned there will be chances of potential for infringement as the ‘T2O’ is a product with similar functions. The purpose it is made and the features it includes are somewhat similar to the Portable point of sale terminal. The patent has claims such as featuring display on the front cover and internal power system. Although the display of this device is a touch screen it can be used only for minor functions such as taking signatures. But the display of the ‘T2O’ is used for displaying menus to the user and taking the inputs back from the user and the power system though internal has been designed differently thereby avoiding any kind of infringement from this patent. But since the design is similar although the purpose is different, to avoid any causes of infringement the owner of the patent should be contacted for licensing of the claim.

2. Apparatus for order entry in a restaurant (US Patent #: 5003472)

Similar is the case here. Wireless communication between the server and base may be a similar feature and may arouse some doubts of potential infringement but the wireless technology differentiates it. The apparatus for order entry in a restaurant uses radio link for wireless transmission. The ‘T2O’ uses a ZigBee Wireless technology which clarifies that there won’t be any patent liability issues regarding the implementation of wireless communication between the device and the host. Another claim which may be a potential for infringement is display at the host for conveying information for the cooks. This is a similar feature we are using for the ‘T2O’, so since there is no possibility to add more features to change this feature the owner of the patent should be contacted for licensing this feature or wait until the patent expires as it was made in 1989.

3. Customer self-ordering system using information displayed on a screen

(US Patent #: 5235509)

As mentioned in section 3.3 above there are three points in the claims of this patent which may cause any potential for infringement. The cashier terminal feature may not cause much a problem as our host is not a cashier terminal. The bill is paid at the device itself using the RFID reader. The host is merely a display of the food items ordered and displays the information of the RFID card used. But the first two points in the claims, customer terminal displaying food items and food indicia representing the plurality of the items displayed on a touch screen are the main issues. So to avoid any patent liability issues the patent owner should be contacted and licensing should be done. We cannot afford to make any changes as they are the core features of our device. The other way is to launch our product after a year when the above patent actually expires.

4. Reliability and Safety Analysis

The main functional blocks of the device include the power supply, microcontroller and battery circuit. The issues with microcontroller may arise during the software stages. The blocks which may give rise to safety and reliability issues once the product is finished are the power supply and battery circuit. The failure in power supply may cause damage to the components of the device which are less critical but some failures in the battery circuit may be highly critical causing damage to the user.

1. Reliability Analysis

We chose three components, one each from the three main functional blocks of our design, the microcontroller, MAX 1651 from power supply block and MAX 1660 from battery circuit block. All these components are considered as MOS devices according to the military handbook [1]. So assumptions were made accordingly while calculating the number of failures / 106 hours and the mean time to failure MTTF.

According to the military handbook the number of failures for 106 hours for the microcontroller can be calculated using the formula [pic][1]. From the data sheet of the microcontroller it was found out that the average junction temperature TJ was 85oC [2]. Based on this value and the corresponding results in the military handbook all the values needed in the above formula were found. Since the component is a MOS device, the die complexity failure rate, C1 = 0.28 and also, the number of pins was 80 and surface mounted, package failure rate, C2 = 0.032 [1], [2]. Another assumption was the environment which was assumed to be GB gave the environment factor [pic] = 2. From the class B-1 category the quality factor [pic]was found out to be 2 and the learning factor [pic]was taken as 1. For microcircuits the temperature factor [pic]= 7 at 85oC [1]. So by computing all the values in the equation the (p was 4.048 Failures / 106 hours and the mean time to failure MTTF was 676.7 years.

|Component |C1 |

|Freescale MC9S12E128 |1.00 |

|Maxstream XBee ZigBee Transceiver |1.24 |

|Voltage Regulator and DC – DC converters |0.5 |

|Headers |3.00 |

|Total Area: |5.74 |

Table 7.3.1: Area analysis for the PCB

From the above table and the box requirements, a size of 7” x 4” was chosen for the PCB. With this size for the PCB, there is a lot of space for any limiting resistors or by-pass capacitors.

5. Schematic Design Considerations

The major components involved in the circuitry of this device are the touch screen with LCD controller, RFID card reader, Zig Bee Wireless transceiver and the microcontroller which is integrated to all other major components in the circuit. All these components have different modes of operation, interface methods and power constraints. So it should be designed so that it meets all the requirements. The circuitry for each component is individually designed and later integrated with the other parts of the device to avoid any troubleshooting later.

1. Theory of Operation

All the major components of the device are chosen so that they can integrate efficiently with the overall device. There were many hardware constraints for these parts the important one being power consumption of each individual component. The voltage input for the system is 12V DC. So each component of the device demands an individual circuitry so they are sourced with required voltage.

1. Overall Power Supply

The voltage source for the whole device comes from a 12 V DC voltage adapter. So the only device which is connected directly to the power source is the backlight inverter which requires a voltage of 12 V. The remaining components have different voltage requirements. So to produce the needed voltage values for those individual parts a DC step down voltage controller was a necessity. The voltage regulator has the capacity to produce variable voltages from 3.3 V to 5 V which are required by the Freescale MC9S12E128 microcontroller, Spark Fun Electronics ID-12 RFID reader, Maxstream XBee Pro wireless transceiver and the Reach Technologies LCD graphical controller and the touch screen panel.

The microcontroller, Zig Bee wireless transceiver, Touch screen panel and the LCD graphical controller operate at a voltage of 3.3 V but the RFID card reader requires an operating voltage supply of 5 V [1], [2], [3], [4]. So the voltage regulator will produce an output of 3.3 V to source voltage to all the major components except the RFID reader which needs 5V voltage supply. Also the microcontroller has an operating frequency of 16 MHz with a 3.3 V supply and 25 MHz at 5 V supply. We chose a supply voltage of 3.3 V for the microcontroller. So a 5 V supply voltage is provided only for the RFID reader.

The ‘Touch 2 Order’ will not consist of any other pushbuttons or switches other than the reset button which resets the overall device when pressed. So the overall input for the device would be a 12 V power supply which is internally connected to the backlight inverter and the DC-DC voltage regulator.

2. Freescale MC9S12E128 Microcontroller

Maintaining lower power consumption of the device is quite an important issue. So there arises a need to maintain minimum operating frequencies for the microcontroller. The microcontroller has three SCI and one SPI ports [2]. Only the three SCI ports are being used here to connect to the RFID reader, wireless transceiver and the touch screen with LCD controller which is interfaced through RS-232. To maintain a low clock frequency of 16 MHz a 3.3 V voltage supply is required. This frequency is more than enough to maintain the baud rates of the device ranging from 115,200 of the LCD display to 9,600 of the Zig Bee wireless transceiver and the RFID reader.

1. Reach Technologies Touch Screen with LCD controller

The touch screen and the LCD graphical controller need a supply voltage of 3.3 V while the backlight for the LCD needs a 12 V supply. The LCD graphical controller has an integrated microprocessor which controls most of the operations of the touch screen and the backlight. It has a maximum baud rate of 115,200 with which it will communicate with the microcontroller through the serial interface so the display is updated at the maximum speed possible [3]. The second LCD controller interface can be used to connect it to the PC for programming of the LCD module with the help of a RS-232 level translator. The baud rate for this can be less than 115,200 as maximum speed is not a requirement for the programming of the LCD module.

2. Spark Fun Electronics ID-12 RFID card reader

The RFID card reader is operated at a voltage of 5V [4]. Two pins of the card reader are connected to the microcontroller through its SCI port for the data transfer. The microcontroller gives the instructions when to send data from the card reader. So the whole data transmission is controlled by the microcontroller. The RFID card reader is operated at 9,600 baud rate.

3. Maxstream XBee Pro wireless transceiver

The XBee Pro wireless transceiver is operated at 3.3V it is connected through the SCI serial interface with the microcontroller [1]. Through its serial port it can communicate with any logic and voltage compatible UART. Similar to the RFID reader two pins of the microcontroller are connected to this component for data transfer. The maximum speed at which the wireless transceiver can communicate with the microcontroller is 9,600 baud. The wireless transceiver takes instructions from the microcontroller and wirelessly transmits the data to the receiver module.

3. Hardware Design Narrative

The ‘Touch 2 Order’ system has 3 major building blocks namely RFID module, ZigBee Module and Graphical controller with LCD and Touch Panel. The connections between these modules and microcontroller can be seen in the schematic in Appendix A. The LCD and Touch Panel are connected to the Graphical controller through the jumpers on the controller. Graphical controller is connected to the microcontroller using SCI and a GPIO [2]. RFID module is connected to the microcontroller using SCI. ZigBee module is connected to the microcontroller using SCI and 4 GPIOS. So the ‘Touch 2 Order’ system requires 3 SCI ports and 5 GPIOS. SCI of port S will be connected to the RFID reader Data pins. RFID has inbuilt antenna and tuning capacitor. RFID works at 9,600 baud rate. SCI of port S is connected to the Data pins of XBee Pro ZigBee transceiver. There are 4 others pins on ZigBee module which are connected to the PAD pins. PAD7 is connected to the RESET with a 50k pull up resistor. PAD6 is connected to the Sleep pin. This pin puts the ZigBee in sleep mode when required by the microcontroller. PAD5 is connected to the RTS and PAD4 is connected to the CTS [2]. SCI of Port M is connected to the graphical controller. RTS of Graphical controller is connected to the PQ [0] of port Q. The Graphical controller works at 115,200 baud rate.

The microcontroller has a clock frequency of 25MHz at 5v. ‘Touch 2 Order’ system requires communicating at 9,600 baud rate with both ZigBee and RFID reader. The ‘Touch 2 Order’ system requires two power supply voltages – 5 V and 3.3 V. National semiconductor’s LM 2679 DC to DC regulators are used to generate 3.3 V and 5 V from 12 V. LM 2679 is connected with current limiting resistors, capacitors, inductors. The exact values were calculated for both the 3.3 V and 5 V outputs [6].

6. PCB Layout Design Considerations

The major components for the device are the touch screen with LCD graphical controller, RFID reader, ZigBee wireless transceiver, DC-DC voltage converter and the 16-bit Freescale 9S12CE128 microcontroller. But the components mounting on the device would be ZigBee wireless transceiver, DC-DC voltage converter and the microcontroller. The PCB will also have headers for serial interface, power and general purpose I/O’s. The LCD graphical controller and the RFID reader are connected through the serial interfaced headers since they should be available for the user. All these parts are designed on the PCB efficiently taking the physical restrictions of the components and also the overall device into consideration.

1. PCB Layout Design Considerations – Overall

PCB Layout design involves many factors to be taken into consideration for it to be fully operational. One of the most important factors is noise reduction in the circuit and next is the efficient placement of the components on the PCB. The unwanted noise in the circuit can be reduced by placing decoupling capacitors in every design which will be either a low-inductance axial glass or of a multi-layer ceramic.

As said above next important factor is the placement of various components on the PCB. There is a need to separate the components on the basis of whether they are digital, analog or noisy circuits. The circuits involving the DC-DC voltage regulators for 5 V and 3.3 V and the power input are grouped together to one corner of the PCB. The microcontroller is connected to headers on all sides and is connected to other digital circuitry such as the XBee Pro wireless transceiver through the headers. Another important requirement for the successful functioning of a PCB is placing the headers or input pins on the edges of the board. This includes the headers for serial interface of the RFID reader and touch screen with LCD graphical controller and for the power connection. The overall PCB should also be packaged so that it is in right contact with the components connected which are not present on the PCB.

One more important factor that should be taken into consideration while designing a PCB is the tracing of the connections in the circuitry of the device. It is important to minimize the lengths of the trace connections to avoid any stray inductance and any interference with the rest of the circuitry. The width of the trace should also be considered. It should be well enough to handle the current flowing through it. While routing, right angle turns are not at all advisable as it may lead to the transmission of the reflections. It is also important to separate digital and analog trace lines. The high frequency lines should also be at a minimum distance to avoid any unwanted noise in the circuit. The trace lines of power and ground would also be running parallel to each other which reduce the noise to a larger extent.

2. PCB Layout Design Considerations – Microcontroller

For the proper functioning of the microcontroller in the PCB Layout the designing should be done with extra precision. The onboard voltage regulator for the microcontroller requires decoupling capacitors, central point grounding and low inductance connections between VSS1, VSS2, and VSSR. As shown in Figure 3.1 the decoupling capacitors should be placed meeting the requirements and the central point of ground should be connected to the VSSR pin.

[pic]

Figure 9.2.1 Placement of the Decoupling capacitors with respect to the microcontroller

The 9S12CE128 Microcontroller requires a external crystal circuit to control the internal clock generator. This circuitry will be separated from the rest to avoid any unnecessary contact with power and ground. The VSSPL, EXTAL and XTAL connection will be as short as possible. The power and ground traces would be running parallel to each other thereby reducing the possibility of production of any kind of noise from the power pins of the rest of the components of the circuit. This kind of unwanted noise may also affect the oscillator and its output. The VSSA and VDDA pins are connected to the central power for the microcontroller.

It is not safe to have traces running beneath the microcontroller or any other circuitry involved with it such as the decoupling capacitors or the external crystal as they are very sensitive.

3. PCB Layout Design Considerations - Power Supply

The main components for power supply that go onto the PCB include DC – DC linear converters, external voltage input port and a power header. All these components are placed on the top-left corner of the PCB to isolate any noise that they produce. The external voltage input port and the power header pins are mounted to the left edge of the board for easy connectivity from outside.

The DC – DC linear converters have an external circuit requirement on the PCB. Sufficient room is planned for these components on the PCB.

All the power components are being planned to be placed on the top side of the PCB. The power trace should be wide enough to carry enough current for the system. The ground trace should be wide to reduce any interference between components. The ground trace is planned to be as long as possible so that there is minimal interference across all the components. Both the traces will be run parallel to each other which will reduce the interference to minimum. All the ground traces will be grounded at a single point. The figure 4.1 below shows the DC – DC linear converter, LM 2679, pins.

[pic]

Figure 9.3.1: LM2679 DC – DC linear converter

VIN0, CB, Current Adj., FB, VSW0, GND and Softstart are the only pins that are used in building the circuit for DC – DC converters. Since all the pins are analog, there are no restrictions on routing them on the PCB, but they will be provided with adequate spacing so that there is no interference among the signals.

7. Software Design Considerations

1. Software Design Considerations

The main software design considerations that the team is looking at are:

a) Easily understandable user interface

b) Simple and convenient functions and

c) Sensible flow of code

Since the users will be new to using the system, the user interface should be very easily understandable and the functionality should be simple.

2. Code Organization

To make the code organization simple, the T2O team has decided to keep the most part of the code to be command-driven rather than interrupt-driven. The only interrupt-driven peripheral is the touch screen. Since it is a user interface, the interrupts generated by the touch screen are at random intervals. The RFID talks to the microcontroller only when the user is asked to. Any other RFID inputs are ignored by the microcontroller. The ZigBee also talks to the microcontroller only when the microcontroller requests information from the host computer. All other inputs are ignored by the microcontroller. This makes the code organization easier. Appendix A shows a detailed code flowchart.

3. Memory Map

The microcontroller configuration will be set to normal single chip mode. The variables and the stack are stored in the RAM. The main code and the interrupt vectors are stored in the flash memory. The CodeWarrior IDE automatically maps all the static code in flash and dynamic code in RAM. The memory on the MC9S12E128 is arranged as follows:

$0000 - $03FF Register Space (1k)

$0400 - $1FFF System Fixed Ram Space (7k)

$2000 - $3FFF User Ram (8k)

$4000 - $FFFF Fixed Flash EEPROM (128k)

The memory map for the microcontroller is shown in the figure below:

[pic]

Figure 10.3.1: MC9S12E128 User Configurable Memory Map

10.4.0 Integrated Peripherals

The T2O application makes use of three modules namely SCI, I2C and RTI modules. All the three SCI modules are used. The modules are discussed in detail below:

SCI0: This module is used to interface the RFID reader to the microcontroller. Only the RxD0 pin is used for communicating with the RFID reader. Whenever the microcontroller needs input from the RFID, it displays a notification on the LCD screen and waits for the RFID input. When the RFID tag is read, the tag ID is received by the microcontroller and stored.

SCI1: This module is used to interface the ZigBee transceiver to the microcontroller. When ever the microcontroller needs some information from the host PC, it sends a request and waits until the information is received.

SCI2: This module is used to interface the Graphic controller (SLCD5) to the microcontroller. Touch screen keeps interrupting the microcontroller when ever the user touched a hotspot. But only a set of interrupts are recognized by the microcontroller and all other interrupts are ignored. The microcontroller sends the battery information to the LCD every one minute. It also sends some text to be displayed on the LCD like the products in the cart, the check total and the customized menu selections.

I2C: This module is used to interface the battery monitor to the microcontroller. The battery monitor updates the status of the battery to the microcontroller every one minute using the RTI interrupt.

RTI: The RTI generates two interrupts periodically. One interrupt is generated every one minute to request the data from the fuel gauge. The second interrupt is generated at five minutes interval after the user touches the screen. This makes sure that the system goes into sleep after a five minute interval if the touch screen is not touched.

The implementation of these modules and the GPIO pins is listed below:

SCI0: PORTS (0) – RFID input

SCI1: PORTS (2:3) – ZigBee input output

SCI2: PORTM (4:5) – Graphic controller input output

I2C: PORTM (6:7) – Fuel Gauge input output

GPIO: PORTM (3), PORTQ (2:3) – Fuel Gauge control inputs

PORTQ (0) – Graphic controller reset pin

PORTAD (4:7) – ZigBee control inputs and outputs

5. Software Design Narrative

The Touch 2 Order system has three main interfaces with the MC9S12E128 microcontroller. They are Touch screen, RFID reader and ZigBee transceiver. Only RTI (Real Time Interrupt) and Touch Screen input to the microcontroller are interrupt-driven. Remaining all functions is program driven. The main code for microcontroller starts with the initializations for SCI (SCI_ INT), I2C (I2C_INT), RTI (RTI_INT), GPIOs (GPIO_INT). Then the program enters an infinite loop. In the loop the code waits for Touch Flag. This flag is set to one when there is touch screen’s interrupt. This is taken care by the IN_LCD function. When user touch the touch screen the LCD wakes up from the sleep mode and displays the welcome message and sends an interrupt to microcontroller. This interrupt sets Touch Flag one. After Displaying welcome screen LCD displays two options. Those options are full menu and custom menu. All this is taken care of by the graphical controller in the touch screen.

When user hits full menu, it displays lunch menu and breakfast menu. The corresponding menus are displayed by the user selection. For example it displays Beverages, Main course, Sides, Deserts. If user selects beverages it displays different beverages available. If user selects coke the corresponding touch interrupt is send to the microcontroller. IN_LCD function receives the data from the Touch screen Through SCI2 receive pin. After receiving data, IN_LCD calls ADD_CART function. ADD_CART function compares the input data from SCI2 to the predefined array menu1. If the data corresponds to an element in the array menu1, the corresponding order number is added to the array ‘order’. When user hits ‘Done’ on the touch screen, INT_LCD function calls the function DISP_CART. DISP_CART displays final order of the customer using the array ‘order’. The LCD waits for the user to press ‘Check Out’ button.

When user hit that, it displays payment options. The payment options are RFID or Cash. If user presses RFID option IN_LCD function set PAY_RFID flag to one. When PAY_RFID flag is one it calls IN_RFID function. When RFID reader detects an RFID tag it sends the tag number to the microcontroller using SCI0 RX pin. IN_RFID accepts this data. After this the main function calls OUT_ZIGBEE. This function sends order array which contains customer order and RFID tag number to the kitchenette server using SCI1 TX pin. Then the code calls IN_ZIGBEE. IN_ZIGBEE waits for the confirmation from the kitchenette server. If it receives Y then OUT_LCD function displays confirmation message on the LCD else it displays error message on the LCD screen.

When user hit pay bill using cash, OUT_ZIGBEE sends order to the server. IN_ZIGBEE function waits for the confirmation. Depending on the received data OUT_LCD displays corresponding message.

If user selects custom menu in the starting instead on full menu, CUSTOM flag is set to one in IN_LCD. If CUSTOM flag is set to one main code calls IN_RFID. IN_RFID receives the tag number and sends it to kitchenette server for validity. If kitchenette server sends confirmation main code calls OUT_LCD_COM function. This function compares the corresponding command for the RFID number from the look up table 1 and sends the command to the LCD through SCI2 TX pin. After this it accepts order and pays bill similar to the full menu feature.

There is an RTI interrupt which is set to occur at 8.192 ms. RTI is written in the function RTI_ISR. This function has two counters. First counter counts one minute and calls the function BATT_CALC. This function calculates battery level using I2C interface. After this function RTI_ISR calls BATT_DISP to display battery level. It displays both percentage and using three bars. If battery is between 66% - 100% 3 bars are displayed on the screen. If it is in between 33% - 66% it displays two bars or else just one bar. This function gives warning when there is 10% battery charge left. This function also shuts the system off when battery charge is less than 5%. The second counter in RTI_ISR is used to switch off back light of LCD, when counter reaches 5*60*122 value.

MAIN( ) – This function calls all the functions. It has an infinite loop.

- Outlined the pseudo-code.

SCI_INT( ) – This function has all the initializations for the three SCI ports. All ports are set for 9600 baud rate.

- Successfully ported and tested.

I2C_INT( ) – This function has all the initializations for the I2C port.

- Outlined the pseudo-code.

RTI_INT( ) - This function has all the initializations for the RTI. It is set to work for 8.192ms.

- Outlined the pseudo-code.

GPIO_INT( ) - This function has all the initializations for the GPIOs.

- Outlined the pseudo-code.

IN_LCD( ) - This function works on interrupt driven. It receives data from the touch screen. This function resets the five minute counter in the RTI_ISR when ever it receives an interrupt.

- Outlined the pseudo-code.

ADD_CART( ) - This function adds the user selected items into array called order depending on the touch screen inputs. The touch screen inputs are compared to the menu1 predefined array. If the elements match with the input, the corresponding order number is added to the array ‘order’.

- Outlined the pseudo-code.

OUT_LCD( ) - This function displays the string on the LCD at the specified location given X and Y coordinates.

- Outlined the pseudo-code.

DISP_CART( ) – This function displays total order of the customer on the LCD screen. This function is called when user hits ‘done’ on the touch screen.

- Outlined the pseudo-code.

WAIT( ) - This function waits for the specified number of ms.

- Outlined the pseudo-code.

IN_RFID( ) – This function waits for RFID tag. When it detects RFID tag it sends the data to microcontroller using SCI0.

- Outlined the pseudo-code.

OUT_ZIGBEE( ) – This function sends data to kitchenette server using ZigBee transceiver.

- Outlined the pseudo-code.

IN_ZIGBEE( ) – This function receives data to kitchenette server using ZigBee transceiver using SCI1.

- Outlined the pseudo-code.

CLEAN_UP( ) – This functions clears two arrays. Those are ‘sendArray’ and ‘order’. ‘sendArray’ has order and the RFID tag number combined together. ‘Order’ has the user selected menu items.

- Outlined the pseudo-code.

TOTAL_CALC( ) – This function calculates the real time total of the cart and updates it when ever user selects an item from the menu.

- Outlined the pseudo-code.

OUT_LCD_COM( )- This function sends commands to LCD screen to display corresponding LCD screens for the customized menu depending on the RFID tag number.

- Outlined the pseudo-code.

BATT_CALC( ) – This function calculates the battery level using max1660 chip. This is interfaced to I2C of the microcontroller. This function is called by RTI_ISR every minute.

- Outlined the pseudo-code.

BATT_DISP( ) – This functions displays the battery information. It displays both percentage of charge left and the three bars representing the charge levels. If charge is in-between 100- 66 % three bars are shown. If charge is in between 66- 33 two bars are shown else one bar is shown. This function displays warning message when charge is below 10% and it shut downs the entire system when charge is less than 5%. This function is called by RTI_ISR every minute.

- Outlined the pseudo-code.

RTI_ISR( ) - This function has RTI subroutine written. It has two counters. First counter is used to measure a minute and call BATT_CALC and BATT_DISP functions. Second counter is used to measure five minutes and call the Sleep_Set function.

- Outlined the pseudo-code.

SLEEP_SET( ) - This function is used to switch off the back light of the LCD.

- Outlined the pseudo-code.

The software for the host computer is written in C#.NET. The host PC software is used to receive information and commands from the microcontroller and is used to send information to the microcontroller about validation of the RFID tag, menu customization etc. At the host computer a database is also planned to be implemented in SQL Server that bears the information about the different menu items and the RFID tags that are registered to the system.

8. Version 2 Changes

The version 2 of the ‘Touch 2 Order’ will include many other features that are not there in the present version. Windows surface has always been our inspiration in designing the ‘Touch 2 Order’. Due to lack of high technology and appropriate funding we weren’t able to spend much on the project. Given a chance for upgrade, our team is very much interested to create a multi-touch interface which makes ordering food more fun and easy. A feature such as drag and drop where the user can drag items and drop them in the cart to place the order would be a good one.

In the present version updating of the menu is hard for the restaurant owner because the microcontroller needs to be programmed every time a change is needed. For version 2 our team has decided to make it easier for the restaurant owner to make changes in the menu where he could do it directly from the host server. Addition of a credit card reader along with the RFID reader would also be a good idea provided that the security issues concerned with it are taken care off.

Also the version 2 would be designed more compact and sleek than the earlier version. For this the battery circuit should be redesigned and we are opting to use lithium ion batteries than the NiMH rechargeable AA batteries as they are considered safer and also have better performance. For this the PCB needs to be designed again to make it more compact. Even though it may make the product expensive an addition of graphics card is also considered by our team to display more graphics on the touch screen which gives a pleasant visual experience for the users.

The ‘Touch 2 Order’ has all the minimal features that fulfill the purpose it is designed for. Addition of the above mentioned features could only make it much better.

Summary and Conclusions

‘Touch 2 Order’ was an idea sometime back. To make it into reality we needed to learn so much and work hard for a semester. The tough job at the starting was on what project to do. Finally our team has decided to do something like the windows surface. But due to lack of many things such as funds, time and technology we compromised ourselves to minimize the features and started to design the ‘Touch 2 Order’. It needed a lot of research on the main components such as the display screen, RFID reader, a wireless transceiver, microcontroller and other components. It was a tough job to find the right component we needed making all the considerations such as packaging, cost etc.

After the selection of components the next thing was to design the circuit using the schematic. Although we had previous experience in Orcad Capture, we needed to learn a lot of new things such as creating new parts, a net list which is needed for PCB Layout etc. Next thing was even tough and most important in the design. The PCB layout is the heart of the project. A small mistake in the design could make the device to fail. None of our team members had previous experience in Layout Plus. So the PCB design took a lot of time.

After the midterm design review we made a major change in our project, that is to add a battery charger and monitor circuit to make the device more portable which again was a time consuming thing at that stage of the design. Next in line was the software. We did a lot of coding in Code Warrior for the microcontroller and Hyper Terminal for the LCD screen. None of us had experience in this software. So it was again a new learning experience. Once we got our PCB manufactured we populated it with all the components. Soldering was a tough job although we had some previous experience during ECE 362 this was all together a different kind of a thing.

After everything was into place and we successfully demonstrated our PSSC’s it was time for the final packaging of the product. Since everything was working fine packaging of the product was a minor issue. So finally after a semester long of hard work we were able to make our thoughts into reality with the help of a good course curriculum and assisting teaching staff.

References

1] Atmel ATmega64RZAPV ZigBee datasheet



2] Sparkfun RFID data sheet ID-12



3] Sparkfun RFID LF tags



4] TI RFID series micro 2000 reader module



5] Reach Technology touch screen SLCD5



6] Apollo Display Technologies touch screen



7] Freescale 16-bit microcontroller Data sheet



8] Atmel ATmega1280 8-bit microcontroller datasheet



9] Microchip 16-bit microcontroller datasheet



[10] XBee RF module data sheet



[11] IBM Sure POS 700 Series overview and technical specifications



[12] Microworks POS Solutions Inc. Tableside POS



[13] Pactec Enclosures



[14] National Semiconductor DC to DC convertor



[15] Portable point of sale terminal (US Patent #: 5408077)



[16] Apparatus for order entry in a restaurant (US Patent #: 5003472)



[17] Customer self-ordering system using information displayed on a screen

(US Patent #: 5235509)



[18] Military Handbook, Reliability Prediction of Electronic Equipment, Department of Defense, 2 January 1990.



[19] DC-DC voltage regulator MAX 1651 Data sheet



[20] Battery Fuel Gauge MAX 1660 Data sheet



[21] Finding and dealing with battery leakage/corrosion



[22] Wikipedia, Restriction of Hazardous Substances Directive



[23] Environmental Health & Safety Inc.



[24] Battery Solutions Inc.



Appendix A: Individual Contributions

A.1 Contributions of Varun Vallabhaneni:

My Contribution to the project started when our team formed last semester during the end of Fall 2008. We had various ideas before we started working on the ‘Touch 2 Order’. I was one of the persons who insisted that we should go ahead with the wireless touchscreen interfaced restaurant ordering system. Within the first week we finalized our project proposal and decided the ‘Touch 2 Order’ as our project.

As soon as the project took off, I started research on the components we needed and the technology we wanted to use along with other team members. I did research on the touch screen display we wanted to use. I discussed with other team members about the use of Zig Bee wireless technology and RFID interfacing. I also did some research on the microcontroller we wanted to use and discussed with others to use the Freescale MC9S12C32 16-bit microcontroller.

Once we decided and bought the components then it was the time to design the schematic. I designed some of the parts of the schematic with the help of other team members. Lot of new parts were needed to be created and many errors were fixed. Then I helped Srichand in doing the PCB Layout which was the toughest job. Since we didn’t know the basics of Layout Plus it took us a lot of time to figure out many things. Once we successfully completed the PCB, the midterm design review led to many changes in our design. One of the main changes was the addition of battery circuit. I did research on the level translator and charging circuit. I designed the circuit for the level translator but later we found out that there was no need for that. Then I had my share of contribution in redesigning the schematic and PCB Layout.

After Spring Break, it was time to start the software part of the project. Though I didn’t do much of the software coding, I was contributing towards the PCB population and hardware testing and debugging. Madhu and I soldered the PCB and tested different circuits one after another debugging them. Finally after we got everything into place I contributed a lot towards packaging, the final demo and report. My contribution in this project is more inclined towards hardware than software.

A.2 Contributions of Anvesh Dasari:

I started working on our team project starting end of fall’08. The concept of Microsoft surface drives us to develop a touch screen ordering system. I started this semester researching different kinds of parts. I concentrated on choosing Zigbee wireless transceiver. I found Atmel transceiver at first. Later my team decided to use Digi’s Xbee Pro. I did research on battery charging circuit too.

I understood the zigbee technology. I did the schematic for the Xbee. I understood how the MAX 712 chip works. I draw the schematic for 10 cells and 24v wall wart input. I spent time on understanding the Layout software. I did layout for our schematic. I am able to do the foot prints for the components which don’t have footprints. I helped the team in routing the power, ground lanes.

Even though I worked on hardware side of the project by designing schematic and doing layout, my major contributions include programming the microcontroller. Our team got development board and I started working on SCI interface. I did my research on SCI. My knowledge of 362 helped me to implement SCI interface. I learnt assembly C so that we can do more effective coding

I worked on RTI interrupt. I spent lot of time understanding interrupts. I also spent time on having both SCI and RTI interrupts work same time. I started the main programming for our project with SCI interface. I am able communicate with the LCD screen. I started working on the main program of adding items to order cart. Remove items from the order cart. I developed several other small functions in assembly c for our project. I did research on I2C. I wrote code in c for I2C interface of our microcontroller to the battery monitoring unit.

I have spent significant amount of time in hardware debugging too. I used to help my team mates in debugging power circuits. Overall, I worked more software side of the project than hardware. I learnt lot of interesting things while contributing to the project.

A.3 Contributions of Srichand Yella:

At the end of fall 2008 semester, I had two ideas in mind for our project. I was thinking of making a Home Automation system which controlled all the essential parts in a house. But upon talking to Prof. Meyer we realized how easy the project was. So we took up the Touch2Order project. At the beginning of spring 2008 semester, I started off by researching for the parts that are needed for our system. I researched a lot of touch screens and finally came up with the Reach Technologies SLCD5 controller. Initially I was trying to understand how the 4-wire resistive touch screen worked, but now I have realized how easy it is work with the SLCD5 controller. All the low level controlling is already taken care of and all we had to do was to simply call some functions to make the screen in a matter of minutes.

After the research, I spent most of my time working on making the circuit for our system. I made the circuits for the MAX1651, MAX1649, MAX1660, the graphic controller, the RFID reader and the ZigBee transceiver. Interfacing the graphic controller, RFID reader and the ZigBee were all similar because all the devices used SCI interface with the microcontroller. I also made the schematic for the microcontroller.

Later into the semester I spent a lot of my time on designing the PCB layout. Initially I made one PCB layout but after Prof. Meyer suggested us to use battery power for our system, we had to make a completely new PCB layout including some new footprints. We had a hard time choosing the right parts for the PCB as some of the parts that were recommended were outdated and were not available.

After we were done with all the hardware stuff and the PCB, we started working on the software. While Madhu helped me make images for our system in Photoshop, I developed the code for the touch screen graphics. After we had the touch screen and the RFID reader up and running, we had some problem with the interfacing of the ZigBee. So, I worked on the ZigBee and got it working. Now that we are able to communicate with the host computer, I started to write the code for it in Visual C#. I also developed a database for storing all the information about RFIDs and the Menu items.

During the last part of the semester, I mostly worked on debugging the circuits on the PCB. We did have some errors on the PCB and finding and fixing these errors was a big deal. Finally we have everything working, the software, the hardware, the interfacing, and the whole system thanks to the team.

A.4 Contributions of Madhu Tummala:

When we initially formed the team, I thought of Restaurant ordering System as our project but then there were many idea also other than mine. However, we ended up with the Restaurant Ordering System (T2O). At the beginning of the Course, I did a lot of research on what components to go and what special features to have in our project. I was responsible for selecting the Zigbee’s technology Xbee pro and the SparkFun RFID.

During the design of circuits in the schematic I helped others selecting the right resistor values and other parts, went through the data sheets of the parts thoroughly and calculated the values of parts like resistors, capacitors and so on. I spent a lot of time figuring out what parts to select for the battery circuit. I recommended the parts MAX712 for the battery charger, MAX1600 for the battery monitor MAX1649 for the LDO circuit. I understood how these parts work and helped others to design the schematic for those parts. I also designed the RS232 (level shifter) interface circuit between Microcontroller and Touch screen.

I didn’t get to help a lot in the PCB layout. However, I understood how it works and gave some suggestions to my team members. I designed graphics using adobe Photoshop for the Touch Screen.

I did a lot of research on I2C and understood how it works. I and Anvesh worked on the I2C interface for our battery monitor. I and Anvesh went through most of the programming together and I helped him in the debugging especially in SCI. I and Srichand worked a lot on debugging the battery circuit and Xbee pro.

I did the most of the soldering of parts on the PCB, it was a very tough job and I had to be very careful. Also not all parts go on our PCB because some of the parts have a different packaging type than on the PCB. I did a lot of research figuring out what other right parts would substitute those parts and if not how could it be made worked.

I helped a lot in the Packaging design and the final packaging. I have learned many things in this project. Finally I would say, I sort of touched all parts of the project.

Appendix B: Packaging

[pic][pic]

[pic][pic]

[pic][pic]

Figure B-1 Different stages of Packaging from PCB to final product.

Appendix C: Schematic

[pic]

Figure C-1 Microcontroller Schematic

[pic]Figure C-2 XBee Pro Schematic

[pic]Figure C-3 MAX 712 (Battery charger circuit) Schematic

[pic]

Figure C-4 MAX 1651 and MAX 1649 (3.3 V and 5 V) voltage regulators Schematic

[pic]

Figure C-5 MAX 1660 (Battery Monitor Circuit) Schematic

Appendix D: PCB Layout Top and Bottom Copper

[pic]

Figure D-1 PCB Top Copper Layer

[pic]

Figure D-2 PCB Bottom Copper Layer

Appendix E: Parts List Spreadsheet

|Manufacturer |Part No. |Description |Cost |

|Reach Technologies |42-0105-01 |8.7 inchTouchscreen LCD display |$ 699.00 |

|Spark Fun Technologies |ID-12 |RFID reader |$ 29.95 |

|Maxstream |XBee Pro |Zig Bee wireless transceiver |$32.00 |

|Freescale |9S12E128 |16 bit Microcontroller |$14.90 |

|Pactec Enclosures |DM - 4 |Device Enclosure |$33.00 |

|Digi Key & Mouser electronics |- |Capacitors, Resistors, Inductors, MOSFETS and |$30.00 |

| | |other passive components | |

|Only batteries |NiMH batteries |Accupower AA rechargeable batteries |$52.00 |

|CUI Inc |EPAS -101W-24 |Switch mode power supply |$19.00 |

|Total Cost of the project |$909.85 |

Table E-1 Parts list and their individual costs and total cost of the project.

Appendix F: Software Listing

F-1 Software for Microcontroller

/***************************************************

T20 software for micrcontroller

version 1.1:Started on March 15th by Anvesh

version 1.2:Updated by Anvesh on March 16th

version 1.3:Updated by Anvesh on March 20th

version 1.4:Updated by Srichand on April 6th

version 2.1:Updated by Anvesh on April 8th

version 2.2:Updated by Anvesh on April 10th

version 2.3:Updated by Srichand on April 11th

version 2.4:Updated by Madhu on April 16th

version 3.1:Updated by Anvesh on April 18th

version 3.2:Updated by Anvesh on April 20th

version 3.3:Updated by Anvesh on April 22th

****************************************************/

#include /* common defines and macros */

#include /* derivative information */

#include

#include

/* function prototypes*/

void make_order (char);

void TAKE_DATA (void);

void OUT_LCD (char *a);

void SCI2INT (void);

void SCI0INT (void);

void SCI1INT ( void);

void RTIINT(void);

void outc_test (char *a);

void ADD_CART(char *a);

void REMOVE_CART(char *a);

void IN_RFID(char a[30]);

//void wait(long a);

void QUANT_CART(char *a);

void SCI2_ISR(void);

void wait(long ms);

void IN_ZIGBEE(char a[160]);

void OUT_ZIGBEE (char *a);

void CLEAR_ORDER();

void IICINT (void);

void GET_BAT(void);

/* Global Variables */

int order[30]; // The item number of the user selected item is saved in this array.

int order_quant[30]; // The quantity of the order is saved in this array

int num;

char rfid_tag[12]; // Input from RFID is saved in this array

int rti_cnt; // Counter for RTI

int sleep_flag;

int sleep_cnt;

int table = 7; // table number

float bat = 0;

char send_array[160]; // Array send over zigbee

char recieve_array[160]; //Array recieved over zigbee

long dis_count0; // Discharge count0 for the battery

long dis_count1; // Discharge count1 for the battery

long dis_count2; // Discharge count2 for the battery

long dis_count3; // Discharge count3 for the battery

long ch_count0; // Charge count0 for the battery

long ch_count1; // Charge count1 for the battery

long ch_count2; // Charge count2 for the battery

long ch_count3; // Charge count3 for the battery

typedef struct{ // struct type for an item.

char abutton[10];

char item[30];

int number;

int dollars;

int cents;

char bcmd[10];

char bnum[50];

} record;

// struct type to help in DISP_CART function

typedef struct {

char rbutton[5];

char dec_button[5];

char inc_button[5];

char disp_co[150];

char disp_co2[20];

char disp_co3[10];

} disp_vector;

//T20 menu items data

record menu[]={

{"s20 1","Bacon, Egg & Cheese Biscuit",1,5,99,"bd 20 "," 20 \"\" \"\" 0 0 0 0 30 31\r"},

{"s21 1","Egg McMuffin",2,6,0,"bd 21 "," 20 \"\" \"\" 0 0 0 0 32 33\r"},

{"s22 1","Hash Browns",3,4,0,"bd 22 "," 20 \"\" \"\" 0 0 0 0 34 35\r"},

{"s23 1","Hotcakes & Sausage",4,3,59,"bd 23 "," 20 \"\" \"\" 0 0 0 0 36 37\r"},

{"s24 1","Sausage Biscuit",5,4,23,"bd 24 "," 20 \"\" \"\" 0 0 0 0 38 39\r"},

{"s25 1","Sausage Biscuit with Egg",6,5,66,"bd 25 "," 20 \"\" \"\" 0 0 0 0 40 41\r"},

{"s26 1","Sausage McMuffin with Egg",7,4,0,"bd 26 "," 20 \"\" \"\" 0 0 0 0 42 43\r"},

{"s27 1","Coffee",8,2,0,"bd 27 "," 20 \"\" \"\" 0 0 0 0 44 45\r"},

{"s28 1","Hot Chocolate",9,4,0,"bd 28 "," 20 \"\" \"\" 0 0 0 0 46 47\r"},

{"s29 1","Ice Tea",10,4,0,"bd 29 "," 20 \"\" \"\" 0 0 0 0 48 49\r"},

{"s30 1","Water",11,0,0,"bd 30 "," 20 \"\" \"\" 0 0 0 0 50 51\r"},

{"s31 1","Coke",12,0,99,"bd 31 "," 20 \"\" \"\" 0 0 0 0 52 53\r"},

{"s32 1","Diet Coke",13,0,99,"bd 32 "," 20 \"\" \"\" 0 0 0 0 54 55\r"},

{"s33 1","Fanta",14,0,99,"bd 33 "," 20 \"\" \"\" 0 0 0 0 56 57\r"},

{"s34 1","Sprite",15,0,99,"bd 34 "," 20 \"\" \"\" 0 0 0 0 58 59\r"}

};

disp_vector display_vector[] = {

{"x42","x57","x58","\" 5 10\rbd 42 598 0 1 \"\" 0 0 62 63\rbd 57 460 1 1 \"\" 0 0 73 74\rxi 72 500 0\rbd 58 550 1 1 \"\" 0 0 75 76\r","\" 515 10\r","32 30"},

{"x43","x59","x60","\" 5 50\rbd 43 598 40 1 \"\" 0 0 62 63\rbd 59 460 41 1 \"\" 0 0 73 74\rxi 72 500 40\rbd 60 550 41 1 \"\" 0 0 75 76\r","\" 515 50\r","330 30"},

{"x44","x61","x62","\" 5 90\rbd 44 598 80 1 \"\" 0 0 62 63\rbd 61 460 81 1 \"\" 0 0 73 74\rxi 72 500 80\rbd 62 550 81 1 \"\" 0 0 75 76\r","\" 515 90\r","32 133"},

{"x45","x63","x64","\" 5 130\rbd 45 598 120 1 \"\" 0 0 62 63\rbd 63 460 121 1 \"\" 0 0 73 74\rxi 72 500 120\rbd 64 550 121 1 \"\" 0 0 75 76\r","\" 515 130\r","330 133"},

{"x46","x65","x66","\" 5 170\rbd 46 598 160 1 \"\" 0 0 62 63\rbd 65 460 161 1 \"\" 0 0 73 74\rxi 72 500 160\rbd 66 550 161 1 \"\" 0 0 75 76\r","\" 515 170\r","32 236"},

{"x47","x67","x68","\" 5 210\rbd 47 598 200 1 \"\" 0 0 62 63\rbd 67 460 201 1 \"\" 0 0 73 74\rxi 72 500 200\rbd 68 550 201 1 \"\" 0 0 75 76\r","\" 515 210\r","330 236"},

{"x48","x69","x70","\" 5 250\rbd 48 598 240 1 \"\" 0 0 62 63\rbd 69 460 241 1 \"\" 0 0 73 74\rxi 72 500 240\rbd 70 550 241 1 \"\" 0 0 75 76\r","\" 515 250\r","32 339"},

{"x49","x71","x72","\" 5 290\rbd 49 598 280 1 \"\" 0 0 62 63\rbd 71 460 281 1 \"\" 0 0 73 74\rxi 72 500 280\rbd 72 550 281 1 \"\" 0 0 75 76\r","\" 515 290\r","330 339"},

{"x50","x73","x74","\" 5 330\rbd 50 598 320 1 \"\" 0 0 62 63\rbd 73 460 321 1 \"\" 0 0 73 74\rxi 72 500 320\rbd 74 550 321 1 \"\" 0 0 75 76\r","\" 515 330\r","32 30"},

{"x51","x75","x76","\" 5 370\rbd 51 598 360 1 \"\" 0 0 62 63\rbd 75 460 361 1 \"\" 0 0 73 74\rxi 72 500 360\rbd 76 550 361 1 \"\" 0 0 75 76\r","\" 515 370\r","32 30"}

};

void main(void) {

char ch[4];

char dis[4];

/* put your own code here */

_asm ssinit: bclr CLKSEL,$80 // Busclock initializations

_asm bset PLLCTL,$40

_asm bclr PLLCTL,$80 // BUsclock is set for 24MHz

_asm bset PLLCTL,$01

_asm movb #$02,SYNR

_asm movb #$00,REFDV

_asm nop

_asm nop

_asm plllp: brclr CRGFLG,$08,plllp

_asm bset CLKSEL,$80

_asm movb #$40,COPCTL

DDRM=0xFF;

_asm bset PTM,#$08

DDRAD=0x00;

rti_cnt=0;

sleep_cnt=0;

sleep_flag=0;

SCI2INT();

SCI1INT();

SCI0INT();

//IICINT();

RTIINT();

OUT_LCD("m 1\r");

/*

for(;;) {

GET_BAT();

ch[0] = ch_count0/10 + '0';

ch[1] = ch_count0%10 + '0';

ch[2] = '\0';

dis[0] = dis_count0/10 + '0';

dis[1] = dis_count0%10 + '0';

dis[2] = '\0';

outc_test(dis);

} */

EnableInterrupts;

for(;;) {

SCI2_ISR();

} /* wait forever */

/* please make sure that you never leave this function */

}

/***************************************************************

Function:IICINT

Input parameters: void

Output Parameters: Void

Description:This has the I2C initializations

***************************************************************/

void IICINT (void) {

IBFD = 0x4C;

IBAD = 0x00;

IBCR = 0x80;

}

/***************************************************************

Function:SCI2INT

Input parameters: void

Output Parameters: Void

Description:This has the SCI 2 initializations

***************************************************************/

void SCI2INT (void)

{

SCI2BDL=0x0D;

SCI2CR2=0x0C;

SCI2CR1=0x00;

SCI2BDH=0x00;

}

/***************************************************************

Function:SCI1INT

Input parameters: void

Output Parameters: Void

Description:This has the SCI 1 initializations

***************************************************************/

void SCI1INT (void) {

SCI1BDL=0x0D;//(unsigned char)((24000000UL /* OSC freq */ / 2) / 9600 /* baud rate */ / 16 /*factor*/); ;

SCI1CR2=0x0C;

SCI1CR1=0x00;

SCI1BDH=0x00;

}

/***************************************************************

Function:SCI0INT

Input parameters: void

Output Parameters: Void

Description:This has the SCI 0 initializations

***************************************************************/

void SCI0INT (void)

{

SCI0BDL=0x9C;

SCI0CR2=0x04;

SCI0CR1=0x00;

SCI0BDH=0x00;

}

/***************************************************************

Function:RTIINT

Input parameters: void

Output Parameters: Void

Description:This has the RTI initializations

***************************************************************/

void RTIINT(void) {

CRGFLG=0x80;

RTICTL=0x1F;

CRGINT=0x80;

_asm cli

}

/***************************************************************

Function:GET_BAT

Input parameters: void

Output Parameters: Void

Description:This function gets the Discharge count and charge count

from the battery and converts it into % and display it to the screen

***************************************************************/

void GET_BAT(void) {

_asm bclr IBCR,#$08 //Enable Transmit Aknowledge

_asm bset IBCR,#$30 //Enable Master Transmit

while (!(IBSR & 0x20));

IBDR = 0b10001110; //Send slave address write

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//outc_test("first");

//while (IBSR & 0x01);

//outc_test("second");

while (!(IBSR & 0x20));

IBDR = 0x04; //Write config the MAX1660 to discharge count

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x00;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x00;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x82; //Discharge count1 and count0 reading

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bset IBCR,#$04

IBDR = 0b10001111;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bclr IBCR,#$10

dis_count0 = IBDR;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

dis_count0 = IBDR;

_asm bset IBCR,#$08

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

_asm bclr IBCR,#$20

dis_count1 = IBDR;

_asm bset IBCR,#$30 //Enable Master Transmit

IBDR = 0x83; //Discharge count3 and count2 reading

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bset IBCR,#$04

IBDR = 0b10001111;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bclr IBCR,#$10

dis_count2 = IBDR;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

dis_count0 = IBDR;

_asm bset IBCR,#$08

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

_asm bclr IBCR,#$20

dis_count3 = IBDR;

/////////////////////////////////////////////////////////////////////

_asm bclr IBCR,#$08 //Enable Transmit Aknowledge

_asm bset IBCR,#$30 //Enable Master Transmit

while (!(IBSR & 0x20));

IBDR = 0b10001110; //Send slave address write

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

while (!(IBSR & 0x20));

IBDR = 0x04; //Write config the MAX1660 to discharge count

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x40;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x00;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

IBDR = 0x82; //Charge count1 and count0 reading

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bset IBCR,#$04

IBDR = 0b10001111;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bclr IBCR,#$10

ch_count0 = IBDR;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

ch_count0 = IBDR;

_asm bset IBCR,#$08

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

_asm bclr IBCR,#$20

ch_count1 = IBDR;

_asm bset IBCR,#$30 //Enable Master Transmit

IBDR = 0x83; //Charge count3 and count2 reading

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bset IBCR,#$04

IBDR = 0b10001111;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

//while (IBSR & 0x01);

_asm bclr IBCR,#$10

ch_count2 = IBDR;

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

dis_count0 = IBDR;

_asm bset IBCR,#$08

while (!(IBSR & 0x02));

_asm bset IBCR,#$02

_asm bclr IBCR,#$20

ch_count3 = IBDR;

////////////////////////////////////////////////////////////////////

}

/***************************************************************

Function:OUT_LCD

Input parameters: char *a

Output Parameters: Void

Description:This function sends data to LCD through SCI2 port

***************************************************************/

void OUT_LCD (char *a)

{

while (*a != '\0')

{

while (!(SCI2SR1 & 0x80));

SCI2DRL = *a++;

}

}

/***************************************************************

Function:outc_test

Input parameters: char *a

Output Parameters: Void

Description:This function displays the text at 0 0 location on touchscreen

***************************************************************/

void outc_test (char *a)

{

OUT_LCD("t \"");

OUT_LCD(a);

OUT_LCD("\" 0 0\r");

}

/***************************************************************

Function:ADD_CART

Input parameters: char *a

Output Parameters: Void

Description:adds the item number in the array order depending on the user input

***************************************************************/

void ADD_CART(char *a)

{

int i=0;

while (i 1){

order_quant[k]--;

total_quant[0]=order_quant[k]+'0';

total_quant[1]='\0';

OUT_LCD("t \"");

OUT_LCD(total_quant);

OUT_LCD(display_vector[k].disp_co2);

}

}

dollar_total = dollar_total + menu[order[k]-1].dollars*order_quant[k];

cent_total = cent_total + menu[order[k]-1].cents*order_quant[k];

k++;

}

if (cent_total > 99) {

dollar_total = dollar_total + cent_total/100;

}

cent_total = cent_total%100;

temp=dollar_total;

if (dollar_total == 0) {

total_text[j++] = '0';

}

while (i > 0) {

if (temp/i>0 || temp2 == 1) {

total_text[j]=temp/i+'0';

temp=temp%i;

j++;

temp2=1;

}

i=i/10;

}

total_text[j++]= '.';

i=100;

temp=cent_total;

if (cent_total == 0) {

total_text[j++] = '0';

total_text[j++] = '0';

}

while (i > 0) {

if (temp/i>0) {

total_text[j++]=temp/i+'0';

temp=temp%i;

}

i=i/10;

}

total_text[j]= '\0';

OUT_LCD("t \"$");

OUT_LCD(total_text);

OUT_LCD("\" 535 450\r");

}

/***************************************************************

Function:DISP_CART

Input parameters: void

Output Parameters: Void

Description:Displays the cart on to the LCD screen using order and order_quant arrays

***************************************************************/

void DISP_CART(void) {

int k=0;

int dollar_total = 0;

int cent_total = 0;

char total_text[10];

char total_quant[5];

int j = 0;

int i =1000;

int temp;

int temp2=0;

OUT_LCD("m 13\r");

while (k 99) {

dollar_total = dollar_total + cent_total/100;

}

cent_total = cent_total%100;

temp=dollar_total;

if (dollar_total == 0) {

total_text[j++] = '0';

}

while (i > 0) {

if (temp/i>0 || temp2 == 1) {

total_text[j]=temp/i+'0';

temp=temp%i;

j++;

temp2=1;

}

i=i/10;

}

total_text[j++]= '.';

i=100;

temp=cent_total;

if (cent_total == 0) {

total_text[j++] = '0';

total_text[j++] = '0';

}

while (i > 0) {

if (temp/i>0) {

total_text[j++]=temp/i+'0';

temp=temp%i;

}

i=i/10;

}

total_text[j]= '\0';

OUT_LCD("t \"$");

OUT_LCD(total_text);

OUT_LCD("\" 535 450\r");

}

/***************************************************************

Function:CLEAR_ORDER

Input parameters: void

Output Parameters: Void

Description:Order is initialized to null when all the ordered items

are sent to the server and confirmation is recieved from the server.

***************************************************************/

void CLEAR_ORDER(void){

int i = 0;

num = 0;

for (i = 0; i rti_cnt) {

__asm NOP

/* __asm WAI; */ /* will be waken up by the RTI exception. Not well supported in BDM mode */

}

}

F-2 Software for the Host system where the order is received:

using System;

using System.Collections.Generic;

using ponentModel;

using System.Data;

using System.mon;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.IO.Ports;

using System.Threading;

using System.Data.SqlClient;

namespace Touch2Order

{

public partial class Form1 : Form

{

// Default Port Settings

SerialPort port = new SerialPort("COM3", 115200, Parity.None, 8, StopBits.One);

public Form1()

{

InitializeComponent();

// Populate the portName comboBox with available ports names

portName.Items.Clear();

foreach (string s in SerialPort.GetPortNames())

{

portName.Items.Add(s);

}

// Load the previous settings into the form

portName.Text = Properties.Settings.Default.portName;

baudRate.Text = Properties.Settings.Default.baudRate.ToString();

parity.Text = Properties.Settings.Default.parity;

dataBits.Text = Properties.Settings.Default.dataBits.ToString();

stopBits.Text = Properties.Settings.Default.stopBits;

}

private void applyButton_Click(object sender, EventArgs e)

{

try

{

if (port.IsOpen == true)

{

port.Close();

}

// Set port name

port.PortName = portName.Text;

// Set Baud Rate

port.BaudRate = Convert.ToInt32(baudRate.Text);

// Set parity

if (parity.Text.Equals("Even"))

{

port.Parity = Parity.Even;

}

else if (parity.Text.Equals("Mark"))

{

port.Parity = Parity.Mark;

}

else if (parity.Text.Equals("None"))

{

port.Parity = Parity.None;

}

else if (parity.Text.Equals("Odd"))

{

port.Parity = Parity.Odd;

}

else if (parity.Text.Equals("Space"))

{

port.Parity = Parity.Space;

}

// Set Data Bits

port.DataBits = Convert.ToInt16(dataBits.Text);

// Set Stop Bits

if (stopBits.Text.Equals("One"))

{

port.StopBits = StopBits.One;

}

else if (stopBits.Text.Equals("Two"))

{

port.StopBits = StopBits.Two;

}

if (port.IsOpen == false)

{

port.Open();

}

}

catch (Exception ex)

{

// If any exceptions, display a MessageBox

MessageBox.Show(ex.Message);

}

}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)

{

// Save the port settings before closing

Properties.Settings.Default.portName = port.PortName;

Properties.Settings.Default.baudRate = port.BaudRate;

Properties.Settings.Default.parity = port.Parity.ToString();

Properties.Settings.Default.dataBits = port.DataBits;

Properties.Settings.Default.stopBits = port.StopBits.ToString();

port.Close();

}

private void Form1_Load(object sender, EventArgs e)

{

// When form loads, initiate all the table adapters

this.menuTableAdapter1.Fill(projectDataSet1.Menu);

this.rfiD_tagsTableAdapter1.Fill(projectDataSet1.RFID_tags);

// Run the recieve function in the background not to hang up the main

// window

Thread recieve_input = new Thread(new ThreadStart(this.recieve));

recieve_input.IsBackground = true;

recieve_input.Start();

}

private void send(string send_data)

{

// Sends the data to the port

port.Write(send_data);

}

private void recieve()

{

// Recieves the data from the port

try

{

port.DataReceived += new SerialDataReceivedEventHandler(port_DataReceived);

port.Open();

Application.Run();

}

catch (Exception ex)

{

// If any exceptions, display a MessageBox

MessageBox.Show(ex.Message);

}

}

private double total(string order)

{

// Calculate the total for the order and return

double tot = 0;

int i = 0;

int j = 1;

// Splits the order array into order items and quantity

// to calculate the total for the order

string[] orderArray = order.Split(new char[] { ':', ',' });

for (int k = 1; k = 0)

{

SetBalance(bal.ToString());

}

string first = projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[3].ToString();

string last = projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[4].ToString();

if (bal >= 0)

{

// The outData starts with 1 implying that the RFID tag read

// is valid and sufficient funds are available in the account

outData = "[1>" + first + " " + last + ">" + bal.ToString() + "]";

DisplayOrder(inDataArray[2], inDataArray[3], "1");

}

else

{

// The outData starts with 2 implying that the RFID tag read

// is valid and sufficient funds are not available in the account

outData = "[2>" + first + " " + last + ">" + projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[1].ToString() + "]"; ;

}

}

else

{

// The outData starts with 5 implying that the RFID tag

// that is read is invalid.

outData = "[0]";

}

send(outData);

}

else if (inDataArray[0].Equals("2"))

{

outData = "";

DisplayOrder(inDataArray[2], inDataArray[3], inDataArray[0]);

// The outData starts with 3 indicating that the order has been

// placed and it can be paid for using Cash/Credit

outData = "[3]";

send(outData);

}

else if (inDataArray[0].StartsWith("["))

{

send("[Srichand]");

}

}

catch (Exception ex)

{

// When an Exception is cought, error message is displayed.

MessageBox.Show(ex.Message);

send("[0]");

}

}

private void menuSaveButton_Click(object sender, EventArgs e)

{

// Saves the menu items and the numbers into the database.

menuBindingSource.EndEdit();

menuTableAdapter1.Update(projectDataSet1.Menu);

}

private void rfidSaveButton_Click(object sender, EventArgs e)

{

// Saves the RFID tags and the names into the database.

rfidBindingSource.EndEdit();

rfiD_tagsTableAdapter1.Update(projectDataSet1.RFID_tags);

}

private void clearButton_Click(object sender, EventArgs e)

{

// Clears the textbox

displayTextBox.Clear();

}

}

}

F-3 Software for the Touchscreen LCD:

//---------------------------------------------------------------------

//---------------------------------------------------------------------

// Macros.mac

// Macros for the Touch 2 Order system navigation

// ECE 477 - Team 13

// Last Updated Date: 03/31/2008

//---------------------------------------------------------------------

//---------------------------------------------------------------------

//---------------------------------------------------------------------

// MACRO #1

// Draws a welcome screen for the system. When the screen is touched,

// it navigates to macro 2.

//---------------------------------------------------------------------

#define welcome_screen 1 /*

baud 115200

xbl on

s 0 1

z

bv 150

xi 6 0 0

w 1000

xs 128 0 0 639 479 // Create an invisible hotspot

xm 128 2 // Go to macro 2 when touched

f m16

w 1000

t "Touch screen to order" 250 450

w 1000

t "Touch screen to order." 250 450

w 1000

t "Touch screen to order.." 250 450

w 1000

t "Touch screen to order..." 250 450

w 1000

t "Touch screen to order...." 250 450

#end

//---------------------------------------------------------------------

// MACRO #2

// Draws a menu select screen for the system. When button 0 is touched,

// it navigates to macro 3 and when button 1 is touched, it navigates

// to macro 4.

//---------------------------------------------------------------------

#define menu_select 2 /*

s 0 1

z

bd 0 66 50 4 "" 0 0 7 8

xm 0 2 3

bd 1 66 251 4 "" 0 0 9 10

xm 1 2 4

#end

//---------------------------------------------------------------------

// MACRO #3

// Displays the options for the full menu.

//---------------------------------------------------------------------

#define full_menu 3 /*

s 0 1

z

bd 4 66 50 4 "" 0 0 11 12

xm 4 3 5

bd 5 66 251 4 "" 0 0 13 14

xm 5 3 6

bd 2 0 430 4 "" 0 0 19 20

xm 2 3 2

#end

//---------------------------------------------------------------------

// MACRO #4

// Displays the options for the custom menu.

//---------------------------------------------------------------------

#define custom_menu 4 /*

s 0 1

z

xi 29 0 0

bd 3 0 430 4 "" 0 0 19 20

xm 3 4 2

#end

//---------------------------------------------------------------------

// MACRO #5

// Displays the options for the Breakfast menu.

//---------------------------------------------------------------------

#define breakfast_menu 5 /*

s 0 1

z

bd 8 66 50 4 "" 0 0 15 16

xm 8 5 7

bd 9 66 251 4 "" 0 0 17 18

xm 9 5 8

bd 6 0 430 4 "" 0 0 19 20

xm 6 5 3

#end

//---------------------------------------------------------------------

// MACRO #6

// Displays the options for the Lunch/Dinner menu.

//---------------------------------------------------------------------

#define lunch_dinner_menu 6 /*

s 0 1

z

bd 12 34 50 4 "" 0 0 21 22

xm 12 6 9

bd 13 330 50 4 "" 0 0 23 24

xm 13 6 10

bd 14 34 251 4 "" 0 0 25 26

xm 14 6 11

bd 15 330 251 4 "" 0 0 27 28

xm 15 6 12

bd 7 0 430 4 "" 0 0 19 20

xm 7 6 3

#end

//---------------------------------------------------------------------

// MACRO #7

// Displays the options for the Breakfast-Food menu.

//---------------------------------------------------------------------

#define breakfast_food_menu 7 /*

s 0 1

z

bd 20 32 30 20 "" "" 0 0 0 0 30 31

bd 21 330 30 20 "" "" 0 0 0 0 32 33

bd 22 32 133 20 "" "" 0 0 0 0 34 35

bd 23 330 133 20 "" "" 0 0 0 0 36 37

bd 24 32 236 20 "" "" 0 0 0 0 38 39

bd 25 330 236 20 "" "" 0 0 0 0 40 41

bd 26 32 339 20 "" "" 0 0 0 0 42 43

bd 10 0 430 4 "" 0 0 19 20

xm 10 7 5

bd 36 398 430 4 "" 0 0 60 61

xm 36 7 13

#end

//---------------------------------------------------------------------

// MACRO #8

// Displays the options for the Breakfast-Beverages menu.

//---------------------------------------------------------------------

#define breakfast_beverages_menu 8 /*

s 0 1

z

bd 27 32 30 20 "" "" 0 0 0 0 44 45

bd 28 330 30 20 "" "" 0 0 0 0 46 47

bd 29 32 133 20 "" "" 0 0 0 0 48 49

bd 30 330 133 20 "" "" 0 0 0 0 50 51

bd 31 32 236 20 "" "" 0 0 0 0 52 53

bd 32 330 236 20 "" "" 0 0 0 0 54 55

bd 33 32 339 20 "" "" 0 0 0 0 56 57

bd 34 330 339 20 "" "" 0 0 0 0 58 59

bd 11 0 430 4 "" 0 0 19 20

xm 11 8 5

bd 37 398 430 4 "" 0 0 60 61

xm 37 8 14

#end

//---------------------------------------------------------------------

// MACRO #9

// Displays the Starters/Soups menu for Lunch/Dinner.

//---------------------------------------------------------------------

#define lunch_starters_menu 9 /*

s 0 1

z

sc 0 0

f m24

t "Lunch>Starters/Soups Menu:"

bd 16 0 430 4 "" 0 0 19 20

xm 16 9 6

bd 38 398 430 4 "" 0 0 60 61

xm 38 9 15

#end

//---------------------------------------------------------------------

// MACRO #10

// Displays the Sandwiches menu for Lunch/Dinner.

//---------------------------------------------------------------------

#define lunch_sandwich_menu 10 /*

s 0 1

z

sc 0 0

f m24

t "Lunch>Sandwiches Menu:"

bd 17 0 430 4 "" 0 0 19 20

xm 17 10 6

bd 39 398 430 4 "" 0 0 60 61

xm 39 10 16

#end

//---------------------------------------------------------------------

// MACRO #11

// Displays the Desserts menu for Lunch/Dinner.

//---------------------------------------------------------------------

#define lunch_desserts_menu 11 /*

s 0 1

z

sc 0 0

f m24

t "Lunch>Desserts Menu:"

bd 18 0 430 4 "" 0 0 19 20

xm 18 11 6

bd 40 398 430 4 "" 0 0 60 61

xm 40 11 17

#end

//---------------------------------------------------------------------

// MACRO #12

// Displays the Beverages menu for Lunch/Dinner.

//---------------------------------------------------------------------

#define lunch_beverages_menu 12 /*

s 0 1

z

bd 27 32 30 20 "" "" 0 0 0 0 44 45

bd 28 330 30 20 "" "" 0 0 0 0 46 47

bd 29 32 133 20 "" "" 0 0 0 0 48 49

bd 30 330 133 20 "" "" 0 0 0 0 50 51

bd 31 32 236 20 "" "" 0 0 0 0 52 53

bd 32 330 236 20 "" "" 0 0 0 0 54 55

bd 33 32 339 20 "" "" 0 0 0 0 56 57

bd 34 330 339 20 "" "" 0 0 0 0 58 59

bd 19 0 430 4 "" 0 0 19 20

xm 19 12 6

bd 41 398 430 4 "" 0 0 60 61

xm 41 12 18

#end

//---------------------------------------------------------------------

// MACRO #13

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart1 13 /*

s 0 1

z

f m14

bd 35 0 430 4 "" 0 0 19 20

xm 35 13 7

bd 52 146 430 4 "" 0 0 64 65

xm 52 13 19

#end

//---------------------------------------------------------------------

// MACRO #14

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart2 14 /*

s 0 1

z

f m14

bd 53 0 430 4 "" 0 0 19 20

xm 53 14 8

bd 52 146 430 4 "" 0 0 64 65

xm 52 14 19

#end

//---------------------------------------------------------------------

// MACRO #15

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart3 15 /*

s 0 1

z

f m14

bd 55 0 430 4 "" 0 0 19 20

xm 55 15 9

bd 52 146 430 4 "" 0 0 64 65

xm 52 15 19

#end

//---------------------------------------------------------------------

// MACRO #16

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart4 16 /*

s 0 1

z

f m14

bd 56 0 430 4 "" 0 0 19 20

xm 56 16 10

bd 52 146 430 4 "" 0 0 64 65

xm 52 16 19

#end

//---------------------------------------------------------------------

// MACRO #17

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart5 17 /*

s 0 1

z

f m14

bd 57 0 430 4 "" 0 0 19 20

xm 57 17 11

bd 52 146 430 4 "" 0 0 64 65

xm 52 17 19

#end

//---------------------------------------------------------------------

// MACRO #18

// Displays a blank screen for the cart items to be displayed.

//---------------------------------------------------------------------

#define display_cart6 18 /*

s 0 1

z

f m14

bd 58 0 430 4 "" 0 0 19 20

xm 58 18 12

bd 52 146 430 4 "" 0 0 64 65

xm 52 18 19

#end

//---------------------------------------------------------------------

// MACRO #19

// Displays the check-out screen with pay options.

//---------------------------------------------------------------------

#define checkout_screen 19 /*

s 0 1

z

f m14

bd 60 157 75 4 "" 0 0 68 69

xm 60 19 21

bd 61 157 200 4 "" 0 0 70 71

bd 59 0 432 4 "" 0 0 66 67

xm 59 19 2

#end

//---------------------------------------------------------------------

// MACRO #20

// Macro for the Sleep mode.

//---------------------------------------------------------------------

#define sleep_screen 20 /*

s 0 1

z

xbl off

xs 129 0 0 639 479

xm 129 1

#end

//---------------------------------------------------------------------

// MACRO #21

// Displays a wait screen for RFID input.

//---------------------------------------------------------------------

#define wait_screen 21 /*

s 0 1

z

xi 29 0 0

bd 62 0 430 4 "" 0 0 19 20

xm 62 21 19

#end

Appendix G: FMECA Worksheet

|Failure No. |Failure Mode |Possible Cause |Failure Effects |Method of Detection |Criticality |Remarks |

|A1 |Output = 0V |Caused by a failure of any component |Total Device Failure |Observation |Low | |

| | |within functional block or external short| | | | |

|A2 |Output > 3.3 V |Failure of a MAX 1651 |Potential damage to XBee Pro, |Observation |Low | |

| | | |Microcontroller | | | |

|A3 |Output > 5V |Failure of MAX 1649 |Potential damage to RFID reader |Observation |Low | |

|A4 |Output out of tolerance |Failure of MAX 1649, 1651 or passive |Out of spec operating voltage; |Observation |High | |

| | |components such as capacitors |unpredictable | | | |

Table G-1 FEMCA Worksheet for Power Supply Circuit

|Failure No. |Failure Mode |Possible Cause |Failure Effects |Method of Detection |Criticality |Remarks |

|B1 |Data not retrieved from RFID|Failure of microcontroller |Data cannot be sent to the |Observation |Low | |

| |reader |or error in software |micro from the RFID reader | | | |

|B2 |Blank LCD screen |Failure of microcontroller |Data cannot be sent to the LCD|Observation |Low | |

| | |or error in software |screen | | | |

|B3 |No connection with the |Failure of microcontroller |Communication error with the |Observation |Low | |

| |kitchen server |or error in software |server | | | |

Table G-2 FMECA Worksheet for Microcontroller

|Failure No. |Failure Mode |Possible Cause |Failure Effects |Method of Detection |Criticality |Remarks |

|C1 |Battery Level not |Failure of MAX 1660 |Error in detecting the |Observation |Low | |

| |detected correctly | |charge level of batteries | | | |

|C2 |Batteries not charging |Failure of MAX 712 and |Device would not work |Observation |Low | |

| | |MAX 1660 or dead |without external power | | | |

| | |batteries |supply | | | |

|C3 |Batteries excessively |Failure of MAX 712 or MAX|Batteries may leak or |Observation |High |Sometimes may cause |

| |charged |1660 |explode | | |damage to other |

| | | | | | |components |

Table G-3 FMECA Worksheet for Battery Circuit

-----------------------

Battery Pack 12V Output

Battery Charger Circuit

24V @ 500mA Walwart input

Linear Regulator 5V and 3.3V Output

Battery Monitor Circuit

5.0V

3.3V

2 I2C

3 GPIO

Freescale Microcontroller (MC9S12E128)

3.3V

ZigBee Wireless Interface

(XBee Pro)

2 SCI

4 GPIO

RFID Reader (Sparkfun ID-12)

1 SCI

5.0V

Graphic Controller (Reach Technologies)

2 SCI

3.3V

LCD Screen (NEC 8.4”)

4

3.3V

Touch Screen Panel

2

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download