ee 477 final report - purdue university · web viewappendix g: fmeca worksheet ? abstract as a part...
TRANSCRIPT
ECE 477 Final Report Spring 2008Team 13 Touch 2 Order
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 PTSTechnical content 0 1 2 3 4 5 6 7 8 9 10 3Design documentation 0 1 2 3 4 5 6 7 8 9 10 3Technical writing style 0 1 2 3 4 5 6 7 8 9 10 2Contributions 0 1 2 3 4 5 6 7 8 9 10 1Editing 0 1 2 3 4 5 6 7 8 9 10 1Comments: TOTAL
ECE 477 Final Report Spring 2008
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 ?
-ii-
ECE 477 Final Report Spring 2008
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.0 Project Overview and Block DiagramThe ‘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.
A-1
ECE 477 Final Report Spring 2008
Figure 1.1 Overall Block Diagram for the ‘Touch 2 Order’
A-2
24V @ 500mA Walwart input
Battery Charger Circuit
Battery Pack 12V Output
Linear Regulator 5V and 3.3V
Output
Battery Monitor Circuit 5.0V 3.3V
2 I2C3 GPIO
Freescale Microcontroller (MC9S12E128)
3.3VZigBee Wireless
Interface(XBee Pro)
2 SCI4 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
ECE 477 Final Report Spring 2008
Figure 1.2 The ‘Touch 2 Order’
2.0 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.
A-3
ECE 477 Final Report Spring 2008
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.
3.0 Constraint Analysis and Component Selection
3.1.0 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.
3.2.0 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.
A-4
ECE 477 Final Report Spring 2008
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.3.0 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.
3.4.0 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)
TIM (1)
42-0105-01(Reach
Technologies)
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
A-5
ECE 477 Final Report Spring 2008
Table 3.4.1 On-Chip Peripheral Requirements
3.5.0 Off-Chip Peripheral Requirements
The Touch 2 order system has no off-chip peripherals.
3.6.0 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
3.7.0 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
A-6
ECE 477 Final Report Spring 2008
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.
3.8.0 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.
3.9.0 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:
A-7
ECE 477 Final Report Spring 2008
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.
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.
In selecting the ZigBee module range is given more importance. So, XBee Pro is selected as the
ZigBee Transceiver [10].
A-8
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
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
ECE 477 Final Report Spring 2008
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
A-9
ECE 477 Final Report Spring 2008
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
4.0 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.
4.2.0 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:
2.1 Portable point of sale terminal (US Patent #: 5408077) [1];
2.2 Apparatus for order entry in a restaurant (US Patent #: 5003472) [2]; and
A-10
ECE 477 Final Report Spring 2008
2.3 Customer self-ordering system using information displayed on a screen
(US Patent #: 5235509) [3].
4.2.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
4.3.0 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.4.0 Customer self-ordering system using information displayed on a screen
(US Patent #: 5235509)
Filing Date: 11/15/1989
A-11
ECE 477 Final Report Spring 2008
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
4.5.0 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.
4.5.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
A-12
ECE 477 Final Report Spring 2008
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.
4.5.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.
4.6.0 Action Recommended
4.6.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
A-13
ECE 477 Final Report Spring 2008
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.
4.6.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.
4.6.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.
5.0 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
A-14
ECE 477 Final Report Spring 2008
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.
5.1.0 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 [1]. From the data
sheet of the microcontroller it was found out that the average junction temperature T J 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 = 2. From the class B-1 category the quality
factor was found out to be 2 and the learning factor was taken as 1. For microcircuits the
temperature factor = 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 C2 p
(Failures/106
hours)
MTTF
(years)
Microcontroller 0.28 0.032 2 2 1 7 4.048 676.7
Table 5.1.0 Calculation of p and MTTF for Microcontroller
A-15
ECE 477 Final Report Spring 2008
Similarly the formula used for the microcontroller can also be used for the MAX 1660
(battery monitor) and MAX 1651 (3.3 V DC-DC voltage regulator) as they can also be
considered as MOS devices [3], [4]. Since the datasheets of these components didn’t have
enough information on the average junction temperature, it was assumed as 85oC which was just
above the maximum operating temperature. Also assuming the similar factors for these two
components as the microcontroller the learning factor , quality factor , temperature factor
and environment factor were found from the military handbook as 1, 2, 0.98, and 2
respectively [1]. For MOS devices with No. of Gates ranging from 1-100, the die complexity
failure rate, C1 = 0.0025. The only value that is different for these two components is the package
failure rate C2 since they differ in the No. of pins. The No. of pins for MAX 1660 and MAX 1651
are 16, 8 respectively which give a value of C2 = 0.0056 for the former and C2 = 0.0026 for the
later [1], [3], [4]. So computing all the values and calculating the number of failures per 106
hours and MTTF gave the following results. For MAX 1660 p = 0.0273 failures / 106 hours and
MTTF = 36.6e6 and for MAX 1651 p = 0.0153 failures / 106 hours and MTTF = 65.359e6.
Component C1 C2 p
(Failures/106
hours)
MTTF
(years)
MAX 1660 0.0025 0.0056 2 2 0.98 1 0.0273 100.273e3
MAX 1651 0.0025 0.0026 2 2 0.98 1 0.0153 179.065e3
Figure 5.1.1 Calculation of p and MTTF
By observing the above calculated values for the three components it is known that the rate
of failure is very less. So there may not be any major changes in the design or analysis
refinements that may realistically improve the reliability of the design. Since the major cause is
the operating temperature which may gradually increase the rate of failure modifications can be
made to control the temperature of these components so that it wouldn’t reach the junction
temperature. One of those considerations may be implementing fan to allow heat dissipation of
the devices.
A-16
ECE 477 Final Report Spring 2008
5.2.0 Failure Mode, Effects, and Criticality Analysis (FMECA)
The ‘Touch 2 Order’ device has 3 main functional blocks. They are the power supply circuit,
microcontroller and the battery charger and monitor circuit. Each block has its share of failure
modes, effects and criticality levels. The criticality levels for our design are high if there is any
injury involved to the user with a rate of p 10-9 and low if it involves any damage to
components, inconvenience to the user and any signal loss with a failure rate 10-9 < p < 10-3.
5.2.1 Power Supply Circuit
As shown in Appendix A the functional block of the power supply circuit consists of the DC-
DC voltage regulators MAX 1649 and MAX 1651 which give an output of 5 V and 3.3 V
respectively [3], [4]. There are four failure modes in this functional block that may occur. One of
which is that there is no output voltage which can be caused by the failure of a certain
component of the device or due to an external short. In this kind of failure mode it may lead to a
total device failure. This is a low critical failure mode as there is no injury to the user. The other
failure modes that may occur are the output voltage crossing the values of 3.3 V and 5 V. Since
the Microcontroller, XBee Pro Wireless transceiver and the LCD work with an operating voltage
of 3.3 V. A voltage increase for these components may lead to the damage of the respective
components. A possible cause may be the failure of MAX 1651 which generates the output
voltage of 3.3 V. Similarly a failure of MAX 1649 may lead to an output voltage more than 5 V
causing damage to the RFID reader. These are very less critical as only damage of components is
involved. Sometimes the output voltage may go out of tolerance when there is a failure in the
DC-DC voltage or regulators or a short in the bypass capacitors for which the effects may be
unpredictable. This is critically high as it may produce excessive heat dissipation causing
potential for injury to the user. All the above failure modes are observable from the operation of
the device.
5.2.2 Microcontroller
Another functional block shown in Appendix A is the microcontroller which involves minor
failure modes where the communication with the components connected to it would be lost. So
there are three major components connected to the microcontroller, the XBee Pro wireless
transceiver, LCD touch screen and the RFID reader. So the failure modes are connection lost
A-17
ECE 477 Final Report Spring 2008
with the host server, blank LCD screen and data not being retrieved from the RFID reader. The
possible cause for these failures may be a damage caused to the microcontroller or an error in the
software involving the respective components. So there would be no transfer from the
microcontroller to the respective components. These failures may be detected by mere
observation and are critically low.
5.2.3 Battery Circuit
The final important functional block of the ‘T2O’ is the battery charger and monitor circuit.
Three modes of failure were detected in this functional block which includes MAX 712 the chip
for battery charging circuit and MAX 1660 the chip for battery monitoring circuit. One of the
failure modes is that the charge level in the battery is not detected correctly which is caused by a
failure in MAX 1660. Another failure mode is that the batteries might not get charged caused by
a failure of MAX 712 or MAX 1660 or due to dead batteries. When this happens the device
cannot work without the external power supply. The above two failure modes are critically low.
But the final mode of failure is critically high which has a potential for causing injury to the user.
Sometimes a failure in the MAX 712 or MAX 1660 may cause overcharge in batteries leading to
leakage or explosion in the batteries which is dangerous. It not only causes damage to the user
but also to all other components of the device.
6.0 Ethical and Environmental Impact Analysis
Many ethical and environmental challenges arise while designing, manufacturing, during
usage and disposal of this kind of a device. Ethically the device should ensure security to the user
and also instructions and cautions regarding the usage should be thoroughly provided. Since the
device deals with RFID tags security should always be prime concern ethically. Environmentally
many issues arise right from manufacturing stage to the device disposal. Recycling issues with
the components such as batteries, LCD screen and the PCB should be well considered as these
components are toxic and may release chemicals if not disposed in a proper way.
6.1.0 Ethical Impact Analysis
A device such as the ‘Touch 2 Order’ requires a quite a lot of ethical issues to be considered
since the device incorporates a RFID reader and a Zig Bee wireless interface. Therefore many
A-18
ECE 477 Final Report Spring 2008
security and privacy issues are associated with it which is needed to be considered in the design.
Other ethical challenges include testing the device under different temperatures and placement of
warning labels etc. Since the ‘T2O’ incorporates rechargeable batteries providing sufficient
cautionary information regarding this should also be considered.
First and foremost security and privacy issues, with the use of RFID readers there is always a
possibility of information of the RFID card being leaked out. Since there is an option in the
‘T2O’ where the user can create his choice of customizable menu, such information should be
password protected. So the coding should be done appropriately that the user can only see his
customized menu. This information cannot be retrieved from the database. One can only access it
by using the specific RFID card. So customized menu can be only displayed at the database
when the user finishes his order thereby keeping the user choices private. Using a wireless
interface always gives scope for hacking. Since the wireless interface here is a Zig Bee which is
a rare one; eliminates a lot of security issues since the hacker also needs a Zig Bee receiver to
retrieve the order sent from the transmitter built-in the device. Also, it will be password
protected. So to access the information being received from the transmitter the host server
requires a special password keeping the information secure.
Next for the device to ensure proper working for a long span of life time, it should be tested
under various operating conditions. After the PCB is populated and whole circuit built up, the
device is tested under different operating temperatures to check its performance. So ethically it
would be important to publish all the tests performed on the device in the user manual so that the
customers buying this product would be aware of these facts and can trust the product and
purchase it.
Finally safety issues form the major part of the ethical impact analysis. Since the device uses
rechargeable batteries, it may lead to many serious damages such as leakage or explosion if not
used properly. So safety measures are a top priority in this case. Enough guidelines should be
posted on the user manual regarding the usage and time to change the old batteries. So user
should be provided with the information regarding how many charging cycles usually the
batteries can handle and after how many days is it good to change the old batteries. It is also a
good idea to provide guidelines on what to do and what not do in cases of battery leakage or
explosion.
A-19
ECE 477 Final Report Spring 2008
6.2.0 Environmental Impact Analysis
Manufacture, normal use and disposal/recycling are three different stages where issues
regarding environmental impact arise. So it is necessary that changes should be made
accordingly in the design to overcome those aspects and to environment friendly and also
providing enough information for the user regarding proper usage and disposal.
6.2.1 Manufacturing Stage
During manufacture stage the main environmental impact issue that the manufacturer of
every product should be considering is the fabrication of PCB with lead. Care should be taken
while making the PCB by using RoHS compliant materials. RoHS is often referred as lead-free
directive [2]. Substitutes such as tin and silver should be considered instead of lead which may
reduce its negative impact on the environment. Also the packaging which is a part of the
manufacturing process has its share of impact on the environment. Materials such as plastic or
aluminum should be considered. Companies such as PCBexpress.com and Trianglecircuits.com
manufacture RoHS compliant PCBs.
6.2.2 Normal Usage
The normal usage of ‘Touch 2 Order’ has the least impact on environment as it doesn’t emit
any harmful radiation or excessive heat dissipation. The only problem arises when there is a
leakage or explosion in battery. A cause for this may be a high operating temperature at which
the batteries cannot withstand and a leakage is possible. So at such times the batteries should be
immediately replaced with new batteries. Here the disposal of the leakage batteries is an
environmental issue. It is better to clean or rinse before throwing away the batteries as the
chemicals are harmful for the environment [1]. Guidelines regarding disposal of leakage batteries
are to be made available to the user. Also information for proper charging and storage of the
product should be provided in the user manual. It is always good to store the device at room
temperature to avoid damage to components and batteries.
6.2.3 Disposal / Recycling
Disposal and recycling are major concerns for every device which consists of components
that release chemicals and toxics which are not at all eco-friendly. So it should be disposed in
A-20
ECE 477 Final Report Spring 2008
such a way that it doesn’t affect the environment. The ‘T2O’ consists of an LCD screen, batteries
and components such as wireless transceiver and RFID reader which may potentially release
chemicals if not disposed properly. So it is always a good way to return the part to the
manufacturer who will be able to make good use of it by recycling or reusing it. There are some
companies which recycle almost all the electrical components such computer monitors and other
parts etc. So it is always a good choice to contact such companies at the time of recycyle. One
such company is the DMC recycling company which widely encourages recycling of electrical
components. Guidelines for disposal of such toxic components are given in EHS (Environmental
Health & Safety) website [3]. There are also some batteries recycling services such as Battery
Solutions Inc [4] which recycle wide range of batteries from rechargeable AA batteries used in
the ‘T2O’ to heavy batteries used in cars and machinery. All these instructions and guideline
must be made available to the user by giving the information in the user manual or labeling the
device.
7.0 Packaging Design Considerations
The T2O system should be tough for everyday use. The cost of packaging should be as low
as possible to keep the overall price of the product as low as possible. So the main constraints
that were considered in packaging were size, durability, portability, heat dissipation and cost. To
keep the front side of the packaged system as neat as possible, it was planned to only put the
RFID card reader on the front side in addition to the touch screen.
7.1.0 Commercial Product Packaging
The two commercial products we want to compare with our ‘Touch 2 Order’ device are
Microworks POS Solutions Inc. Tableside POS and the IBM Sure POS 700 Series [1], [2].
7.1.1 Product #1
This Wireless Tableside Ordering device is powered by Microsoft Windows XP and the
standard 802.11 wireless technology [1]. It is a very slim, sleek and a stylish device. It has a
screen size is 7 inches diagonally with an 800 by 600 pixel VGA resolution. The touch screen
can be used by a stylus touch pen. This device is manufactured keeping the servers in mind and
not for customer use. Servers can quickly enter an order right at tableside and send that
A-21
ECE 477 Final Report Spring 2008
information to the bar or the kitchen by touch-screen or stylus. All information entered on our
handheld device is processed in exactly the same way as a fixed POS station. It includes the
ability to create new orders, update existing orders and check the status of any order.
Figure 2.1.1 Microworks POS Solutions Inc. Tableside Wireless System
The packaging of the device is very trendy. It is designed to be compact, light weight and
also powerful at the same time. The outer part is a metallic enclosure. It also consists of buttons
for navigation on the right side and power on/off button on the left side of the device. It has two
LED’s on the left to indicate power on/off and for low battery.
The main positive aspect of this device is its portability. It is very light weighing about 200-
250 grams. It also contains a battery which is rechargeable. So it is not required to be connected
to voltage source all the while. Its operating system is also a huge advantage which is Windows
OS making the GUI (Graphical User Interface) user friendly. Since it uses the regular 802.11
wireless interface it can easily be connected to any wireless router in the network and there by
connected to the server where the order from this device is received at the other end.
The negative aspect of the packaging is the device is pretty delicate. So it may not be able to
withstand harsh usage and may get damaged if fallen on a hard surface. Since it is for the servers
in the restaurant it may be easy to use but if the customer is required to use he may find it
difficult using it for the first time. The LCD screen is small so the clicks from the stylus should
A-22
ECE 477 Final Report Spring 2008
be properly pin pointed, otherwise there may be wrong orders. One more constraint of this
device is it doesn’t have an RFID card reader thereby not allowing it to pay the bills from the
device. Although we could adapt some features from the packaging of this device to make the
‘Touch 2 Order’ as compact as it can get.
7.1.2 Product #2
The IBM Sure POS 700 is the industry’s premier point of sale solution for retailers who
demand adaptability and performance [2]. It empowers the restaurant owners to manage their
store environments more competitively. It is designed so that it maximizes uptime and helps
reduce maintenance costs with virtually tool-free design, secure and easy front access and
exceptional serviceability. It runs with an Intel Core 2 Duo Processor.
Its packaging quite hefty as it is very high powered and has many features. It consists of a
touch screen monitor attached to the CPU of the system and on the left side it has the card reader.
Internally packaged are the processor, 80 GB hard disk, an optical drive which reads both CD’s
and DVD’s. On the back side of the CPU are the expansion ports for PCI , secondary hard disk
drive, floppy disk drive, USB and RS-232 ports, Ethernet socket, Video and Audio outputs and a
headphone jack. It also has extra external peripheral options for printers, keyboards and cash
drawers.
Figure 2.2.1 IBM Sure POS 700 Series
A-23
ECE 477 Final Report Spring 2008
As this product is designed mainly for the benefit of the restaurant owner than the customer
it is quite heavily packed. It weighs around 13.2 Kg. Its dimensions are Narrow: 320 x 475 x
117.3 mm and Wide: 435 x 475 x 117.3 mm. It is designed so that it can withstand any harsh
usage.
The positive aspects are it is highly powered and has so many features, some necessary and
others not. This is ideal if you really need such a high performance speeds at work. Its cable arm
facilitates access to all connectors from the front of the unit. It has built in power management
and uses recycled plastics for the outer enclosure making it environmentally friendly. It has
numerous selectable and upgradable ports on the back of the system enabling the user to use the
existing devices and add new devices for meeting the ever changing business needs.
The main negative aspect of this product is its portability. It is not mobile and cannot be
transported easily. It is also very costly. A single product costs around 3000$. It does not have
wireless capability which is a main feature in our ‘Touch 2 Order’. There are no aspects in this
product which we could adapt for our device since the ‘Touch 2 Order’ is a portable and cost
effective device which also promises reasonable system performance.
7.2.0 Project Packaging Specifications
As mentioned in the above sections, the main packaging constraints that were considered
were the size, durability, portability, heat dissipation and cost. The only two human interfaces
that are there in the system are the touch screen and the RFID card reader. So the touch screen
and the RFID card reader are the only peripherals that are being put on the front side of the
system as shown in the CAD drawings in Appendix A.
The estimated size of the box for packaging the system is 226mm x 157mm x 47mm. That is
about the size of a portable DVD player with screen. The thickness of the packaged product will
be about the thickness of a regular laptop. Since this is going to be used by the customers at the
restaurant, it should be convenient for them to handle it and yet tough enough so as not to break
or crack easily.
Internally the parts are packaged in such a way that there is enough space (to reduce heat)
between the graphic controller and the PCB of the system. The graphic controller is packaged
right underneath the LCD screen and the PCD mounted with Zig Bee transceiver is placed under
the graphic controller with some space in between. The RFID card reader is mounted to the top
A-24
ECE 477 Final Report Spring 2008
of the box, so it is easy for the reader to detect any card that is placed nearby to the top of the
box.
The T2O team has decided to use a plastic enclosure for packaging the system. For the
enclosure, two materials were considered – plastic and aluminum. We chose plastic over
aluminum as there may be effects of shielding for the RFID reader and the wireless transceiver.
The system directly plugs into the wall for power.
7.3.0 PCB Footprint Layout
Several components are needed to be placed on the PCB. They are the Freescale
MC9S12E128 microcontroller, the voltage regulator and DC – DC converters, the ZigBee
wireless module and headers for graphic controller, RFID card reader and the general purpose
I/O’s [4], [5], [7], [6]. The following table shows the area each part occupies on the PCB.
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.
8.0
Schematic Design Considerations
A-25
Part Area (in2)Freescale MC9S12E128 1.00Maxstream XBee ZigBee Transceiver 1.24Voltage Regulator and DC – DC converters 0.5
Headers 3.00Total Area: 5.74
ECE 477 Final Report Spring 2008
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.
8.1.0 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.
8.1.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.
A-26
ECE 477 Final Report Spring 2008
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.
8.2.0 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.
8.2.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.
8.2.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.
A-27
ECE 477 Final Report Spring 2008
8.2.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.
8.3.0 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].
A-28
ECE 477 Final Report Spring 2008
9.0 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.
9.1.0 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
A-29
ECE 477 Final Report Spring 2008
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.
9.2.0 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.
Figure 9.2.1 Placement of the Decoupling capacitors with respect to the microcontroller
A-30
ECE 477 Final Report Spring 2008
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.
9.3.0 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.
A-31
ECE 477 Final Report Spring 2008
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.
10.0 Software Design Considerations
10.1.0 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.
10.2.0 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
A-32
ECE 477 Final Report Spring 2008
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.
10.3.0 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:
A-33
ECE 477 Final Report Spring 2008
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.
A-34
ECE 477 Final Report Spring 2008
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
10.5.0 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
A-35
ECE 477 Final Report Spring 2008
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
A-36
ECE 477 Final Report Spring 2008
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
A-37
ECE 477 Final Report Spring 2008
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.
A-38
ECE 477 Final Report Spring 2008
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.
11.0 Version 2 ChangesThe 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.
A-39
ECE 477 Final Report Spring 2008
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.
12.0 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.
A-40
ECE 477 Final Report Spring 2008
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.
A-41
ECE 477 Final Report Spring 2008
13.0 References
[1] Atmel ATmega64RZAPV ZigBee datasheethttp://www.atmel.com/dyn/resources/prod_documents/doc5131.pdf
[2] Sparkfun RFID data sheet ID-12http://www.sparkfun.com/datasheets/Sensors/ID-12-Datasheet.pdf
[3] Sparkfun RFID LF tagshttp://www.sparkfun.com/commerce/product_info.php?products_id=8310
[4] TI RFID series micro 2000 reader module http://focus.ti.com/lit/ds/symlink/ri-stu-mrd1-30.pdf
[5] Reach Technology touch screen SLCD5http://www.reachtech.com/display/slcd5.html
[6] Apollo Display Technologies touch screen
http://www.apollodisplays.com/Products/TFTDisplays/SelectApolloWhiteLED.html?KitNum=T-51638D084J-FW-A-AB-V399
[7] Freescale 16-bit microcontroller Data sheethttp://www.freescale.com/files/microcontrollers/doc/data_sheet/MC9S12E128V1.pdf?fpsp=1
[8] Atmel ATmega1280 8-bit microcontroller datasheethttp://www.atmel.com/dyn/resources/prod_documents/2549S.pdf
[9] Microchip 16-bit microcontroller datasheethttp://ww1.microchip.com/downloads/en/DeviceDoc/70287A.pdf
[10] XBee RF module data sheet http://ftp1.digi.com/support/documentation/90000866_A.pdf
[11] IBM Sure POS 700 Series overview and technical specifications http://www-03.ibm.com/products/retail/products/pos/700/features.html
[12] Microworks POS Solutions Inc. Tableside POS http://www.microworks.com/products/Handheld-Orderng.htm
[13] Pactec Enclosures http://www.pactecenclosures.com/Plastic-Enclosures/PT-8.html
[14] National Semiconductor DC to DC convertor http://www.national.com/pf/LM/LM2679.html
A-42
ECE 477 Final Report Spring 2008
[15] Portable point of sale terminal (US Patent #: 5408077)
http://www.freepatentsonline.com/5408077.html
[16] Apparatus for order entry in a restaurant (US Patent #: 5003472)
http://www.freepatentsonline.com/5003472.html
[17] Customer self-ordering system using information displayed on a screen
(US Patent #: 5235509)
http://www.freepatentsonline.com/5235509.html
[18] Military Handbook, Reliability Prediction of Electronic Equipment, Department of Defense, 2 January 1990.
http://cobweb.ecn.purdue.edu/~dsml/ece477/Homework/CommonRefs/Mil-Hdbk-217F.pdf
[19] DC-DC voltage regulator MAX 1651 Data sheet http://cobweb.ecn.purdue.edu/~477grp13/docs/max1649-max1651.pdf
[20] Battery Fuel Gauge MAX 1660 Data sheet http://cobweb.ecn.purdue.edu/~477grp13/docs/max1660.pdf
[21] Finding and dealing with battery leakage/corrosion http://www.flippers.com/battery.html
[22] Wikipedia, Restriction of Hazardous Substances Directive http://en.wikipedia.org/wiki/Restriction_of_Hazardous_Substances_Directive
[23] Environmental Health & Safety Inc. http://www.ehsservices.com/Services.htm
[24] Battery Solutions Inc. http://www.batteryrecycling.com/
A-43
ECE 477 Final Report Spring 2008
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-44
ECE 477 Final Report Spring 2008
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-45
ECE 477 Final Report Spring 2008
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-46
ECE 477 Final Report Spring 2008
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.
A-47
ECE 477 Final Report Spring 2008
Appendix B: Packaging
Figure B-1 Different stages of Packaging from PCB to final product.
B-1
ECE 477 Final Report Spring 2008
Appendix C: Schematic
Figure C-1 Microcontroller Schematic
Figure C-2 XBee Pro Schematic
C-1
ECE 477 Final Report Spring 2008
Figure C-3 MAX 712 (Battery charger circuit) Schematic
C-2
ECE 477 Final Report Spring 2008
Figure C-4 MAX 1651 and MAX 1649 (3.3 V and 5 V) voltage regulators Schematic
C-3
ECE 477 Final Report Spring 2008
Figure C-5 MAX 1660 (Battery Monitor Circuit) Schematic
C-4
ECE 477 Final Report Spring 2008
Appendix D: PCB Layout Top and Bottom Copper
Figure D-1 PCB Top Copper Layer
D-1
ECE 477 Final Report Spring 2008
Figure D-2 PCB Bottom Copper Layer
D-2
ECE 477 Final Report Spring 2008
Appendix E: Parts List Spreadsheet
Manufacturer Part No. Description CostReach 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.00Freescale 9S12E128 16 bit Microcontroller $14.90Pactec Enclosures DM - 4 Device Enclosure $33.00Digi Key & Mouser electronics
- Capacitors, Resistors, Inductors, MOSFETS and other passive components
$30.00
Only batteries NiMH batteries Accupower AA rechargeable batteries
$52.00
CUI Inc EPAS -101W-24 Switch mode power supply $19.00Total Cost of the project $909.85
Table E-1 Parts list and their individual costs and total cost of the project.
E-1
ECE 477 Final Report Spring 2008
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 <hidef.h> /* common defines and macros */#include <mc9s12e128.h> /* derivative information */#include <stdio.h>#include <string.h>
/* 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 arrayint num;char rfid_tag[12]; // Input from RFID is saved in this arrayint rti_cnt; // Counter for RTIint sleep_flag;int sleep_cnt;int table = 7; // table number float bat = 0;char send_array[160]; // Array send over zigbeechar recieve_array[160]; //Array recieved over zigbeelong dis_count0; // Discharge count0 for the batterylong dis_count1; // Discharge count1 for the battery
F-1
ECE 477 Final Report Spring 2008
long dis_count2; // Discharge count2 for the batterylong dis_count3; // Discharge count3 for the batterylong ch_count0; // Charge count0 for the batterylong ch_count1; // Charge count1 for the batterylong ch_count2; // Charge count2 for the batterylong ch_count3; // Charge count3 for the batterytypedef 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 functiontypedef 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 datarecord 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"},
F-2
ECE 477 Final Report Spring 2008
{"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 */}
F-3
ECE 477 Final Report Spring 2008
/***************************************************************Function:IICINTInput parameters: voidOutput Parameters: VoidDescription:This has the I2C initializations***************************************************************/
void IICINT (void) { IBFD = 0x4C; IBAD = 0x00; IBCR = 0x80;}/***************************************************************Function:SCI2INTInput parameters: voidOutput Parameters: VoidDescription:This has the SCI 2 initializations***************************************************************/
void SCI2INT (void) { SCI2BDL=0x0D; SCI2CR2=0x0C; SCI2CR1=0x00; SCI2BDH=0x00; } /***************************************************************Function:SCI1INTInput parameters: voidOutput Parameters: VoidDescription: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:SCI0INTInput parameters: voidOutput Parameters: VoidDescription:This has the SCI 0 initializations***************************************************************/ void SCI0INT (void) { SCI0BDL=0x9C; SCI0CR2=0x04; SCI0CR1=0x00; SCI0BDH=0x00; } /***************************************************************Function:RTIINTInput parameters: voidOutput Parameters: VoidDescription:This has the RTI initializations
F-4
ECE 477 Final Report Spring 2008
***************************************************************/
void RTIINT(void) { CRGFLG=0x80; RTICTL=0x1F; CRGINT=0x80; _asm cli }
/***************************************************************Function:GET_BATInput parameters: voidOutput Parameters: VoidDescription: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
F-5
ECE 477 Final Report Spring 2008
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));
F-6
ECE 477 Final Report Spring 2008
_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
F-7
ECE 477 Final Report Spring 2008
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_LCDInput parameters: char *aOutput Parameters: VoidDescription:This function sends data to LCD through SCI2 port***************************************************************/ void OUT_LCD (char *a){ while (*a != '\0') { while (!(SCI2SR1 & 0x80)); SCI2DRL = *a++; }}
/***************************************************************Function:outc_testInput parameters: char *aOutput Parameters: VoidDescription: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_CARTInput parameters: char *aOutput Parameters: VoidDescription:adds the item number in the array order depending on the user input***************************************************************/
void ADD_CART(char *a){ int i=0; while (i <= sizeof(menu)) {
F-8
ECE 477 Final Report Spring 2008
if (strcmp(a,menu[i].abutton) == 0) { order[num]= menu[i].number; order_quant[num]=1; outc_test(menu[i].item); num++; } i++; }}/***************************************************************Function:REMOVE_CARTInput parameters: char *aOutput Parameters: VoidDescription:removes the item number in the array order depending on the user input***************************************************************/
void REMOVE_CART(char *a) {int j=0;char b[] = "t \"";
while (j <= sizeof(display_vector)){ if (!strcmp(a,display_vector[j].rbutton)) { outc_test("founddddd"); while( j <= num) { order[j]=order[j+1]; order_quant[j]=order_quant[j+1]; j++; } } j++; }}/***************************************************************Function:QUANT_CARTInput parameters: char *aOutput Parameters: VoidDescription:updates quantity of the the item in the array order_quant depending on the user input***************************************************************/ void QUANT_CART(char *a) { int dollar_total=0; int cent_total=0; int k=0; char total_text[10]; char total_quant[5]; int j = 0; int i =1000; int temp; int temp2=0; while (k <=7){ if (!strcmp(a,display_vector[k].inc_button)) { if (order_quant[k] < 9){ order_quant[k]++; total_quant[0]=order_quant[k]+'0'; total_quant[1]='\0'; OUT_LCD("t \""); OUT_LCD(total_quant);
F-9
ECE 477 Final Report Spring 2008
OUT_LCD(display_vector[k].disp_co2); } } if (!strcmp(a,display_vector[k].dec_button)) { if (order_quant[k] > 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);
F-10
ECE 477 Final Report Spring 2008
OUT_LCD("\" 535 450\r"); }/***************************************************************Function:DISP_CARTInput parameters: voidOutput Parameters: VoidDescription: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 <= 7) { if (menu[order[k]-1].number == order[k]) { OUT_LCD("t \""); OUT_LCD(menu[order[k]-1].item); OUT_LCD(display_vector[k].disp_co); 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); wait(150); 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;
F-11
ECE 477 Final Report Spring 2008
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_ORDERInput parameters: voidOutput Parameters: VoidDescription: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<sizeof(order); i++) { order[i] = 0; } for (i = 0; i<sizeof(order_quant); i++) { order_quant[i] = 0; } for (i = 0; i<sizeof(send_array); i++) { send_array[i] = '\0'; } for (i = 0; i<sizeof(recieve_array); i++) { recieve_array[i] = '\0'; } for (i = 0; i<sizeof(rfid_tag); i++) { rfid_tag[i] = '\0'; }}
/***************************************************************Function:IN_RFIDInput parameters: char *aOutput Parameters: VoidDescription: This function is used to get the RFID tag number from the reader. This is program driven and used SCI0 . The tag id is saved in rfid_tag array.***************************************************************/
void IN_RFID(char a[30]) {
F-12
ECE 477 Final Report Spring 2008
char I=-1; char J = 0;
do{ while (!(SCI0SR1 & 0x20)); if (SCI0DRL == '0') { I++; a[I] = SCI0DRL; while (SCI0DRL != 0x0D) { while (!(SCI0SR1 & 0x20)); I++; J = 1; a[I] = SCI0DRL; } }} while (J == 0); I++;a[I]='\0'; outc_test(a);}
/***************************************************************Function:IN_ZIGBEEInput parameters: char *aOutput Parameters: VoidDescription:This functions recives data from Zigbee transciever through SCI1. the data is saved in recieve_array***************************************************************/
void IN_ZIGBEE(char a[160]) { char I=-1; char J = 0; PTT= 0x40;
do{ while (!(SCI1SR1 & 0x20)); if (SCI1DRL == '[') { I++; a[I] = SCI1DRL; while (SCI1DRL != ']') { while (!(SCI1SR1 & 0x20)); I++; J = 1; a[I] = SCI1DRL; } }} while (J == 0); I++;a[I]='\0';outc_test(a);}
/***************************************************************Function:OUT_ZIGBEEInput parameters: char *aOutput Parameters: Void
F-13
ECE 477 Final Report Spring 2008
Description:This functions sends data to Zigbee transciever through SCI1. The data is sent through send_array***************************************************************/
void OUT_ZIGBEE (char *a){ while (*a != '\0') { while (!(SCI1SR1 & 0x80)); PTT=0x80; SCI1DRL = *a++; }}
/***************************************************************Function:make_orderInput parameters: char sOutput Parameters: VoidDescription:This function creates send_array depending on the char s is s=1 we will send RFID tag number order and table number s=2 we send RFID tag number s=3 we send only order***************************************************************/
void make_order (char s) { int ii; int j; int k=0; send_array[k++] = s; send_array[k++] = '>'; if (s != '2'){ for (j=0; j < sizeof(rfid_tag); j++){ send_array[k++] = rfid_tag[j]; } send_array[k++] = '>'; } if (s == '1') { for (ii = 0; ii < num ; ii++) { send_array[k++] = order[ii]/10 + '0'; send_array[k++] = order[ii]%10 + '0'; send_array[k++] = ':'; send_array[k++] = order_quant[ii] + '0'; send_array[k++] = ','; } send_array[k++] = '>'; send_array[k++] = table + '0'; send_array[k++] = '\0'; } else if (s == '0') { send_array[k++] = '\0'; } else if (s == '2'){ send_array[k++] = '>'; for (ii = 0; ii < num ; ii++) { send_array[k++] = order[ii]/10 + '0'; send_array[k++] = order[ii]%10 + '0'; send_array[k++] = ':'; send_array[k++] = order_quant[ii] + '0';
F-14
ECE 477 Final Report Spring 2008
send_array[k++] = ','; } send_array[k++] = '>'; send_array[k++] = table + '0'; send_array[k++] = '\0'; }
}
/***************************************************************Function:TAKE_DATAInput parameters: voidOutput Parameters: VoidDescription:this function uses recieve_array and gets the user preferances. his balances and display that to screen.***************************************************************/
void TAKE_DATA(void) {int ii=1;char name_array[100];char balance_array[10];int j=0;int i=0;int k=0;char temp;char temp1;char temp2[3];
if (recieve_array[1] == '0'){ OUT_LCD("m 13\r"); }else if (recieve_array[1] == '1'){ ii++; ii++; while (recieve_array[ii] != '>'){ name_array[j++]=recieve_array[ii++]; } name_array[j]='\0'; j=0; ii++; while(recieve_array[ii] != ']'){ balance_array[j++]=recieve_array[ii++]; } balance_array[j]='\0'; OUT_LCD("m 13\r"); OUT_LCD("t \""); OUT_LCD(name_array); OUT_LCD("\" 300 10\r"); OUT_LCD("t \""); OUT_LCD(balance_array); OUT_LCD("\" 300 400\r"); CLEAR_ORDER(); }else if (recieve_array[1] == '2'){ ii++; ii++; while (recieve_array[ii] != '>'){ name_array[j++]=recieve_array[ii++]; } name_array[j]='\0'; j=0; ii++;
F-15
ECE 477 Final Report Spring 2008
while(recieve_array[ii] != ']'){ balance_array[j++]=recieve_array[ii++]; } balance_array[j]='\0'; OUT_LCD("m 13\r"); OUT_LCD("t \""); OUT_LCD(name_array); OUT_LCD("\" 300 10\r"); OUT_LCD("t \"Sufficient funds not avialable\" 300 200\r"); OUT_LCD("t \""); OUT_LCD(balance_array); OUT_LCD("\" 300 400\r"); }else if (recieve_array[1] == '3'){ OUT_LCD("m 13\r"); OUT_LCD("t \"Order Placed\" 200 200\r"); CLEAR_ORDER(); }else if (recieve_array[1] == '5'){ OUT_LCD("m 13\r"); OUT_LCD("t \"Invalid RFID Tag\" 200 200\r"); }else if (recieve_array[1] == '4') { ii++; ii++; OUT_LCD("m 13\r"); while (recieve_array[ii] != '>'){ name_array[j++]=recieve_array[ii++]; } name_array[j]='\0'; ii++; j = 0; while (recieve_array[ii] != ']' && j<8) { temp = recieve_array[ii++]; temp1 = recieve_array[ii++]; if (temp == '0' && temp1 == '1') k = 1; else if (temp == '0' && temp1 == '2') k = 2; else if (temp == '0' && temp1 == '3') k = 3; else if (temp == '0' && temp1 == '4') k = 4; else if (temp == '0' && temp1 == '5') k = 5; else if (temp == '0' && temp1 == '6') k = 6; else if (temp == '0' && temp1 == '7') k = 7; else if (temp == '0' && temp1 == '8') k = 8; else if (temp == '0' && temp1 == '9') k = 9; else if (temp == '1' && temp1 == '0') k = 10; else if (temp == '1' && temp1 == '1') k = 11; else if (temp == '1' && temp1 == '2') k = 12; else if (temp == '1' && temp1 == '3') k = 13;
F-16
ECE 477 Final Report Spring 2008
else if (temp == '1' && temp1 == '4') k = 14; else if (temp == '1' && temp1 == '5') k = 15; OUT_LCD(menu[k-1].bcmd); OUT_LCD(display_vector[j++].disp_co3); OUT_LCD(menu[k-1].bnum); wait(150); ii++; } }}/***************************************************************Function:SCI2_ISRInput parameters: voidOutput Parameters: VoidDescription:This function recives data continously.depending on the recived data different function are called.
***************************************************************/ void SCI2_ISR(void){ static char a[7]; char I=-1; char J = 0; do{ while (!(SCI2SR1 & 0x20)) { } if (SCI2DRL == 's' || SCI2DRL == 'r' || SCI2DRL == 'x') { I++; a[I] = SCI2DRL; sleep_flag=1; while (a[I] != '\r') { while (!(SCI2SR1 & 0x20)); I++; J = 1; a[I] = SCI2DRL; } } }while (J == 0); *(a+I)='\0'; OUT_LCD("t \""); OUT_LCD(a); OUT_LCD("\" 0 0\r"); if (a[0] == 's') { ADD_CART(a);} else if (strcmp(a,"r36")==0) { OUT_LCD("m 13\r"); DISP_CART();} else if (strcmp(a,"r37")==0) { OUT_LCD("m 14\r"); DISP_CART();} else if (strcmp(a,"r38")==0) { OUT_LCD("m 15\r"); DISP_CART();} else if (strcmp(a,"r39")==0) { OUT_LCD("m 16\r");
F-17
ECE 477 Final Report Spring 2008
DISP_CART();} else if (strcmp(a,"r40")==0) { OUT_LCD("m 17\r"); DISP_CART();} else if (strcmp(a,"r41")==0) { OUT_LCD("m 18\r"); DISP_CART();}else if (!strcmp(a,"x42") || !strcmp(a,"x43") || !strcmp(a,"x44") || !strcmp(a,"x45") || !strcmp(a,"x46") || !strcmp(a,"x47") || !strcmp(a,"x48") || !strcmp(a,"x49") || !strcmp(a,"x50") || !strcmp(a,"x51")){ REMOVE_CART(a); num--; DISP_CART();}else if (!strcmp(a,"r1")){ IN_RFID(rfid_tag); make_order('0'); OUT_ZIGBEE(send_array); IN_ZIGBEE(recieve_array); TAKE_DATA();} else if (a[0]== 'x'){ QUANT_CART(a);} else if (!strcmp(a,"r55")){ DISP_CART();}else if (!strcmp(a,"r53")){ IN_RFID(rfid_tag); make_order('1'); OUT_ZIGBEE(send_array); IN_ZIGBEE(recieve_array); TAKE_DATA();}else if(!strcmp(a,"r54")){ make_order('2'); OUT_ZIGBEE(send_array); IN_ZIGBEE(recieve_array); outc_test("first222222222222"); TAKE_DATA(); }}
/***************************************************************Function:RTI_ISRInput parameters: voidOutput Parameters: VoidDescription: This function works on interrupt mode for every 8.192 ms. it increments rti_cnt every time it enters this function.***************************************************************/ #pragma CODE_SEG __NEAR_SEG NON_BANKED
interrupt 7 void RTI_ISR(void) {
CRGFLG=0x80; rti_cnt++; sleep_cnt++; if (sleep_flag == 1) { sleep_flag=0; sleep_cnt=0; } if (sleep_cnt > 250000) { OUT_LCD("m 15\r"); }
F-18
ECE 477 Final Report Spring 2008
}/***************************************************************Function:waitInput parameters: long msOutput Parameters: VoidDescription:This function waits for specified number of ms. This is used in DISP_CART to send data correctly.***************************************************************/
#pragma CODE_SEG DEFAULT
void wait(long ms){ long timeout; timeout = rti_cnt + ms; while (timeout > 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 System.ComponentModel;using System.Data;using System.Data.Common;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); }
F-19
ECE 477 Final Report Spring 2008
// 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; }
F-20
ECE 477 Final Report Spring 2008
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); } }
F-21
ECE 477 Final Report Spring 2008
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 <= (orderArray.Length / 2); k++) { tot = tot + Convert.ToDouble(projectDataSet1.Menu.Rows.Find(orderArray[i]).ItemArray[2]) * Convert.ToDouble(orderArray[j]); i = i + 2; j = j + 2; } return tot; }
delegate void SetBalanceCallback(string bal); private void SetBalance(string bal) { // Set the new balance into the balanceTextBox for the RFID ShowRFIDTab(); if (this.balanceTextBox.InvokeRequired) { SetBalanceCallback d = new SetBalanceCallback(SetBalance); this.Invoke(d, new object[] { bal }); } else { this.balanceTextBox.Text = bal; } ClickSave(); }
delegate void DisplayOrderCallback(string ord, string tab, string pay); private void DisplayOrder(string ord, string tab, string pay) { // Displays the order in the multiline textbox.
// This function is called through a delegate, since the // textbox is defined in a different thread. double tot; int i = 0; string[] ordArray = ord.Split(new char[] { ':', ',' });
if (this.displayTextBox.InvokeRequired) { DisplayOrderCallback d = new DisplayOrderCallback(DisplayOrder); this.Invoke(d, new object[] { ord, tab, pay }); } else { // Display the header for the order displayTextBox.AppendText("Order for Table # " + tab + ":");
F-22
ECE 477 Final Report Spring 2008
// Goes to a new line in the textbox displayTextBox.AppendText(Environment.NewLine); displayTextBox.AppendText(Environment.NewLine); displayTextBox.AppendText("Quantity \t Item"); displayTextBox.AppendText(Environment.NewLine);
// Displays the order with quantity and the item for (int k = 1; k <= (ordArray.Length / 2); k++) { displayTextBox.AppendText(ordArray[i + 1].ToString() + " \t " + projectDataSet1.Menu.Rows.Find(ordArray[i]).ItemArray[1].ToString()); displayTextBox.AppendText(Environment.NewLine); i = i + 2; } displayTextBox.AppendText(Environment.NewLine);
// Displays the total for the order displayTextBox.AppendText("Total: $");
// Total function is called to calculate the total for the order tot = total(ord); displayTextBox.AppendText(tot.ToString());
// Displays to say if the order is paid for at the table or // it is paid using the Cash/Credit option. if (pay.Equals("1")) { displayTextBox.AppendText("\t" + "Paid at the table using RFID"); } else if (pay.Equals("2")) { displayTextBox.AppendText("\t" + "Cash or Credit Card"); }
// The dotted line shows the end of the order. displayTextBox.AppendText(Environment.NewLine); displayTextBox.AppendText("-------------------"); displayTextBox.AppendText(Environment.NewLine); displayTextBox.AppendText(Environment.NewLine); } }
delegate void ClickSaveCallback(); private void ClickSave() { // This function performs a software click of the rfidSaveButton if (this.rfidSaveButton.InvokeRequired) { ClickSaveCallback d = new ClickSaveCallback(ClickSave); this.Invoke(d); } else { this.rfidSaveButton.PerformClick(); } }
F-23
ECE 477 Final Report Spring 2008
delegate void ShowRFIDTabCallback(); private void ShowRFIDTab() { // This function shows the rfidTabPage when called for. if (this.rfidTabPage.InvokeRequired) { ShowRFIDTabCallback d = new ShowRFIDTabCallback(ShowRFIDTab); this.Invoke(d); } else { this.rfidTabPage.Show(); } }
private void port_DataReceived(object sender, SerialDataReceivedEventArgs e) { if (!port.IsOpen) { // Open the port if closed. port.Open(); }
// Initializations for the DataReceived function. string inData = port.ReadExisting(); string[] inDataArray = inData.Split(new char[] { '>' }, 4); string outData = ""; string[] coordinates = {"32 30", "330 30", "32 133", "330 133", "32 236", "330 236", "32 339", "330 339"};
try { if (inDataArray[1] != null && inDataArray[1].Length == 12) { // When the RFID tag data is sent, the last two digits // of the RFID tag are truncated // The last two characters of the RFID are the Checksum // characters inDataArray[1] = inDataArray[1].Remove(10); }
// This if statement differentiates between the different kinds // of orders. // 0 - when the system wants the custom menu choices // 1 - when the order is paid for using the RFID gift card // 2 - when the order is intended to be paid for using the cash/credit option if (inDataArray[0].Equals("0")) { outData = ""; string[] customMenu = projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[2].ToString().Split(new char[] { ',' });
if (projectDataSet1.RFID_tags.Rows.Contains(inDataArray[1])) { string first = projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[3].ToString(); string last = projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[4].ToString();
// The outData starts with 4 implying that the RFID is valid
F-24
ECE 477 Final Report Spring 2008
// and the custom menu choices are sent to the microcontroller outData = "[4>" + first + " " + last + ">" + projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[2].ToString() + "]"; } else { // The outData starts with 5 implying that the RFID tag // that is read is invalid. outData = "[5]"; }
send(outData); } else if (inDataArray[0].Equals("1")) { double tot = 0; double bal = 0;
tot = total(inDataArray[2]);
outData = "";
if (projectDataSet1.RFID_tags.Rows.Contains(inDataArray[1])) { bal = Convert.ToDouble(projectDataSet1.RFID_tags.Rows.Find(inDataArray[1]).ItemArray[1]) - tot;
if (bal >= 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"))
F-25
ECE 477 Final Report Spring 2008
{ 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//---------------------------------------------------------------------//---------------------------------------------------------------------
F-26
ECE 477 Final Report Spring 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 115200xbl ons 0 1zbv 150xi 6 0 0w 1000xs 128 0 0 639 479 // Create an invisible hotspotxm 128 2 // Go to macro 2 when touchedf m16w 1000t "Touch screen to order" 250 450w 1000t "Touch screen to order." 250 450w 1000t "Touch screen to order.." 250 450w 1000t "Touch screen to order..." 250 450w 1000t "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 1zbd 0 66 50 4 "" 0 0 7 8xm 0 2 3bd 1 66 251 4 "" 0 0 9 10xm 1 2 4#end
//---------------------------------------------------------------------// MACRO #3// Displays the options for the full menu.//---------------------------------------------------------------------#define full_menu 3 /*s 0 1zbd 4 66 50 4 "" 0 0 11 12xm 4 3 5bd 5 66 251 4 "" 0 0 13 14
F-27
ECE 477 Final Report Spring 2008
xm 5 3 6bd 2 0 430 4 "" 0 0 19 20xm 2 3 2#end
//---------------------------------------------------------------------// MACRO #4// Displays the options for the custom menu.//---------------------------------------------------------------------#define custom_menu 4 /*s 0 1zxi 29 0 0bd 3 0 430 4 "" 0 0 19 20xm 3 4 2#end
//---------------------------------------------------------------------// MACRO #5// Displays the options for the Breakfast menu.//---------------------------------------------------------------------#define breakfast_menu 5 /*s 0 1zbd 8 66 50 4 "" 0 0 15 16xm 8 5 7bd 9 66 251 4 "" 0 0 17 18xm 9 5 8bd 6 0 430 4 "" 0 0 19 20xm 6 5 3#end
//---------------------------------------------------------------------// MACRO #6// Displays the options for the Lunch/Dinner menu.//---------------------------------------------------------------------#define lunch_dinner_menu 6 /*s 0 1zbd 12 34 50 4 "" 0 0 21 22xm 12 6 9bd 13 330 50 4 "" 0 0 23 24xm 13 6 10bd 14 34 251 4 "" 0 0 25 26xm 14 6 11bd 15 330 251 4 "" 0 0 27 28 xm 15 6 12bd 7 0 430 4 "" 0 0 19 20xm 7 6 3#end
//---------------------------------------------------------------------// MACRO #7// Displays the options for the Breakfast-Food menu.
F-28
ECE 477 Final Report Spring 2008
//---------------------------------------------------------------------#define breakfast_food_menu 7 /*s 0 1zbd 20 32 30 20 "" "" 0 0 0 0 30 31bd 21 330 30 20 "" "" 0 0 0 0 32 33bd 22 32 133 20 "" "" 0 0 0 0 34 35bd 23 330 133 20 "" "" 0 0 0 0 36 37bd 24 32 236 20 "" "" 0 0 0 0 38 39bd 25 330 236 20 "" "" 0 0 0 0 40 41bd 26 32 339 20 "" "" 0 0 0 0 42 43bd 10 0 430 4 "" 0 0 19 20xm 10 7 5bd 36 398 430 4 "" 0 0 60 61xm 36 7 13#end
//---------------------------------------------------------------------// MACRO #8// Displays the options for the Breakfast-Beverages menu.//---------------------------------------------------------------------#define breakfast_beverages_menu 8 /*s 0 1zbd 27 32 30 20 "" "" 0 0 0 0 44 45bd 28 330 30 20 "" "" 0 0 0 0 46 47bd 29 32 133 20 "" "" 0 0 0 0 48 49bd 30 330 133 20 "" "" 0 0 0 0 50 51bd 31 32 236 20 "" "" 0 0 0 0 52 53bd 32 330 236 20 "" "" 0 0 0 0 54 55bd 33 32 339 20 "" "" 0 0 0 0 56 57bd 34 330 339 20 "" "" 0 0 0 0 58 59bd 11 0 430 4 "" 0 0 19 20xm 11 8 5bd 37 398 430 4 "" 0 0 60 61xm 37 8 14#end
//---------------------------------------------------------------------// MACRO #9// Displays the Starters/Soups menu for Lunch/Dinner.//---------------------------------------------------------------------#define lunch_starters_menu 9 /*s 0 1zsc 0 0f m24t "Lunch>Starters/Soups Menu:"bd 16 0 430 4 "" 0 0 19 20xm 16 9 6bd 38 398 430 4 "" 0 0 60 61xm 38 9 15#end
//---------------------------------------------------------------------
F-29
ECE 477 Final Report Spring 2008
// MACRO #10// Displays the Sandwiches menu for Lunch/Dinner.//---------------------------------------------------------------------#define lunch_sandwich_menu 10 /*s 0 1zsc 0 0f m24t "Lunch>Sandwiches Menu:"bd 17 0 430 4 "" 0 0 19 20xm 17 10 6bd 39 398 430 4 "" 0 0 60 61xm 39 10 16#end
//---------------------------------------------------------------------// MACRO #11// Displays the Desserts menu for Lunch/Dinner.//---------------------------------------------------------------------#define lunch_desserts_menu 11 /*s 0 1zsc 0 0f m24t "Lunch>Desserts Menu:"bd 18 0 430 4 "" 0 0 19 20xm 18 11 6bd 40 398 430 4 "" 0 0 60 61xm 40 11 17#end
//---------------------------------------------------------------------// MACRO #12// Displays the Beverages menu for Lunch/Dinner.//---------------------------------------------------------------------#define lunch_beverages_menu 12 /*s 0 1zbd 27 32 30 20 "" "" 0 0 0 0 44 45bd 28 330 30 20 "" "" 0 0 0 0 46 47bd 29 32 133 20 "" "" 0 0 0 0 48 49bd 30 330 133 20 "" "" 0 0 0 0 50 51bd 31 32 236 20 "" "" 0 0 0 0 52 53bd 32 330 236 20 "" "" 0 0 0 0 54 55bd 33 32 339 20 "" "" 0 0 0 0 56 57bd 34 330 339 20 "" "" 0 0 0 0 58 59bd 19 0 430 4 "" 0 0 19 20xm 19 12 6bd 41 398 430 4 "" 0 0 60 61xm 41 12 18#end
//---------------------------------------------------------------------// MACRO #13// Displays a blank screen for the cart items to be displayed.
F-30
ECE 477 Final Report Spring 2008
//---------------------------------------------------------------------#define display_cart1 13 /*s 0 1zf m14bd 35 0 430 4 "" 0 0 19 20xm 35 13 7bd 52 146 430 4 "" 0 0 64 65xm 52 13 19#end
//---------------------------------------------------------------------// MACRO #14// Displays a blank screen for the cart items to be displayed.//---------------------------------------------------------------------#define display_cart2 14 /*s 0 1zf m14bd 53 0 430 4 "" 0 0 19 20xm 53 14 8bd 52 146 430 4 "" 0 0 64 65xm 52 14 19#end
//---------------------------------------------------------------------// MACRO #15// Displays a blank screen for the cart items to be displayed.//---------------------------------------------------------------------#define display_cart3 15 /*s 0 1zf m14bd 55 0 430 4 "" 0 0 19 20xm 55 15 9bd 52 146 430 4 "" 0 0 64 65xm 52 15 19#end
//---------------------------------------------------------------------// MACRO #16// Displays a blank screen for the cart items to be displayed.//---------------------------------------------------------------------#define display_cart4 16 /*s 0 1zf m14bd 56 0 430 4 "" 0 0 19 20xm 56 16 10bd 52 146 430 4 "" 0 0 64 65xm 52 16 19#end
//---------------------------------------------------------------------
F-31
ECE 477 Final Report Spring 2008
// MACRO #17// Displays a blank screen for the cart items to be displayed.//---------------------------------------------------------------------#define display_cart5 17 /*s 0 1zf m14bd 57 0 430 4 "" 0 0 19 20xm 57 17 11bd 52 146 430 4 "" 0 0 64 65xm 52 17 19#end
//---------------------------------------------------------------------// MACRO #18// Displays a blank screen for the cart items to be displayed.//---------------------------------------------------------------------#define display_cart6 18 /*s 0 1zf m14bd 58 0 430 4 "" 0 0 19 20xm 58 18 12bd 52 146 430 4 "" 0 0 64 65xm 52 18 19#end
//---------------------------------------------------------------------// MACRO #19// Displays the check-out screen with pay options.//---------------------------------------------------------------------#define checkout_screen 19 /*s 0 1zf m14bd 60 157 75 4 "" 0 0 68 69xm 60 19 21bd 61 157 200 4 "" 0 0 70 71bd 59 0 432 4 "" 0 0 66 67xm 59 19 2#end
//---------------------------------------------------------------------// MACRO #20// Macro for the Sleep mode.//---------------------------------------------------------------------#define sleep_screen 20 /*s 0 1zxbl offxs 129 0 0 639 479xm 129 1#end
F-32
ECE 477 Final Report Spring 2008
//---------------------------------------------------------------------// MACRO #21// Displays a wait screen for RFID input.//---------------------------------------------------------------------#define wait_screen 21 /*s 0 1zxi 29 0 0bd 62 0 430 4 "" 0 0 19 20xm 62 21 19#end
F-33
ECE 477 Final Report Spring 2008
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 within functional block or external short
Total Device Failure
Observation Low
A2 Output > 3.3 V Failure of a MAX 1651 Potential damage to XBee Pro, Microcontroller
Observation Low
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 components such as capacitors
Out of spec operating voltage; unpredictable
Observation High
Table G-1 FEMCA Worksheet for Power Supply Circuit
G-1
ECE 477 Final Report Spring 2008
Failure No. Failure Mode Possible Cause Failure Effects Method of Detection
Criticality Remarks
B1 Data not retrieved from RFID reader
Failure of microcontroller or error in software
Data cannot be sent to the micro from the RFID reader
Observation Low
B2 Blank LCD screen
Failure of microcontroller or error in software
Data cannot be sent to the LCD screen
Observation Low
B3 No connection with the kitchen server
Failure of microcontroller or error in software
Communication error with the server
Observation Low
Table G-2 FMECA Worksheet for Microcontroller
G-2
ECE 477 Final Report Spring 2008
Failure No. Failure Mode Possible Cause Failure Effects Method of Detection
Criticality Remarks
C1 Battery Level not detected correctly
Failure of MAX 1660
Error in detecting the charge level of batteries
Observation Low
C2 Batteries not charging
Failure of MAX 712 and MAX 1660 or dead batteries
Device would not work without external power supply
Observation Low
C3 Batteries excessively charged
Failure of MAX 712 or MAX 1660
Batteries may leak or explode
Observation High Sometimes may cause damage to other components
Table G-3 FMECA Worksheet for Battery Circuit
G-3