EE 477 Final Report



ECE 477 Final Report

Spring 2006

[pic]

Team Code Name: SLOW – System of LEDs Operated Wirelessly Team ID: 8

Team Members (#1 is Team Leader):

#1: Chanon Sujjapong Signature: ____________________ Date: 04/30/2006

#2: Randall Hintz Signature: ____________________ Date: 04/30/2006

#3: Varun Bansal Signature: ____________________ Date: 04/30/2006

#4: Ayush Johari Signature: ____________________ Date: 04/30/2006

REPORT EVALUATION

|Component/Criterion |Score |Multiplier |Points |

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

|Project Overview and Block Diagram |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Team Success Criteria/Fulfillment |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Constraint Analysis/Component Selection |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Patent Liability Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Reliability and Safety Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Ethical/Environmental Impact Analysis |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Packaging Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Schematic Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|PCB Layout Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Software Design Considerations |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Version 2 Changes |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

|Summary and Conclusions |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

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

|Appendix A: Individual Contributions |0 1 2 3 4 5 6 7 8 9 10 |X 4 | |

|Appendix B: Packaging |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix C: Schematic |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix D: Top & Bottom Copper |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix E: Parts List Spreadsheet |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix F: Software Listing |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Appendix G: FMECA Worksheet |0 1 2 3 4 5 6 7 8 9 10 |X 2 | |

|Technical Writing Style |0 1 2 3 4 5 6 7 8 9 10 |X 8 | |

|CD of Project Website |0 1 2 3 4 5 6 7 8 9 10 |X 1 | |

| |TOTAL | |

TABLE OF CONTENTS

|Abstract |A-1 |

| 1.0 Project Overview and Block Diagram |A-2 |

| 2.0 Team Success Criteria and Fulfillment |A-3 |

| 3.0 Constraint Analysis and Component Selection |A-4 |

| 4.0 Patent Liability Analysis |A-10 |

| 5.0 Reliability and Safety Analysis |A-14 |

| 6.0 Ethical and Environmental Impact Analysis |A-19 |

| 7.0 Packaging Design Considerations |A-22 |

| 8.0 Schematic Design Considerations |A-25 |

| 9.0 PCB Layout Design Considerations |A-28 |

|10.0 Software Design Considerations |A-30 |

|11.0 Version 2 Changes |A-35 |

|12.0 Summary and Conclusions |A-35 |

|13.0 References |A-36 |

|Appendix A: Individual Contributions |A-39 |

|Appendix B: Packaging |B-1 |

|Appendix C: Schematic |C-1 |

|Appendix D: PCB Layout Top and Bottom Copper |D-1 |

|Appendix E: Parts List Spreadsheet |E-1 |

|Appendix F: Software Listing |F-1 |

|Appendix G: FMECA Worksheet |G-1 |

Abstract

The goal of the SLOW project is to design and implement a system where a user can login to an embedded web server from any computer that has access to the internet to change the text display on an LED panel comprised of ten 5x7 LED dot matrices. A user would have the option of displaying the current time, temperature indoor or outdoor, or scroll a custom message. This panel could be used at stores, fast-food restaurants or other places for customers to see and read.

1. Project Overview and Block Diagram

This project allows for the display of custom text messages, time, or temperature on an

LED panel built by cascading ten 5x7 LED dot matrices. Each LED block would be controlled by its own shift register and Darlington transistor array, while the data signals would all come from the microcontroller. The microcontroller has an embedded web server programmed into it with its own dedicated page for users to access from anywhere that has access to the internet. Once the user has logged in, he/she may be able to view what is currently being displayed on the panel and modify it if desired. The user page has the option for changing between three display modes: message mode, time mode, and temperature mode. At anytime the user can change the message, set the time for the clock, or change display modes, and these changes will be reflected on the display panel immediately after. See the Figure 1.1 for a general perspective on the design.

[pic]

Figure 1.1. Block Diagram.

2. Team Success Criteria and Fulfillment

Ability to display scrolling ASCII character strings on an LED matrix.

Hardcoded text in flash memory successfully displays on LED matrices and scrolls repeatedly. It can display all three modes, message mode, non-scrolling time mode, and non-scrolling temperature mode. This criterion has been fulfilled.

1. Ability to save messages and configuration data in non-volatile memory.

This criterion has not been fulfilled.

2. Ability to measure and display indoor/outdoor temperature.

The microcontroller successfully communicates with the temperature sensor and retrieves the right data data to be displayed on the panel. This criterion has been fulfilled.

3. Ability to display the current time (based on a highly accurate internal clock).

By simply using the timer peripheral on our microcontroller, we were able to create an accurate digital clock with very little or no percent error. This time can be displayed on the LED panel and it updates real-time. This criterion has been fulfilled.

4. Ability to configure display and edit messages via an embedded server.

We were able to run a java application on a local host machine and were able to configure display and edit messages on the microcontroller. This success criterion has been partially fulfilled as we have established communication between the microcontroller and a computer via an Ethernet connection although it does not work together with the other functions flashed on the microcontroller, therefore nothing displayed on the LED panel.

Constraint Analysis and Component Selection

Certain hardware/software and packaging constraints we have to be taken into consideration in our project. The power supply plays a major role in the design and needs to be built carefully. It needs to be able to output enough voltage and current to the microcontroller and all the LED blocks [6] such that they would be bright enough for viewers to see while also making sure that the microcontroller [2] or LED blocks or even the power supply itself does not overheat and malfunction. The display panel needs to be large enough for people to see and read from an appreciable distance of around 20 to 25 feet to be of good use. Since the panel will be controlled from a remote connection, the microcontroller chosen would need to have Ethernet capabilities [3], sufficient flash memory to store all the embedded web server information, code, lookup tables and non-volatile variables, and a sizeable amount of SRAM to store the other variables and maintain proper stack functionality. The implementation that will be used for our design involves sending data to shift registers [7] each outputting 12 signals (7 rows, 5 columns) then by using Darlington transistors [8], the current for a given column activated can be sinked. Based on this, it is imperative to choose shift registers and Darlington transistors with the right number of I/O pins and take input voltages that are within tolerance of the voltages supplied on the board, namely 3.3V and 5V. Lastly, each component on the board would need to effectively communicate with each other without noise interference from other components and with their input and output voltages matching to each other.

1. Analysis of Real World constraints

1. Computation Requirements

The microcontroller [2] would need to have functions such as Real Time Interrupt (RTI) and a highly accurate timer module function for displaying the current time and for controlling other time-based functions. Moreover, the microcontroller needs to have a fast enough clock rate to be able to effectively run all the functions on the board properly. RTI, Timer, and Ethernet will all be interrupt-driven and there will also be non-interrupt-driven functions as well, so a fast microcontroller would be recommended for this application. Each LED will be activated one column at a time and this is done for all LED blocks at the same time and therefore it will take 5 column display cycles to refresh the entire panel (since there are 5 columns in each LED block). The rate at which each column is activated successively depends on the RTI subsystem. This refresh rate will need to be set so that the normal human eye may not be able to detect the blinking and appear to be on the entire time. As for the timer based system, it must be initialized so that the microcontroller would act as a real time clock with very little or no percent error, thus the clock will be accurate even after many years of continuous use. For the temperature sensor, there are specific timing procedures that need to be followed and those need to be taken into consideration as well.

2. Interface Requirements

This design would require the use of 13 general purpose I/O pins on the microcontroller for controlling the LED blocks. 10 lines will be the data lines (one for each shift register [7]), a Strobe, Clock, and Output Enable line will all lead to each of the 10 shift registers for the purpose of synchronization between all the LED matrices. Another general purpose I/O pin on the microcontroller will be used for the digital thermometer. An I/O pin was chosen over an ATD pin for this task because of the fact that the temperature sensor needs a line that could act as both an input and an output. There will be four lines leading to each shift register and each shift register would have several lines leading to both their respective LED block and Darlington transistor [8] also including the lines from the Darlington transistor, there will be many lines to be routed on the PCB and thus may possibly increase the size of the board. Each LED block has a minimum forward voltage constraint of 2.0V and a maximum of 2.6V and also a peak forward current per dot of 100mA so these ranges must be met at all times and not exceeded by the shift registers and Darlington transistors when supplying power to each LED matrix.

3. On-Chip Peripheral Requirements

This design will use a few of the microcontroller’s [2] peripherals besides general purpose I/O, namely the RTI function, the timer module using one output compare timer channel for the digital clock, and Ethernet.

4. Off-Chip Peripheral Requirements

This design requires that we use ten shift registers [7] and ten Darlington transistor arrays [8] to properly decode the messages sent serially by the microcontroller [2] to each of the LED blocks [6].

5. Power Constraints

The microcontroller [2] requires a nominal input voltage of 3.3V, so the 12V D.C. power that we get from the power supply would have to be regulated and stepped down to attain this voltage value, also we cannot let the voltage fluctuate and exceed the min and max bounds which are 3.0V and 5.0V respectively. The MC9S12NE64 has an output voltage of about 3.3V however the shift registers [7] take a nominal input voltage of 5V so each of the signals leaving the microcontroller towards the LED blocks would have to be amplified to the set amount for the shift registers to be able to recognize a high signal. This could be achieved by using a level translator [9] between the microcontroller and the rest of the components.

6. Packaging Constraints

The main outer case of the design need only be that of the size of the PCB board contained within it and made of a material that is light-weight yet relatively durable so that a user may be able to hang it on a wall at a high place while holding it with only one hand. The material encompassing the digital thermometer [5] must not interfere with the accuracy of the sensor. Also, the wire for the sensor must be reasonably long enough for the user to extend to the nearest window or opening to the outside of the room. The cord for the power cable must also be of a decent length to reach a power outlet. Due to the large number of components on the PCB, there may not be any space to hold everything so size may increase. If size is increased, the area may not exceed 60 square inches as this is a requirement. Moreover, the design would look more sleek and attractive if it the height and width and weight are minimized.

7. Cost Constraints

After browsing through the internet for parts to be used with this design, there are actually cheaper parts that could be found to implement the same idea as this design. This is obvious as there are many products in the market that are similar to this product. Most of the products in the market that resemble our project cost over $200, so it has come to our attention that if the price is lowered then our product would be one that would make a profit. The main problem is, by lowering the overall cost of the design, we in turn end up with less functionality and so it is not a good comparison anymore between the two. Therefore our constraint has now been reduced to making our design as cost-efficient as possible while maintaining the same basic functionality idea as those products out in the market. Our target price for this product is around $150.

2. Component Selection Rationale

1. Microcontroller

There are two kinds of microcontrollers that included an integrated Ethernet controller [3] in its package that came to our interest, these were: Freescale’s MC9S12NE64 (112 pin or 80 pin) [1] and Rabbit Semiconductor’s RCM3750 [4]. Both of these chips have been quite common in the development of Ethernet based designs. Both microcontrollers had their own set of advantages and disadvantages:

| |MC9S12NE64 [1] |MC9S12NE64 [1] |RCM3750 [4] |

| |LQFP package (112 pins) |TQFP-EP package (80 pins) | |

|Microprocessor |25 MHz |25 MHz |22.1 MHz |

|Ethernet |10/100 Base-T |10/100 Base-T |10 Base-T |

|Flash memory |64 Kb |64 Kb |512 Kb |

|SRAM |8 Kb |8 Kb |512 Kb |

|I/O pins |70 |38 |31 |

|Timer |Yes |Yes |None |

|SPI |Yes |Yes |Yes |

|Cost |$8.22 |$7.92 |$59 |

In the end we went with the obvious choice, the MC9S12NE64 80 pin package. Though the RCM3750 had much more SRAM and non-volatile flash memory to work with, this model lacked a timer module which our design needs for the digital clock implementation. The Freescale microcontrollers are so much less expensive than Rabbit’s microcontroller so it was easy to rule out the RCM3750. As for the Freescale chips, the two listed above are exactly the same except for one has more pins than the other and since we did not need too many I/O pins, the MC9S12NE64 80-pin package was the best option of the three because it suits our design project a little more.

2. LED Dot Matrix Panel

There are many various LED screens sold in the market that sometimes performed many functions such as multi-colored LEDs, transitions between text, easy text input support, integrated decoders along with serial ports for programming, and extra memory for storing really long messages. However, those products were not very cost-effective and are usually sold with prices ranging $200 and up. At this point it was decided that we build our own LED panel by cascading a number of 5x7 dot matrix displays [6], thus lowering the overall cost of the design. As for the choice in 5x7 segments, Digi-key had a decent selection of LED dot matrices, different sizes and different colors. In the end we decided on the simplest one because it was one of the cheapest with a cost of $4.65. The display screens found out in the market, most of the time, do not include useful functions such as time and temperature display and remote access via its web server, just text display alone. This being said, our design has an advantage over those. As for multi-colored LEDs, this can be applied to our design as well by simply replacing the dot matrices with more expensive ones. Dot matrix displays however need to be implemented in a different fashion. The entire 5x7 block cannot be activated simultaneously due to its internal wiring composition; only one column at a time may be turned on. Data for the rows within the same column will be shifted to each of the ten shift registers [7] on the board and simultaneously outputted to the LEDs. A high refresh rate will be necessary to avoid noticing the “flickering” of the LEDs.

3. Digital Thermometer

Maxim’s DS18S20 High-Precision 1-wire digital thermometer [5], as suggested in the course documents, seemed to be a great option for it can be very useful in measure the temperature either indoors or outdoors with high accuracy. This 1-wire package makes it very compact and efficient for the microcontroller [2] because it only uses 1 pin in order to function.

3. Patent Liability Analysis

Taking into consideration patent liability and infringement, some design issues implemented by the SLOW project could fall under certain patents or could lead to infringement upon other registered patents. This document will address the issues mentioned above by comparing similar patented design to our SLOW project, as well as proposing methods to mitigate the patent liability.

4.1 Results of Patent and Product Search

United States Patent No: 6112335 [10]

Method and apparatus for remotely managing a network hardware device having an embedded server with a client computer across a network

Filing Date: May 27, 1997

Inventor: David Martin Gee

Assignee: Agilent Technologies, Inc.

Patent 6112335 discloses a technique of remote management of a hardware device using an industry standard inter network protocol. The hardware device consists of a client and protocol stack along with an embedded web server installed on it. The claims of this patent include:

• Controlling and managing a hardware device remotely through a HTTP client with a help of an embedded web server.

• Successfully setting up an internet connection via a TCP/IP protocol.

• Have control requests from a HTTP client to edit/change characteristics on a network hardware device.

• The network is the internet and the HTML file is the homepage.

United States Patent No: 6580404 [11]

Patent 6580404 claims a dot matrix display with parallel arrangements of dot matrix modules. It also has a driver for controlling the contents to be displayed on the modules. It has light emitting elements and light receiving elements between the modules which make the transmission of the content possible across the modules.

Filing Date: February 17, 1999

Inventor: Takayuki Ishihara

Assignee: Rohm Co., Ltd.

The claims with this patent include:

• Multiple dot matrix display modules arranged in parallel with luminous sections (LEDs) in the matrix form.

• Use of shift registers to control the turning on and off of LEDs.

• Use of light emitting and light receiving elements on each module.

• Use of 2 Ram devices, with the first one containing the data to be sent to the shift register to display on the current module and 2nd Ram device for storing the data for the next module

United States Patent No: 5977937 [12]

Patent 5977937 claims a display device which has multiple display units, each of which has multiple display elements. Each of the display unit can be controlled simultaneously using the respective display driver. The circuit consists of a microcontroller, memory device to store the data to be outputted via the display device, and a DMA controller for transferring the data.

Filing Date: August 14, 1995

Inventor: Uwe Michaelis

Assignee: U.S. Philips Corporation

The key claims are:

• A circuit arrangement consisting of multiple display units with multiplexed display elements which are controlled by a display driver.

• Memory device is used to store the display content to sent to the display blocks.

• Circuit has a microcontroller with a central processor, at least one serial synchronous interface and a DMA controller to transfer data without disturbing the central processor every time data needs to be sent.

4.2 Analysis of Patent Liability

Analysis of Patent No. 6112235 [10]:

This design is similar due to the fact that it uses the method for remote management of a network hardware device. There is a possibility of literal infringement as all the claims made in the patent are applied to the SLOW design. Our design configures an embedded server on a network hardware device. The SLOW design has many more features than this patent but does not eliminate infringement possibilities and measures will have to be taken to change a little bit of the implementation to avoid those issues.

Analysis of Patent No. 6580404 [11]:

This design performs substantially the same way as the SLOW. Hence, patent infringement through the doctrine of equivalents [13] comes into play. Even though this design connects the modules in series where as each of our module is connected directly to the microcontroller, much of its implementation details and functionalities are similar. The design also uses two RAM devices where as the only RAM our project uses, is the one located on the microcontroller. But on the whole, the design is targeted for the same functionality. As there are a number of patent claims with LED Dot Matrix Displays, even a slight difference in them may be enough to avoid infringement.

Analysis of Patent No. 5977937 [12]:

This design can also fall under the infringement through the doctrine of equivalents [13] as some of the claims made are equivalent as we are also using a central processor and a number of synchronous serial interfaces. But since some of the claims are different as we don't use a DMA controller or any storage members other than the shift registers in the micro controller. The design uses the DMA controller so that it can display data without using the central processor, where as need to use the central processor to send any display signal. But, again since the overall functionality most of the implementation is the same, it could fall under an infringement.

3. Actions recommended

Since there exists literal infringement on one of the patents, the only action would be to pay the royalty fees associated with that particular patent. The other patents which we found are quite different from the way our design work and so, we might have to just redesign little bit of the current design to avoid any infringements from the patents listed above.

The best way to avoid infringement, however, would be to investigate patents during the early design stages of the product. Paying royalties is usually not the best course of action. Designing around patents from the beginning assures no patent liability or lengthy court cases to decide whether or not the product can be marketed.

4. Reliability and Safety Analysis

One way to analyze the safety and reliability of the whole design is to split it into each component based on its functionality; and then analyze what could be a failure risk and what are the possible causes of that failure. The major components of this project are the power supply, 5V and 3.3V circuits, the microcontroller, LED panel circuit, temperature sensor, Ethernet circuit, and logic level translator. In the following section, the probability of failure of each of these major components will be analyzed.

The model used in the analysis is based on the Military Handbook for Reliability Prediction of Electronic Equipment [14]. A high criticality level means that the failure of the product can result in injury to the user and is defined as less than 10-9 failures per hour. For a low criticality level, the user is not harmed and the portion of the product might not usable, this type of failure is defined as less than 10-5 failures per hour of operation.

5.1 Reliability Analysis

There are four components of this project that can be considered most likely to fail; the 12V to 5V power regulator circuit (MAX831) [15], 5V to 3.3V low-dropout fixed-voltage regulator (TLV2217-33) [16], the microcontroller (MC9S12NE64) [2], and the temperature sensor (DS18S20) [5]. These components were chosen as they have the highest possibility of generating a large amount of heat within the circuit and are more likely to cause malfunction to the circuit than other parts. Using the MIL-HDBK-217F Military Handbook [14], the predicted number of failures per 106 hours of operation (λp) of each component can be calculated as discussed later in part 2.1 – 2.4. Each parameter is defined as following.

λp = part failure rate

λb = base failure base

C1 = die complexity failure rate

C2 = the package failure rate

πT = temperature factor

πE = environment factor

πQ = quality factor

πL = learning factor

1. 5V Power Regulator (MAX831) [15]

λp = (C1 πT + C2 πE) x πQπL

C1 = 0.04 (Assumed linear bipolar with 301-1000 transistors)

C2 = 0.0072 (Assumed nonhermetic SMT, Np = 16 pins)

πT = 58.0 (Tj = 125 oC, linear bipolar)

πE = 2.0 (Assumed GF – Ground Fixed)

πQ = 10.0 (Assumed other commercial product)

πL = 1.0 (Assumed more than 2 years in production)

Result:

λp = 23.344 Failures / 106 hours

MTTF = 1/ λp = 0.04284 x 106 = 4.284 x 104 hours ~ 4.89 years

Conclusion:

This part was chosen for the reliability analysis due to the fact that it is a vital part to the functionality of the design as it converts the 12V DC power from the power adaptor into the required regulated 5V and supplies that power to the majority of the components. If this part happens to fail, the results may be unpredictable. As for the failure analysis, the result of MTTF = 4.284 x 104 hours is considered acceptable. The addition of a fuse between the 12V line and the regulator would help greatly in the case of a sudden power surge from the power outlet and/or power adapter.

2. 3.3V low-dropout fixed-voltage regulator (TLV2217-33) [16]

λp = (C1 πT + C2 πE) x πQπL

C1 = 0.04 (Assumed linear MOS with 301-1000 transistors)

C2 = 0.0012 (Assumed nonhermetic, Np = 3 pins)

πT = 180 (Tj = 150 oC, linear MOS)

πE = 2.0 (Assumed GF – Ground Fixed)

πQ = 10.0 (Assumed other commercial product)

πL = 1.0 (Assumed more than 2 years in production)

Result:

λp = 72.024 Failures / 106 hours

MTTF = 1/ λp = 0.01388 x 106 = 1.388 x 104 hours ~ 1.58 years

Conclusion:

This part was chosen for the reliability analysis due to the fact that, similar to the 12V to 5V circuit, it too is a vital part to the functionality of the design as it converts the 5V power from the regulated 5V power circuit into the regulated 3.3V which the microcontroller needs in order to function properly. If this part happens to fail, the microcontroller will either cease to function due to lack of power input or due to damage dealt to it. As for the failure analysis, the result of MTTF = 1.388 x 105 hours is considered acceptable.

3. Microcontroller (MC9S12NE64) [2]

λp = (C1 πT + C2 πE) x πQπL

C1 = 0.28 (16-bit microprocessor)

C2 = 0.041 (Assumed nonhermetic SMT, Np = 80 pins)

πT = 3.1 (Tj = 125 oC, digital MOS)

πE = 2.0 (Assumed GF – Ground Fixed)

πQ = 10.0 (Assumed other commercial product)

πL = 1.0 (Assumed more than 2 years in production)

Result:

λp = 9.5 Failures / 106 hours

MTTF = 1/ λp = 1.0526 x 105 hours ~ 12.02 years

Conclusion:

The microcontroller plays a crucial role in the functionality of the LED panel because it is the brain of the circuit and controls all its peripherals, especially the LED display. It is imperative to ensure reliability of this component otherwise the product will be considered obsolete. Failure of this device may not directly pose as a safety issue because of the fact that it cannot be as much a fire hazard as the power circuits. As a result of this, the microcontroller can be considered to have a low level of criticality; therefore, MTTF of 1.0526 x 105 hours is adequate.

4. Temperature Sensor (DS18S20) [5]

According to the Product Reliability Report for DS18S20 [17], the failure rate is found to be 4.5 and MTTF is 25120 years.

Conclusion:

The temperature sensor was selected because if it is improperly placed near a hot surface, it may absorb heat and bring that heat back to the circuit board. This could cause serious damage to the unit.

5.2 Failure Mode, Effects, and Criticality Analysis (FMECA)

The design consists of seven component blocks as shown in Table 5.2.

(PA) 5V power supply circuit

(PB) 3.3V power supply circuit

(M) Microcontroller including the oscillator

(L) LED display panel circuit

(T) Temperature sensor circuit

(E) Ethernet circuit

(V) Voltage level translator circuit

Table 5-2. List of component blocks for the design.

The criticality level for this design is considered as the following:

Low Criticality (10-9 < λ < 10-6): At this level of failure, it is unlikely to cause injury or physical harm to the user. In the worst case scenario, the unit may either function unpredictably or just simply not function at all. It only increases the dissatisfaction of the user towards the product.

High Criticality (λ < 10-9): This level can be considered dangerous if operated by the user due to the fact that any failures of the product at this level can cause personal injury or serious harm to the user. This level may also be harmful to its surroundings as it may produce heat or be a fire hazard. Failures at this level are unacceptable and should be fixed and further tested before distribution into the market.

The FMECA chart describing all failure modes, possible causes, failure effects, method of detection and criticality level can be found listed in Appendix H.

5. Ethical and Environmental Impact Analysis

As mentioned in the IEEE code of Ethics “engineers must “accept responsibility in making engineering decisions consistent with the safety, health, and welfare of the public, and to disclose promptly factors that might endanger the public or the environment.”[18]. It is the duty of every engineer to pay close attention to the ethical and environmental challenges that could be caused while designing the product and delivering the product to the market. There are a couple of ethical challenges that the team faced which are discussed in the ethical impact analysis section of the report. Also some environmental challenges like disposing the printed circuit board have also been taken into concern by the team.

6.1 Ethical Impact Analysis

A thorough testing of any new device under a wide range of operating conditions is essential to ensure that the device operates as expected in all conditions. If any conditions under which the device might malfunction, attempts should me made to rectify those errors before getting the product to the market. And if those errors cannot be rectified without hindering the basic functionality of the product, such operating conditions should be made public with appropriate warnings. The following paragraphs explain the various issues to prevent ethical problems caused by the SLOW project.

As we use a LED panel to display messages through the internet, we have not come up with a mechanism which can restrict users from displaying messages that may cause distress amongst a certain community. For example, a person living in the Middle East could setup a network of these LED panels in the United States and have the liberty to display any kind of message including propaganda, slander or libel which may lead to havoc in the American society. The only solution to the problem would be to ask the customers buying this product to sign an agreement that restricts users to display messages that may affect the society.

The maximum amount of heat dissipated will be determined by operating the product at extreme operating conditions. This will help in ensuring that no component in the SLOW design gets so hot that it poses a danger of fire. Proper vents on the packaging and appropriate heat sinks have to be used, if required, to avoid such disasters.

Proper labeling needs to be done if the device would ensure that the user is informed about important things that should be considered when operating the LED panel. Hence various labels would be placed on the packaging of the LED panel. A warning label will state the danger of the electrical components inside of these boxes being potentially hazardous to individuals servicing these enclosures. The warning label will also state that the wall power supply should be disconnected before servicing to prevent an electrical shock. Labels asking the users to not touch the components which may get very hot while in operation. This would help in avoiding any human injuries. The user will also be asked not to tamper with the LED display as it may result in malfunctioning or cause any bodily injuries. As we have a 12V power supply in our design, we require a label for users to have the correct power supply fed to the circuit. An incorrect power supply may result in malfunctioning of the device and can cause harm to the users. Another warning label would be on the Ethernet jack which requires users not to use any standard or cross over cable as it may result in improper functioning of the device.

A detailed user manual will be supplied with the product which will comprise of an explanation of all the features, installation guidelines, points of caution while using the device, extreme operating conditions, electrical characteristics, recycling the device and troubleshooting guidelines. Some mechanisms have been added to the device for proper functioning and safety of the user. A reboot switch will be placed on the device in case of malfunctioning. A self check routing will also be incorporated into the software of the unit to check all the components when the device is powered up.

2. Environmental Impact Analysis

The SLOW project has potential environmental hazards and proper steps should be taken to minimize them if it goes into commercial production. The main precautions are needed to be taken by the manufacturer, but there could be environmental impacts during the normal use and the disposal of the product. We will be discussing few precautions which should be taken to make this product as environment friendly as possible in the following paragraphs.

Manufacturing:

Creating a Printed Circuit Board generates a substantial amount of hazardous waste which can have adverse affects on the environment. The process includes chemical processes like etching, development, and photo resist applications. During each of these processes, there will be chemical wastes [21] that need to be disposed with appropriate methods [19]. Certain measures can be taken by both the Board designers and manufacturers to minimize these chemical wastes. Although the SLOW team is not responsible for the fabrication of the pcb, it is our duty to choose a environment friendly and a reputed company to get it done. Following are the suggestions given by the EPA [20] like reclaiming the etchant and recycling the photo resistant strippers that can help reducing the waste to a great extent.

Normal Use:

The product holds negligible threats to the environment during the normal use as it does not hold any kind of batteries. No harmful substances are being released from the product other than heat from the lit bulbs on the LED panel. The other precaution that can be taken is to turn it off when its not in use to minimize the power consumption and save energy.

Disposal:

The proper disposal of the product after its life span is also an important concern as it uses all the non degradable components. Although it’s in the hands of the user to decide how to dispose the product, as a manufacturer of the product it’s our duty to make a suggestion to the user for proper disposal of the product.

The PCBs consist of materials such as lead, mercury which are classified as hazardous and therefore they should be disposed properly. They can be processed to recover materials like silver, copper, lead and gold [22]. There will be a sticker placed on the packaging to suggest the user to dispose or recycle the PCB with a reputed company. The aluminum packaging of the product also needs to be disposed appropriately so that it can be recycled [23]. The recycling places for aluminum are located locally all over the country and it is necessary that the packaging is given there as aluminum holds great environmental hazards if not disposed properly.

6. Packaging Design Considerations

7.1 Commercial product packaging

7.1.1 2 Line iBrite (1006-R1-16x96) [24]

The 2-line iBrite screen is an 8 inches x 39.5 inches x 4.5 inches LED screen using a 10mm pitch that provide a high resolution text and graphics. This product comes with an attractive light weight aluminum cabinet which looks great in most retail environments and also makes it rugged. The exposed pixels make it viewable from even tinted windows.

[pic]

Figure 7.1.1. Line iBrite (1006-R1-16x96)

The advantage of 2 Line iBrite [24] is that it has two display modes, namely multiple line display mode and single line display mode. It will display 3” characters when in multiple line display mode and display 6” characters when in single line display mode. Aside from the display modes the aluminum cabinet also makes the unit strong and rough for durability. The disadvantage, however, is when displaying text in multiple line display mode, the text will not be as clear and easily readable from a distance as when displaying text in single line mode.

Similar to our design, the same super bright red LED’s are used to help make the screen bright enough to be read from a considerable distance. However, this product differs from ours in the fact that it has more memory for storing messages, it also has different modes and text transitions whereas ours has limited memory and only supports text scrolling.

7.1.2 Tri-Color, 16 Char. Single-Line Message Sign w/ IR (EDV111-780-M) [25]

This product is designed for outdoor usage rather than for indoors. It has the same text scrolling feature as our design and it has enough memory to store up to 100 messages or approximately 7000 characters. It is capable of displaying 16 characters at a time and each character can be displayed in 3 different colors. The dimension of the board is 27.5 inches wide 4 inches high and 3 inches deep which we consider too large to be placed in a room.

[pic]

Figure 7.1.2. Tri-Color, 16 Char. Single-Line Message Sign w/ IR (EDV111-780-M)

An interesting addition to this product is that it has a scratch resistant black powder coat finish designed to protect the display. The integrated graphics and remote control make text or logo creations simple for a novice user. The downside to this product is that is not very cost-efficient and that also if the remote control is lost it will be very inconvenient to change the display for it has to be done manually on the panel.

We got the idea of text scrolling from looking at this product so we thought it would be a nice feature addition. This product is fairly similar to our design in that it has the same kind of features and that its packaging allows for better text visibility. It is also similar in the fact that this product uses an IR remote to program it whereas our design uses a web based server. However, our design is a much less expensive option because we created a simpler version of the same idea – to enhance text visibility.

2. Product packaging Specifications

The design will be packaged within an aluminum box about 17” long, 4” high and 3” wide, with a weight around 3.4 lbs. It is designed in such a way so that it can be mounted on a wall easily using the mounting holes behind the box. The power button is placed at the bottom instead of at the front panel because it would be easier for the user to press it from below than trying to reach it on the front panel. The power adaptor and RJ-45 port are placed at the top of the box opposite to the power button. The front panel will consist of ten 5x7 LED dot matrices which can be viewed and read from a distance of up to about 25 feet. The temperature sensor portal is positioned at the side of the box so that the user can extend it to the nearest window or opening for measuring the current temperature outside. .

3. PCB (Printed Circuit Board) Footprint Layout

Our design consists of 3 major components: the microcontroller [2], the LED panel and the digital thermometer [5]. Since we also have shift registers [7] and Darlington transistor [8] that are quite sizeable, their placement on the PCB should be well thought of as well. We will be using a double-sided PCB which will in turn make our design a little more compact. On the front side we have the cascaded LED matrices and since the PCB will be stuck towards the front panel, the rest of the hardware components will have to be on the back side. On the back side we have the microcontroller sitting at the very middle with shift registers and Darlington transistors on the opposite side of the LEDs, towards one of the corners in the clear area of the back side we can find the power button, and power socket and in the rest of the clear areas we will see the voltage regulator circuit for the microcontroller and the temperature sensor connection. The RJ-45 port is placed as close as possible to the microcontroller in the middle of the board. Seeing how the LED panel will be our limiting factor for the package’s length, we can say that the length dimension of the PCB is just a little over the length of the LED panel (15”), roughly 16” should suffice. And as for the height, we need to fit the shift registers, Darlington transistors, power and RJ-45 ports and microcontroller on it, an estimated size of 3.5” high should be enough.

7. Schematic Design Considerations

8.1 Theory of Operation

8.1.1 The Microcontroller (Freescale MC9S12NE64)

MC9S12NE64 is used as the central brain to drive all the major components in the circuit. Most of the pins on MC9S12NE64 are used as general I/O pins. The circuit specifications for the background debug, and RJ-45 connections were provided in the microcontroller datasheet [2]. Since the microcontroller will not be supplying power to the LED panel, the operating frequency of 25 MHz [3] and the operating voltage of 3.3 V was determined by the microcontroller datasheet [2]. Microcontroller will be serially interfacing with a Toshiba constant current LED driver which will be connected to one of the 10 LED blocks on the panel. The same process will be repeated for all the LED blocks. All the pins of the microcontroller will be first connected to the headers to take care of the unused pins.

8.1.2 Power Supply Design (MAX831, MAX832 DC-DC Step-Down Converters and Regulators)

The majority of the components on the LED panel are powered at +5VDC. The only component that is powered at +3.3VDC is the MC9S12NE64 microcontroller. The power supply will be constructed with a +12VDC at 1500mA AC to DC power adapter that will be responsible to convert the AC voltage from the power outlet to DC [26]. Then this +12VDC input will be fed into the step down DC-DC regulator chip. The real voltage from the AC-to-DC adapter as suspected was greater than advertised, it was measured to be ~+15VDC. This problem was overcame by choosing the DC-DC regulator to have a variable input voltage from 8-40VDC. The MAX831 chip converts a DC input from 8-40VDC to a steady +5VDC.

The typical operating circuit for chip was available in the MAXIM data sheet [15]. From specs it was also noted that clip-style heat-sinks and wide copper traces to connect the leads to reduce thermal resistance and dissipate heat have to be used. The chip has a maximum thermal temperature of +125ºC so it was a perfect fit for our design as our input DC voltage of ~+15VDC at continuous load current produces a temperature of 50-70ºC from spec.

To achieve a regulated voltage 3.3V, the 5V output from the MAX8331 will be fed into TLV2217 voltage regulator [16] which will output the required voltage by the microcontroller.

8.1.3 LED Drivers (Toshiba TB62708N)

The TB62708N is specifically designed for LED display applications. The device has 16 Bi-polar constant current output source channels, but we will be using only 12 of them as our LED block only has 12 pins (7 rows and 5 columns) and includes CMOS shift register and latch functions. The LED drive current is programmed by the installation of a single resistor with the value of 1.8Kohm per device [6]. Current is programmable from -5 to -90mA and is held constant across all 16 source outputs effectively compensating for the inherent circuit and component variables which affect the brightness of the LEDs [6]. We will be programming the current source to -15mA as the average forward current per dot is 13mA. The TB62708N has an input clock, serial in, latch and output enable connected to the microcontroller through the MAXIM voltage translator [12] as the voltage requirement of the LED Driver is higher than the microcontroller’s output. We will be sending 12 bits in 12 clock cycles by keeping the latch high and then latch will be pulled low in the 13th clock cycle and the enable will be pulled high to turn on one whole column of the block. The process will be repeated 5 times to refresh the whole panel as each block has 5 columns.

8.1.4 Darlington Transistor Array (ULN2003A)

ULN2003A is a high-voltage, high-current Darlington transistor array consisting of seven npn Darlington Pairs [10]. It features high-voltage outputs with common-cathode clamp diodes for switching inductive loads. The collector-current rating of a single Darlington pair is 500mA which is in excess of the requirement as the maximum current we will need to sink will be about 105mA if all the seven LEDs in one column are on as about 15mA will be sent to the each LED[10]. The transistor is driven by the Toshiba LED driver which sends a one for the column needed to be sunk and the npn Darlington pair collects the current from that column. The transistor does not need any power to run on and it just has one pin going to the ground other than the input and the output pins and a COM pin for testing.

8.1.5 Dot Matrix LED Displays (LTP-2157AKR)

The LTP-2157AKR is a 2.0x1.5 inch 5x7 bright red dot matrix display with grey face and white segments. The LED display has cathode columns and anode rows and for that reason the columns are connected to the Darlington transistor to sink the current. The average current required by a LED dot equals 13mA which will be provided by the programmable Toshiba LED drivers. Ten of these Dot Matrix LED displays will be cascaded to make the panel and the scrolling feature will also be implemented by shifting the columns every 1/3rd of a second.

8.1.6 Temperature Sensor (DS18S20)

Temperature sensor will be used to monitor the temperature outside or inside the room depending on where it is placed. It sends 9-bytes data serially to the I/O pin of microcontroller to display the current temperature on the LED panel. But to do that it first has to get initialized from the microcontroller and then receive series of commands to start working [5]. It has a capability of measuring the temperature ranging from -55 to +125 degree Celsius (-67 to +257 Fahrenheit). This temperature sensor has 3 pins; one is connected to an internal 5V power supply, one to ground, and the last one serves as the data line and is directly connected to the microcontroller. Microcontroller then reads the analog data and converts it into the digital signal so that it can be displayed on LED panel if the user requires it to be displayed.  

8.1.7 16-Channel Buffered CMOS Logic Level Translator (MAX1310E)

The voltage translator is used to step up the voltage output of the microcontroller as it outputs a voltage of 3.1-3.3 V [2] and the minimum required by the Toshiba LED Drive is 3.5 Volts for a high [7]. So, the Vcc pin of the translator will be connected to a 5V power source and the VL will be connected to the 3.3V power source [16]. By doing that we can connect the microcontroller outputs to the VL[1-13] pins and connect the LED driver to the Vcc[1-13] pins as the Vcc pins will be outputting the stepped up voltage.

8. PCB Layout Design Considerations

Our project used a double-sided PCB so that we can place the LED panel on the front and have all the other components on the back of the board making the size of the whole system look compact and organized. The system will be operated by a 12V DC adapter [26] that will be regulated down to exactly 3.3V for the microcontroller [2] and 5V for all the other internal components. Special emphasis has been made on reducing EMI, trace widths, signal routing, footprint design and board size constraints. Using the Design Rule Check function, we are able to make sure that our PCB is viable in that all the traces are of an appropriate width, enough space in between traces, and other PCB checks.

1. PCB (Printed Circuit Board) Layout Considerations

A lot of considerations need to be made for the PCB layout to be successful. One of the goals to produce a successful PCB layout is reducing EMI as much as possible. A digital signal error could cause an input pin to read a ‘high’ value instead of a ‘low’ value, which potentially could prevent the circuit from working correctly. Problems caused by EMI can give us a lot of difficulty in debugging so it is important that we take proper care to reduce as much EMI as possible.

One of the physical constraints is the size of the board. There was an unexpected change in PCB width because the shift registers and Darlington transistors ended up taking up a lot of space, so extra room was needed. In this extra space we allocated, we would be able to place all the other analog components such as resistors and capacitors and even the microcontroller without much trouble. The original planned overall size of the design’s package was to be about the same size as the cascaded LED’s but in the end resulted in a board size of 15x4 inches. As discussed earlier, our main concern was to have the LED panel on the top of the board and have the rest of the components on the backside of the board. Another consideration to look at would be the fact that the LED panel would cover the entire front of the PCB, making a number of components through-hole which imply that we would need solders on the front side, therefore making it difficult to remove components for which the LED’s would have to be removed first. The microcontroller was placed at the center of the board with its pins facing in directions convenient for routing to its analog components such as the RJ-45 jack. The header is also placed in an area to make it easier to route to the shift registers.

The analog components that we have included are namely a 25 MHz crystal oscillator, a high voltage-high current Darlington transistor array [8] and a number of capacitors and bypass capacitors. Many of these components were required because they were specified as the minimum external circuitry for proper functionality of the MC9S12NE64 as stated in its datasheet. As these components are to be placed closer to the microcontroller, we made sure that they had short traces and also be correctly configured as per the microcontroller’s data sheet diagrams [2].

One of the most important concerns in the PCB layout would be the power supply circuitry. As we have two DC regulators which generate two regulated voltage of 3.3V and 5V. The 3.3V is only used by the microcontroller and the 5V is used by the rest of the circuit. For the layout, we made sure that the power regulators are kept on the top left corner of the board to prevent interference with the digital components and also the analog part of the circuit. Another reason would be the power dissipation by the regulators, so we left a lot of room around them for the regulators to dissipate heat. Trace widths have to be thick where needed for the power and ground signals to make sure the entire circuit gets enough current. When connecting a power or ground signal to a pin, the trace size is gradually decreased down to the size needed for the connecting point and this is actually done very near to the connecting point so as to ensure proper functionality.

As for the microcontroller, its external circuitry also required special attention as according to the data sheets. For optimal functionality of the MC9S12NE64, its bypass capacitors, PLL filter circuit and crystal all need to be as close as possible to the microcontroller without any vias. Lastly, the Ethernet, the RJ-45 also needs to be within 1 inch of the microcontroller pins, without using any vias, and while keeping the traces roughly around the same length. This is to make sure that no noise interferes with the Ethernet controller.

9. Software Design Considerations

The MC9S12NE64 80-pin TQFP package [2] features 64K bytes of Flash EEPROM, 8K bytes of SRAM, Ethernet media access controller (EMAC) with integrated 10/100 Mbps Ethernet physical transceiver (EPHY), and other standard on-chip peripherals. This 64K bytes of Flash EEPROM as originally anticipated is going to be a constraint for the software part of the project since there are a few things to take into account. We have chosen to do a mixture of C code, with the aid of CodeWarrior, and assembly code to implement our algorithms for the LED panel. Programming in C shortens the number of lines we will code and simplifies things to an extent while assembly can easily be done as well due to our familiarity with the HCS12 family [1], this is why we chose to program in both languages. The code itself will be of considerable length due to certain libraries we will need to include in C such as stdio.h and string.h, the code for the embedded web server, and lookup tables that will be built for converting individual ASCII characters to sets of binary data to be sent to the shift registers for text display.

The SRAM will be used for the stack and for all the dynamic variables used throughout the program but are not of immediate use after a reset or boot-up. According to the MC9S12NE64 datasheet [2], the SRAM is mapped to address location $0400 - $2000, within this 8K byte area, our program's variables and other non-static information will be mapped to the beginning of this address space starting at $0400 whereas the stack would be mapped to the end starting at $2000 decrementing the address as more data is pushed onto it. The 64K byte Flash EEPROM is mapped to the addresses $4000 - $FFFF where the interrupt vectors may be found towards the end of flash. Important interrupt vectors to be noted are: $FFF0 for RTI, and $FFE0 for standard timer channel 7. Starting at address $4000, static data will be mapped first. These include a sizeable amount of memory allocated for the table lookup values and then the character arrays that will be used by the RTI algorithm for displaying on the display panel. The table lookup section contains five hex values for each ASCII character, these hex values represent the dots that are on within that column. The character array for temperature and time are set however the size for the message array could vary based on preference. Obviously increasing the array size uses more of the microcontroller’s memory.

The following section is the main of the program. This is comprised of register initializations, default settings, and it will play a role in the “context” switching of the program from one mode to the next, given that there are three modes: message display mode, time display mode, and temperature display mode. It was decided that the microcontroller would be run in Normal Single Chip mode. The remainder of the flash would used for the rest of the program code. Lookup table + static arrays + miscellaneous = ~ 500 bytes, main code including all subroutines and interrupt routines = ~ 4-5 Kb, web server code = ~ 5 Kb. Estimated total space used on non-volatile flash memory = 500 +5000 + 5000 = 10.5 Kb, which is still only a sixth of the total memory capacity for the NE64. Memory will not be too much of an issue since there is plenty to work with, the same also can be said about the SRAM since it is mainly used for stack and there is 8Kb of space.

A useful feature of the MC9S12NE64 [2] is its ability to perform field reprogramming of its 64K byte Flash (non-volatile) memory without requiring external programming voltage sources. This will be used for saving new information we receive from the embedded web server onto flash for the purpose of maintaining its previous state in case of a power failure or system shut down.

The actual program code will start with the initializations, register settings, clearing of SRAM variables, timer module, temperature sensor [5], Ethernet initializations, and finally clearing the interrupt bit wherein all interrupt-based routines will begin to function. The LED panel will be initialized by first setting up the RTI system that controls its three main signals, namely the clock, strobe and output enable. A value of '0' will be sent to all the shift registers via the RTI controlled signals which in turn will basically “clear” the message panel and start refreshing at a certain interval controlled by RTI. There are two pieces of information that will be saved in flash: the current message and its current display mode (message/time/temp). The program flows based on the current display mode and changes as soon as the mode is changed. For message mode, each ASCII character of the user inputted string will give its corresponding five element hex array as according to the lookup table and these values will be saved into a temporary 50 element array located in the SRAM which the program constantly reads and outputs to the shift registers when appropriate. The embedded web server will also be interrupt-driven in that we will be checking for new user input at a certain interval controlled within the RTI routine. If a user had changed something, that new configuration would be saved in the specified non-volatile flash locations using a mid-program flashing algorithm and be reflected on the display panel. If in case there was no change and the configuration was previously set to message mode, the text, regardless if the message is longer than ten characters or not, will scroll on the LED panel. The time mode will be interrupt-driven using Standard Timer Channel 7, but the time will be saved onto an SRAM array location instead of flash since time is constantly changing and updated on the LED panel real-time. As for the temperature modes, this routine will just be called upon when we need to check the value of the sensor, it could either be in the RTI algorithm or in the main itself with a delay function immediately following it. This too will be saved onto an SRAM array location due to similar reasons as the timer. Another important function of the web server is the option for the user to set the current time for the digital clock. In the case of a reset, the clock would be set according to the first packet received from the web server. Once set, the new time will be updated within the timer module by simply overwriting the SRAM array location. At the end of this cycle, the program then loops again indefinitely until system shut-down or reboot. See Appendix A for the main program flowchart illustrating what the program does when it is run.

1. Software Design Narrative

Looking at the hierarchical diagram shown in Appendix B, the Main represents the main program itself that calls upon all the internal functions/subroutines and handles the initial flow of the code. After its first run, the flow of code will rely on the value of the variable “mode” to determine what will be displayed on the display panel. Both RTI and timer routines along will be running at all times in the background, whereas the temperature sensor [5] and web server will only run when called upon, this makes it easy to output because the data will always be ready for when there is a “context” switch between display modes. The main first handles the initializations and thus calls the functions “rti_ini” and “tim_ini” to set dynamic variables and certain registers to their default value before the interrupt routines are started. Then the main calls “ldarray” to load the 50 element temporary array with hex values for the RTI routine to read when it is first called. “ldarray” calls upon “ldnxtad” to request the address of the hex values for the next character that needs to be displayed based on the lookup table. Both interrupt routines begin as soon as the interrupt bit has been cleared (cli).

The RTI interrupt service routine (rti_isr) is the main function for the message display and general display, it is responsible for retrieving a string of text depending on the mode and display it accordingly on the LED panel. “rti_isr” makes calls to routines “shfdat0” thru “shfdat9” which are responsible for shifting 1 bit of data to each of the shift registers on the board. “shfdat0” thru “shfdat9” get its data from the 50 element temporary array located in SRAM that contain the hex values for each ASCII character to be outputted, and these routines are called exactly 12 times as we need to shift 7 bits of data to the rows and 5 to the columns. On the 13th run, the output enable signal will be set low signaling the shift registers to output all 12 bits which translate to a one column of LEDs turning on. Once we have refreshed an entire LED block, “rti_isr” will call the “scroll” function, however this only applies to message display; the scroll function is off when displaying time or temperature. “scroll” simply shifts all the data in the 50 element array to the left by one and takes in a new value based on the character and column in that character that needs to be displayed next.

The time interrupt service routine (tim_isr) is the main function for the digital clock display. It begins with a default time of 12:00PM and counts as if it were a highly accurate clock. This function basically performs a task every second, and during each second, the time is converted into such that the RTI could read and display onto the LED panel, specifically into an array of ASCII characters. The only routine that “tim_isr” calls is “htoa” which converts a number or letter to its ASCII equivalent hex value.

The DS18S20 sensor [5] is called as a subroutine “Tsense”. Whenever called, it will return the temperature (in Celsius) in ASCII format into a temporary array in SRAM where the RTI can also read and display to the LEDs. This routine calls smaller routines to perform simple tasks, this helps organize the code a little more. “DSReset” sends a reset pulse to the DS18S20 and waits for a presence pulse response from the sensor. “putbyte” opens write slots and sends a byte of data serially to the sensor. “getbyte” works in conjunction with “getbit”, they are responsible for retrieving a byte of data from the DS18S20’s internal scratchpad. For the purpose of this project, only the first two bytes of the scratchpad will be read, then it will be interrupted with a reset pulse. The first byte represents the least significant byte of the temperature and the second byte represents the most significant byte serving as an indicator whether the temperature is negative or not.

Similar to the digital thermometer, the web server will be called separately when we want to poll for new data. This routine is responsible for the proper control over the embedded server and constantly checks if a user had changed anything on the server webpage and returns this information for the Main to use. Most of the code for the web server will be taken from the C code provided within the MC9S12NE64's documentation [28] found at freescale’s website and linked to the assembly files.

Lastly, a subroutine called “wflash” will be called after getting new information from the web server. This function handles saving the new data onto a specified array location that the RTI can read for display. This is done so that the system would be able to remember its most current condition at the time right before reset or power down. In the case that the user sets the clock via the web server, that time value would be applied to the running timer module and immediately reflected onto the display panel. The code for each function will be fully tested onto an MC9S12NE64 Demo Board [29] before being downloaded to the actual microcontroller on the PCB. See Appendix B for the code module hierarchical diagram for an illustrative view on all the implemented routines.

10. Version 2 Changes

Further improvements could still be made on our design. By reorganizing all the parts on our PCB, selecting smaller parts, or by designing a PCB with more than two layers, we would be able to reduce the size and weight of our product. The power supply could be changed so that we would not have to use a 12V power adapter. Some new features could be added to the design, such as infrared used with a remote control for toggling the display modes, or a keyboard input for manual text modification without the use of a computer. The LEDs could be changed to multi-colored LEDs and different transitions could be programmed and added to make the design a little more interesting to look at.

Summary and Conclusions

Project SLOW creates a system where a user can log in to a web server to change the text being displayed on an LED panel. There were several issues to be taken into consideration while designing SLOW. Power, hardware, software, interfacing issues that all contribute to the functionality of the project. Patents also needed to be researched to make sure that our product does not infringe on any existing product already out in the market. The reliability and safety of the product play a big role in any design, no customer would want to purchase a product that either does not last long or is potentially harmful to the user or to the environment. The packaging of a product can improve its attractiveness and possibly lead it to being in demand depending on how well it is done. As we have seen, there are many PCB considerations to look at as well. Poor PCB design could lead to a non-functional board. Last but not the least, good software design also takes role in how well the system runs to ensure consumer satisfaction. All of these factors have been taken into account in the design of SLOW. As a result, we were able to successfully complete three out of the five success criterias we originally planned.

References

1] MC9S12NE64 Product Summary Page,



2] MC9S12NE64 Data Sheet,



3] Implementing an Ethernet Interface with the MC9S12NE64,



4] RCM3750 RabbitCore,



5] DS18S20 Data Sheet,



6] Digi-, LITE-ON INC LTP-2157AKR Data Sheet,



7] Toshiba LED Panel Driver TB62708N Data Sheet,



8] Darlington Transistor Array ULN2003A Data Sheet,



[9] 16-Channel Buffered CMOS Logic-Level Translator MAX13103E Data Sheet,



1. [10] US Patent 6112335

'embedded+server'.TTL.&OS=TTL/

[11] US Patent 6580404



[12] US Patent 5977937

2.

3. [13] “Doctrine of Equivalent”, [Online Reference], 2006



[14] MIL-HDBK-217F - Military Handbook of Reliability and Prediction of Electronic

Equipment,



[15] 5V Power Regulator (MAX831) Data Sheet,



[16] 3.3V LDO Linear Regulator TLV2217 Data Sheet,



[17] DS18S20 Product Reliability Report,



[18] IEEE Code of Ethics



[19] Inner layer Process Fabrication



[20] Printed Circuit Board Manufacturing Pollution Prevention Opportunities Checklist



[21] Fact Sheet: Printed Circuit Board Manufacturers



[22] Printed Circuit Board Recycling



[23] Aluminum Recycling



[24] 2 Line iBrite (1006-R1-16x96),



[25] Tri-Color, 16 Char. Single Line Message Sign with IR (EDV111-780-M),



[26] Wall Wart 12V DC adapter



[27] System Design and Layout Techniques



[28] Basic Web Server Development with MC9S12NE64 and CMX-MicroNet TCP/IP Stack,



[29] MC9S12NE64 Demo board,



Appendix A: Individual Contributions

A.1 Contributions of Chanon Sujjapong:

I was selected as the team leader; therefore, I was responsible for arranging the meeting time, ensuring that all assignments were completed and submitted in time, splitting tasks among members, contacting course staff in case we had a problem regarding to our project, informing all team members about the status and plan of the project, encouraging all team members to participate as many meetings and lectures as possible, and keeping harmony among members within the team. And since I hardly missed any classes throughout this entire semester, I also informed the team about what was going on during the class time in case any members were missing. Besides these tasks, I greatly contributed most of my free time to make sure that the project was done in time.

For homework assignments, I was responsible for the Packaging Specifications and Design, and Reliability and Safety Analysis. I created the CAD drawing for our packaging design even though I never had any experiences using an AutoCAD before. I spent quite sometimes learning how to use the program. I also learned how to use Orcad Footprint Layout to create the PCB footprint for our design. I fixed all the DRC errors along with selecting and creating the footprint for parts that were not available in the library, for example, 14 pins dot matrix LED display, 30 pins shift register, RJ-45 port, and 5x5 mm 40 pins level translator. I also made the FMECA chart and calculated all failure rates and MTTF of all major components for the Reliability and Safety Analysis homework. I did all of writing for part that I was responsible for by myself and let Randall reviewed before submitting it in. I helped other members for their assignments as needed.

I prepared most of the PowerPoint slides and updated it on the team website whenever we had a TCSP in class. I also gave a presentation in front of the class for all presentations except the Schematic and PCB Layout.

Majority of hardware and software were done by Randall and me. Even though Randall was actually the one who populated most of the parts on the PCB, I aided him and did solder some myself. Originally, I was assigned to work on the hardware part along with Randall; however, since we got it done early but none of the code was available to test with at that time, Randall and I ended up started writing some codes and test them ourselves. And we actually finished the majority part of the code except the webserver. Prior to this, I was the one who figured out how to program the demo board using both a serial and BDM cable. I also constructed the test circuit to test some of our codes and debugging them as necessary. All of software flowcharts and hierarchical diagrams were made by me as well. I also designed how each character on the keyboard will appear on the LED screen and then converting them into hex values based on its column to be used in the code.

A.2 Contributions of Randall Hintz:

From the very first day I was the one who came up with the idea for the cascaded LED dot matrix display. My original idea was making a text display out of Christmas lights but then the Professor suggested a much more practical idea. After hearing the Professor’s suggestion I had a much clearer idea of what to do and I had a general idea of how to implement the whole project. I did the design constraint analysis homework by myself and thought of most of the factors to be taken into consideration, however, since I do not know much about power circuits I had difficulty with that part.

For the circuit design and theory of operation homework, even though this homework was not assigned to me, I ended up doing most of the research on how to use the microcontroller that we chose. I did the entire Orcad schematic and created components that were not in the standard library. I played a large role as well when it came to choosing parts, all my teammates keep asking me questions about things. For the circuit design and theory of operation homework, I helped Varun with all the concepts that he needed to know and I helped him write and expand on his homework because it was not so lengthy in the first place. I also seem to be the spell checker and grammar checker for the group. When I proofread my teammates’ homeworks I always end up rewriting a lot of it, because sometimes there is no quality in their work, so I try to improve them a little.

For the PCB homework, I did the entire PCB diagram in layout plus, my teammates provided some help in creating footprints for the components not found in the library and helped towards the end with fixing the DRC errors. I did all of the component placement and all of the routing. When it came to presentations, Bank and I always ended up speaking in behalf of the group since we were the ones that knew the most.

I came up with the entire software algorithm in assembly code since I preferred it over C code and wrote the software design considerations and narrative homework since that part was assigned to me. After our PCB was fabricated, I did almost all of the soldering with the assistance of Bank. There were many problems trying to get the LED blocks to work at first. One of our shift registers was not working, some shift registers did not output the right voltages, there was also a problem with the level translator. Bank and I fully tested the board, replaced parts, fly-wired and re-routed pins and eventually managed to get the whole board working. Everything was soldered by me except for the level translator which Chuck did and a few parts that Bank did.

I wrote all of the code in assembly to get scrolling text, time, and temperature to display on the panel. At some point in time the board accidentally got shorted out due to my clumsiness with handling the aluminum packaging. Bank and I and also Chuck troubleshooted through these problems and eventually got the board back up and working again. I’m the only one who fully understands how text is being displayed on our panel and how to use the temperature sensor because I was the one who did all the software.

A.3 Contributions of Ayush Johari:

Over the course of this semester, I made several contributions to the team in completing the project. At the start of the project, I was involved in research for different parts required for our project and read through their complete specifications to find out if they apply significantly to our project. My other primary tasks were PCB part design, writing software for the web server, completing the packaging and the webmaster for our team web page.

All of our members in the group at the start of the semester began brainstorming difference project ideas, specifically on project features and functionality. As all four of us were computer engineers, we had a hard time designing the power supply/management part of the design. I took the responsibility of designing the power supply and power conservation. As we needed two kinds of voltages 3.3V and 5V for our project design, I had to research about different voltage regulators in the market and choose the most appropriate for our design. I helped Bank in the packaging design homework and also helped Varun with his patent and liability homework (wrote the summary and results of patent search section). Also, I helped Randall in the PCB design as that took us a long to get done with.

Amongst the individual homework assignments, I had to do the Printed Circuit Board design and Reliability and safety analysis homework. The first took me a long time to complete as we had a couple of part changes during the time of my homework. It took me a long to time to get familiar with the software and create parts in the software. Once I had learned how to do that, I was able to design the part with proper specifications. At the end, I was successfully able to complete the homework. For the second homework, it took me some time to understand what exactly to be written for the various sections in the homework but once I had a good understanding, I was able to finish the homework.

I worked a lot in the latter half of the semester. I and Varun completely wrote and debugged the code for the embedded web server, and the code for the LED panel in C. The code for the embedded web server was written using the help from the Freescale MC9S12NE64 microcontroller’s Ethernet solution CD that came with the microcontroller’s package. Writing part of the code from the CD support wasn’t hard but understanding the code and changing the sample code as per our specifications took me a long to get it to work completely. Finally, I worked on the packaging of the product. I got aluminum sheets for housing the LED panel and the PCB and also get equipment and paint to make the complete packaging of the project.

Overall, I really enjoyed doing this course as it provided an excellent learning opportunity to me in the various engineering aspects. From this course, I have learnt how a real world product is simulated and the difficulties an engineer faces while designing the product. I feel that I did a good job for the project but definitely could have improved myself in the various aspects of the course. A little bit of better task planning and better task distribution would have made our team achiever more.

A.4 Contributions of Varun Bansal:

During the first half of the semester I first figured out the implementation of the LED panel design. With the help of the TAs and after updating the circuit about 8 times I finally figured out that we will be using the shift registers to source the current and Darlington transistors to sink the current. Then since I knew all the specifications of the LED blocks, I found out the appropriate parts for the circuit such as the Toshiba shift registers and the transistor we were going to use to sink about 110 Amperes of current. We needed a 12 bit current sourcing shift register and it was impossible to find one. But after a lot of efforts, I finally found the 16-bit Toshiba, and decided to use it as 12 bit shift register. I also found the RJ-45 we needed after going through the datasheet of the microcontroller. So, My major contribution was towards the component selection and the theory of operation during the first half of the semester.

During the second half of the semester I was asked to start writing software to program the LED panel to display the string. So me and Ayush started working on that using C language. But I was waiting for Randall to finish soldering as I had no knowledge of doing that. But ironically soldering took more than 3 weeks which put us behind on the schedule, since I could not make a test circuit using the demo-board to start testing and debugging the software I had written. Then finally once the soldering was done, I found out that Randall had written the code for LED panel in asm and he was not in favor of using C and we had to accept his decision as he was the team leader. Then he gave me and ayush the task of writing all the final documents and work on the web server. So, I and ayush spent a week on getting the web server to work and we also made a nice java application to communicate with the web server. I also made the aluminum packaging for the project with Ayush’s help and we used cardboard for insulating the aluminum from inside.

For the documentation part, I wrote the similar product search for the packaging homework. For, the circuit design and theory of operation I wrote all the theory and I asked Randall to make the schematic as he said he was very proficient with ORCAD, but I drew all the connections for him on paper. I also wrote the patent liability homework with some help from Ayush and in return I helped him with the Ethical and Environmental impact analysis homework. For the final documentation, me and Ayush worked together on the Senior Design report, User manual, poster, and the final report.

Appendix B: Packaging

[pic]

Figure B-1. The three dimensional perspective of the product.

[pic]

Figure B-2 The front perspective of the product.

[pic]

Fig B-3 The bottom perspective of the product.

Appendix C: Schematic

[pic]

Figure C-1. Power Supply Circuit and Temperature Sensor.

[pic]

Figure C-2. Microcontroller Circuit

[pic]

Figure C-3 LED Circuit.

[pic]

Figure C-4 Level Translator.

Appendix D: PCB Layout Top and Bottom Copper

[pic]

Figure D-1 PCB Footprint Layout

Appendix E: Parts List Spreadsheet

|Vendor |Manufacturer |Part No. |Description |Unit Cost |Qty |Total Cost |

| | | | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

| | | | | | | |

|TOTAL |$99.91 |

Appendix F: Software Listing

;*****************************************************************

;* *

;* Team 8 *

;* *

;* SLOW – System of LEDs Operated Wirelessly *

;* *

;* *

;* Randall Hintz Chanon (Bank) Sujjapong *

;* *

;*****************************************************************

; export symbols

XDEF Entry ; export 'Entry' symbol

ABSENTRY Entry ; for absolute assembly: mark this as application entry point

; include derivative specific macros

INCLUDE 'MC9S12NE64.inc'

INITEE equ $00000012

NULL equ $00

;*************************************************************

;*************************************************************

;** **

;** SRAM Variables **

;** **

;*************************************************************

;*************************************************************

ORG $0400

rticnt1 fcb $00 ; interrupt counter

rticnt2 fcb $00

rticnt3 fcb $00

tempcnt fcb $00

tcntr fcb $00

strcnt fcb $00

arindex fcb $00

ledindx fcb $00

index fcb $00

rowbit1 fcb $00

rowbit2 fcb $00

rowbit3 fcb $00

rowbit4 fcb $00

rowbit5 fcb $00

rowbit6 fcb $00

rowbit7 fcb $00

rowbit8 fcb $00

rowbit9 fcb $00

rowbit0 fcb $00

colbit1 fcb $00

colbit2 fcb $00

colbit3 fcb $00

colbit4 fcb $00

colbit5 fcb $00

colbit6 fcb $00

colbit7 fcb $00

colbit8 fcb $00

colbit9 fcb $00

colbit0 fcb $00

darray rmb 50

chaddr fdb $0000

msgindx fcb $00

hours1 fcb $00

hours2 fcb $00

hrflag fcb $00

mins1 fcb $00

mins2 fcb $00

secs1 fcb $00

secs2 fcb $00

ampm fcb $00

mode fcb $00 ; 0=msg, 1=time, 2=temp

Temp fdb $0000

mytemp fcb $00

mytemp2 fcb $00

timtext fcb " 12:00PM",NULL

tmptext fcb " 25.5 oC",NULL

;*************************************************************

;*************************************************************

;** **

;** Static Variables on flash **

;** **

;*************************************************************

;*************************************************************

ORG $4000 ; ROMstart

;ASCII Lookup Table

cols fcb $10,$08,$04,$02,$01

bchara fcb $3F,$48,$48,$48,$3F

bcharb fcb $7F,$49,$49,$49,$36

bcharc fcb $3E,$41,$41,$41,$22

bchard fcb $7F,$41,$41,$41,$3E

bchare fcb $7F,$49,$49,$49,$41

bcharf fcb $7F,$48,$48,$48,$40

bcharg fcb $3E,$41,$49,$49,$2E

bcharh fcb $7F,$08,$08,$08,$7F

bchari fcb $00,$41,$7F,$41,$00

bcharj fcb $02,$41,$41,$7E,$40

bchark fcb $7F,$08,$14,$22,$41

bcharl fcb $7F,$01,$01,$01,$01

bcharm fcb $7F,$20,$18,$20,$7F

bcharn fcb $7F,$10,$08,$04,$7F

bcharo fcb $3E,$41,$41,$41,$3E

bcharp fcb $7F,$48,$48,$48,$30

bcharq fcb $3E,$41,$45,$42,$3D

bcharr fcb $7F,$48,$4C,$4A,$31

bchars fcb $32,$49,$49,$49,$26

bchart fcb $40,$40,$7F,$40,$40

bcharu fcb $7E,$01,$01,$01,$7E

bcharv fcb $7C,$02,$01,$02,$7C

bcharw fcb $7E,$01,$0E,$01,$7E

bcharx fcb $63,$14,$08,$14,$63

bchary fcb $70,$08,$07,$08,$70

bcharz fcb $43,$45,$49,$51,$61

chara fcb $02,$15,$15,$15,$0E

charb fcb $7F,$0A,$11,$11,$0E

charc fcb $0E,$11,$11,$11,$00

chard fcb $0E,$11,$11,$0A,$7F

chare fcb $0E,$15,$15,$15,$0C

charf fcb $08,$3F,$48,$48,$20

charg fcb $08,$15,$15,$15,$1E

charh fcb $7F,$08,$10,$10,$0F

chari fcb $00,$11,$5F,$01,$00

charj fcb $02,$01,$11,$5E,$00

chark fcb $7F,$04,$0A,$11,$00

charl fcb $00,$41,$7F,$01,$00

charm fcb $1F,$10,$0F,$10,$0F

charn fcb $1F,$08,$10,$10,$0F

charo fcb $0E,$11,$11,$11,$0E

charp fcb $1F,$14,$14,$14,$08

charq fcb $08,$14,$14,$14,$0F

charr fcb $1F,$08,$10,$10,$08

chars fcb $09,$15,$15,$15,$12

chart fcb $10,$7E,$11,$11,$02

charu fcb $1E,$01,$01,$01,$1E

charv fcb $1C,$02,$01,$02,$1C

charw fcb $1E,$01,$06,$01,$1E

charx fcb $11,$0A,$04,$0A,$11

chary fcb $18,$05,$05,$05,$1E

charz fcb $11,$13,$15,$19,$11

num0 fcb $3E,$45,$49,$51,$3E

num1 fcb $11,$21,$7F,$01,$01

num2 fcb $27,$49,$49,$49,$31

num3 fcb $22,$41,$49,$49,$36

num4 fcb $0C,$14,$24,$7F,$04

num5 fcb $7A,$49,$49,$49,$46

num6 fcb $1E,$29,$49,$49,$06

num7 fcb $40,$47,$48,$50,$60

num8 fcb $36,$49,$49,$49,$36

num9 fcb $30,$49,$49,$4A,$3C

tilde fcb $08,$10,$08,$04,$08

exclam fcb $00,$38,$7D,$38,$00

at fcb $26,$49,$4F,$41,$3E

pound fcb $14,$3E,$14,$3E,$14

dollar fcb $12,$2A,$7F,$2A,$24

percnt fcb $72,$54,$6B,$15,$27

carat fcb $10,$20,$40,$20,$10

ampers fcb $36,$49,$35,$02,$05

astrsk fcb $2A,$1C,$7F,$1C,$2A

lparen fcb $00,$1C,$22,$41,$00

rparen fcb $00,$41,$22,$1C,$00

unders fcb $01,$01,$01,$01,$01

minus fcb $08,$08,$08,$08,$08

plus fcb $08,$08,$3E,$08,$08

equal fcb $14,$14,$14,$14,$14

lbrace fcb $00,$08,$36,$41,$00

rbrace fcb $00,$41,$36,$08,$00

lbrack fcb $00,$7F,$41,$41,$00

rbrack fcb $00,$41,$41,$7F,$00

pipe fcb $00,$00,$7F,$00,$00

bslash fcb $20,$10,$08,$04,$02

colon fcb $00,$36,$36,$00,$00

semcol fcb $00,$6D,$6E,$00,$00

quote fcb $00,$70,$00,$70,$00

apost fcb $00,$68,$70,$00,$00

lsthan fcb $08,$14,$22,$41,$00

grthan fcb $41,$22,$14,$08,$00

comma fcb $00,$0D,$0E,$00,$00

period fcb $00,$03,$03,$00,$00

qmark fcb $20,$40,$45,$48,$30

fslash fcb $02,$04,$08,$10,$20

space fcb $00,$00,$00,$00,$00

degree fcb $70,$50,$70,$00,$00

msg fcb " ECE 477 - Team 8 SLOW"," ",NULL

;*************************************************************

;*************************************************************

;** **

;** MAIN **

;** **

;*************************************************************

;*************************************************************

Entry:

lds #$2000

sei

clra

clrb

ldx #0

ldy #0

bclr SCI0CR2,$0C ;set PTS pins 0 and 1 to GPIO

movb #$FF,DDRS

movb #$1F,DDRL

movb #$D0,DDRT

jsr rti_ini

jsr tim_ini

cli

loop

movb #$00,mode

jsr ldarray

jsr delay

jsr delay

jsr delay

movb #$01,mode

jsr ldarray

jsr delay

movb #$02,mode

jsr ldarray

jsr Tsense

jsr delay

BRA loop ; endless loop

;*************************************************************

;*************************************************************

;** **

;** Temperature Sensor **

;** **

;*************************************************************

;*************************************************************

;**********************************************

; Temperature Sensor

;

;**********************************************

Tsense

rstloop clr mytemp

clr mytemp2

clr Temp

clr Temp+1

bset PTT,$20

bset DDRT,$20

jsr DSReset ;send reset pulse to DS18S20

tsta ;wait till presence signal is detected (when A=1)

beq rstloop

ldaa #$CC ;send skip ROM command

jsr putbyte

ldaa #$44 ;send convert temperature command

jsr putbyte

busy jsr getbit ;apply strong pullup on data line until

cmpa #$00 ;conversion is over and we receieve a 1.

beq busy

rstlp2 bset DDRT,$20

bset PTT,$20

jsr DSReset ;reset pulse

tsta

beq rstlp2

ldaa #$CC ;send skip ROM command

jsr putbyte

ldaa #$BE ;send read scratchpad command

jsr putbyte

jsr getbyte ;read temperature LSB from scratchpad byte 0

movb mytemp,Temp

jsr getbyte ;read temperature MSB from scratchpad byte 1

movb mytemp,Temp+1 ;MSB will not be used though

rstlp3 bset DDRT,$20

bset PTT,$20

jsr DSReset ;reset pulse to interrupt transmission of

tsta ;the bytes 2 to 9

beq rstlp3

movb #$2E,tmptext+3

movb #' ',tmptext+5

movb #$7F,tmptext+6

movb #'C',tmptext+7

ldaa Temp ;if bit 0 of LSB is 1 then ~~.5

anda #$01 ;if bit 0 of LSB is 0 then ~~.0

cmpa #$01

bne ts1

movb #'5',tmptext+4

bra ts2

ts1 movb #'0',tmptext+4

ts2 lsr Temp

jsr bin2dec ;

ldaa mytemp

jsr htoa

staa tmptext+1

ldaa mytemp2

jsr htoa

staa tmptext+2

rts

;**********************************************

; DS18S20 Reset

;

; - Sends a reset pulse to all devices

; then receives a presence pulse

; Must send pull line low for a min of 480us

;

;**********************************************

DSReset

bset DDRT,$20 ;make sensor pin an output

bset PTT,$20 ;make sure pin is originally high

bclr PTT,$20 ;pull sensor pin low

jsr delay500 ;delay 500us

bclr DDRT,$20 ;switch to input mode

;this releases the bus for pullup resistor to work

jsr delay70 ;delay 70us

clra

brset PTT,$20,DS1

inca

DS1 jsr delay410 ;delay 500us or 430 or 410

rts

;**********************************************

; putbyte

;

; - takes data from register A and sends it to DS18S20 serially

; write 0 slot: pin low for at least 60us then bus release

; write 1 slot: pin low, must release bus within 15us

;**********************************************

putbyte

ldab #8t ;bit count

shfbyte lsra

bcc putb1

bset DDRT,$20 ;write 1 slot

bset PTT,$20

bclr PTT,$20

jsr delay6 ;delay 6us

bclr DDRT,$20

jsr delay70 ;delay 70us

bra putb2

putb1 bset DDRT,$20 ;write 0 slot

bset PTT,$20

bclr PTT,$20

jsr delay70 ;delay 70us

bclr DDRT,$20

jsr delay10 ;delay 10us

putb2 decb

bne shfbyte

rts

;**********************************************

; getbyte

;

; - retrieves byte of data from sensor and stores in mytemp variable

;**********************************************

getbyte

ldab #$08 ;bit count

get1 jsr getbit

lsl mytemp ;shift mytemp to left by 1

oraa mytemp ;OR new bit with previous bits

staa mytemp

decb

bne get1 ;repeat for all 8 bits

rts

;**********************************************

; getbit

;

; - reads a bit transmitted by the sensor and stores in A

; example1: for a conversion, it will return 1 if successful

; and a 0 if not done yet.

; example2: for a read, it will return whichever bit was read

;**********************************************

getbit

bset DDRT,$20 ;read slot

bset PTT,$20

bclr PTT,$20 ;initiate read time slot

jsr delay6 ;pull low for 8us

bclr DDRT,$20

jsr delay6 ;wait until 14us mark

ldaa PTT ;sample sensor at 12us

anda #$20

cmpa #$20

bne gb1

ldaa #$01

bra gbexit

gb1 ldaa #$00

gbexit jsr delay70

rts

;**********************************************

; Binary to Decimal

;

; - converts temperature from hex form to a decimal looking hex form

; and stores it in mytemp and mytemp2.

; example: $55 = 85t -> mytemp = 8 and mytemp2 = 5

; assuming bit 7 is 0 because we will not be using MSB so nothing

; will shift into that bit. Max temp we will get using bits 0-6

; is 127 degrees Celsius.

;**********************************************

bin2dec

clr mytemp

clr mytemp2

ldab Temp

binhi cmpb #9t

bls binlo

inc mytemp

subb #10t

bra binhi

binlo stab mytemp2

rts

;*************************************************************

;*************************************************************

;** **

;** Timer Subsystem **

;** **

;*************************************************************

;*************************************************************

;**********************************************

; TIM_INI

;

; - initializes all the parameters for the timer module

;**********************************************

tim_ini

movb #$80,TSCR1 ;enable TIM subsystem

movb #$80,TIOS ;set ch7 for output compare

movb #$80,TIE ;enable ch7 interrupt flag to cause a hardware interrupt

movb #$0B,TSCR2 ;enable timer counter reset by a successful output compare on ch7

;set timer prescaler to Bus Clock / 8 = 1.5625Mhz = 0.64us

;note: Bus Clock = 25Mhz / 2 = 12.5Mhz

movw #$3D09,TC7 ;set ch7 to generate 10 ms interrupt rate = 0.64us x 15625 = 10ms

movb #$00,TCTL1 ;make sure it is set to default

clr tcntr ;clear timer counter

movb #$05,secs1

movb #$05,secs2

movb #$03,mins1

movb #$02,mins2

movb #$01,hours1

movb #$01,hours2

movb #$01,hrflag

movb #$01,ampm ;am = 0, pm = 1

rts

;**********************************************

; TIM_ISR

;

; - interrupt driven timer for clock display

; increments tcntr until 1 sec has been reached.

; called every 10 ms according to tim_ini

;**********************************************

tim_isr

bset TFLG1,$FF

inc tcntr

ldaa tcntr

cmpa #50t

bne t0

t0 ldaa tcntr

cmpa #100t ;100 x 10ms = 1 sec

beq t1

lbra texit

t1 clr tcntr

ldaa secs2 ;seconds go up to 59

cmpa #9t

beq tim1

inc secs2

lbra texit

tim1 clr secs2

ldaa secs1

cmpa #5t

beq tim2

inc secs1

lbra texit

;minutes go up to 59

tim2 clr secs1

ldaa mins2

cmpa #9t

beq tim3

inc mins2

lbra texit

tim3 clr mins2

ldaa mins1

cmpa #5t

beq tim4

inc mins1

lbra texit

tim4 clr mins1 ;hours go up to 12

ldaa hrflag ;hrflag=0 means range 01-09

cmpa #$00 ;hrflag=1 means range 10-12

bne tim5

ldaa hours2 ;goes up to 9

cmpa #9t

beq tim6

inc hours2

lbra texit

tim6 clr hours2

inc hrflag

inc hours1

lbra texit

tim5 ldaa hours2 ;goes up to 2

cmpa #2t

beq tim7

inc hours2

ldaa hours1 ;check if 12 o clock

cmpa #1t

bne texit

ldaa hours2

cmpa #2t

bne texit

ldaa ampm ;if yes then switch AM/PM

cmpa #$00

bne tim9

inc ampm

movb #'A',timtext+6

bra texit

tim9 clr ampm

movb #'P',timtext+6

bra texit

tim7 clr hours2 ;if 2 then first digit increments

ldaa hours1

cmpa #1t

beq tim8

inc hours1

bra texit

tim8 clr hours1 ;after 12:59 turn into 1:00

movb #$01,hours2

texit ldaa hours1

jsr htoa

staa timtext+1

ldaa hours2

jsr htoa

staa timtext+2

ldaa mins1

jsr htoa

staa timtext+4

ldaa mins2

jsr htoa

staa timtext+5

movb #$3A,timtext+3

movb #'M',timtext+7

ldaa ampm ;if yes then switch AM/PM

cmpa #$00

bne tim10

movb #'A',timtext+6

bra texit2

tim10 movb #'P',timtext+6

texit2 rti

;*************************************************************

;*************************************************************

;** **

;** Real-Time Interrupt **

;** **

;*************************************************************

;*************************************************************

;**********************************************

; RTI_INI

;

; - initializes all the sram variables and parameters

; used within RTI

;**********************************************

rti_ini

bset CRGINT,$80

movb #$10,RTICTL ;#$13,RTICTL 4*2^10

movb #$00,PTS

movb #$10,PTL

movb #$00,PTT

clr rticnt1

clr rticnt2

clr rticnt3

clr tempcnt

clr strcnt

clr arindex

clr ledindx

clr index

clr chaddr

clr chaddr+1

clr msgindx

clr msgindx+1

movb #$01,rowbit1

movb #$01,rowbit2

movb #$01,rowbit3

movb #$01,rowbit4

movb #$01,rowbit5

movb #$01,rowbit6

movb #$01,rowbit7

movb #$01,rowbit8

movb #$01,rowbit9

movb #$01,rowbit0

movb #$01,colbit1

movb #$01,colbit2

movb #$01,colbit3

movb #$01,colbit4

movb #$01,colbit5

movb #$01,colbit6

movb #$01,colbit7

movb #$01,colbit8

movb #$01,colbit9

movb #$01,colbit0

jsr ldarray

rts

;**********************************************

; RTI_ISR

;

; - interrupt driven text display

;**********************************************

rti_isr

bset CRGFLG,$80 ; clear interrupt flag

; 1 / (25Mhz / 16*2^10) = 0.00065536

; 0.00065536 = 0.65536ms

; 0.00065536 x 1000 = 0.65s

; 1000 = $03E8

inc rticnt1 ;-----

ldaa rticnt1

cmpa #1t ;#250t

lbne rtiend1

clr rticnt1

rti1 ldaa PTT ;-----

anda #$10

cmpa #$10

bne clknxt ; clk

bclr PTT,$10

bra rtiend1 ;-----

clknxt inc strcnt ;-----

ldaa strcnt

cmpa #$0D ; check if counter = 13

beq cnt13

ldaa PTL ;-----

anda #$08

cmpa #$00 ; check STR active low

beq stron

bclr PTL,$08 ;----- STR is on

stron ldaa PTL

anda #$10 ; check OE

cmpa #$10

beq oeoff

bset PTL,$10 ;----- OE is off active low

oeoff

jsr shfdat1 ; send data

jsr shfdat2

jsr shfdat3

jsr shfdat4

jsr shfdat5

jsr shfdat6

jsr shfdat7

jsr shfdat8

jsr shfdat9

jsr shfdat0

bset PTT,$10 ; clock rise

bra rtiend1 ;-----

cnt13 clr strcnt ;----- 13th cycle

bset PTL,$08 ; STR off

bclr PTL,$10 ; OE on

inc index

ldaa index

cmpa #$05

bne rtiend1

clr index

rtiend1

inc rticnt2 ; interval counter

ldaa rticnt2

cmpa #250t ;2t

bne rtiend2

clr rticnt2

inc rticnt3

ldaa rticnt3

cmpa #8t

bne rtiend2

clr rticnt3

ldaa mode

cmpa #$00

bne rtiend2

jsr scroll

rtiend2 rti

;**********************************************

; SHIFT DATA 1

;

; - shifts ascii data per column into shift register 1

;**********************************************

shfdat1

ldaa rowbit1

cmpa #$80

beq colshf1

ldab index

tfr b,x

ldaa darray,x

anda rowbit1

cmpa rowbit1

bne clrs11

bset PTS,$01

bra next11

clrs11 bclr PTS,$01

next11 asl rowbit1

bra shfend1

colshf1 ldaa colbit1

cmpa #$20

beq colend1

ldab index

tfr b,x

ldaa cols,x

anda colbit1

cmpa colbit1

bne clrs12

bset PTS,$01

bra next12

clrs12 bclr PTS,$01

next12 asl colbit1

bra shfend1

colend1 movb #$01,rowbit1

movb #$01,colbit1

lbra shfdat1

shfend1 rts

;**********************************************

; SHIFT DATA 2

;

; - shifts ascii data per column into shift register 2

;**********************************************

shfdat2

ldaa rowbit2

cmpa #$80

beq colshf2

ldab index

addb #5t

tfr b,x

ldaa darray,x

anda rowbit2

cmpa rowbit2

bne clrs21

bset PTS,$02

bra next21

clrs21 bclr PTS,$02

next21 asl rowbit2

bra shfend2

colshf2 ldaa colbit2

cmpa #$20

beq colend2

ldab index

tfr b,x

ldaa cols,x

anda colbit2

cmpa colbit2

bne clrs22

bset PTS,$02

bra next22

clrs22 bclr PTS,$02

next22 asl colbit2

bra shfend2

colend2 movb #$01,rowbit2

movb #$01,colbit2

lbra shfdat2

shfend2 rts

;**********************************************

; SHIFT DATA 3

;

; - shifts ascii data per column into shift register 3

;**********************************************

shfdat3

ldaa rowbit3

cmpa #$80

beq colshf3

ldab index

addb #10t

tfr b,x

ldaa darray,x

anda rowbit3

cmpa rowbit3

bne clrs31

bset PTS,$04

bra next31

clrs31 bclr PTS,$04

next31 asl rowbit3

bra shfend3

colshf3 ldaa colbit3

cmpa #$20

beq colend3

ldab index

tfr b,x

ldaa cols,x

anda colbit3

cmpa colbit3

bne clrs32

bset PTS,$04

bra next32

clrs32 bclr PTS,$04

next32 asl colbit3

bra shfend3

colend3 movb #$01,rowbit3

movb #$01,colbit3

lbra shfdat3

shfend3 rts

;**********************************************

; SHIFT DATA 4

;

; - shifts ascii data per column into shift register 4

;**********************************************

shfdat4

ldaa rowbit4

cmpa #$80

beq colshf4

ldab index

addb #15t

tfr b,x

ldaa darray,x

anda rowbit4

cmpa rowbit4

bne clrs41

bset PTS,$08

bra next41

clrs41 bclr PTS,$08

next41 asl rowbit4

bra shfend4

colshf4 ldaa colbit4

cmpa #$20

beq colend4

ldab index

tfr b,x

ldaa cols,x

anda colbit4

cmpa colbit4

bne clrs42

bset PTS,$08

bra next42

clrs42 bclr PTS,$08

next42 asl colbit4

bra shfend4

colend4 movb #$01,rowbit4

movb #$01,colbit4

lbra shfdat4

shfend4 rts

;**********************************************

; SHIFT DATA 5

;

; - shifts ascii data per column into shift register 5

;**********************************************

shfdat5

ldaa rowbit5

cmpa #$80

beq colshf5

ldab index

addb #20t

tfr b,x

ldaa darray,x

anda rowbit5

cmpa rowbit5

bne clrs51

bset PTS,$10

bra next51

clrs51 bclr PTS,$10

next51 asl rowbit5

bra shfend5

colshf5 ldaa colbit5

cmpa #$20

beq colend5

ldab index

tfr b,x

ldaa cols,x

anda colbit5

cmpa colbit5

bne clrs52

bset PTS,$10

bra next52

clrs52 bclr PTS,$10

next52 asl colbit5

bra shfend5

colend5 movb #$01,rowbit5

movb #$01,colbit5

lbra shfdat5

shfend5 rts

;**********************************************

; SHIFT DATA 6

;

; - shifts ascii data per column into shift register 6

;**********************************************

shfdat6

ldaa rowbit6

cmpa #$80

beq colshf6

ldab index

addb #25t

tfr b,x

ldaa darray,x

anda rowbit6

cmpa rowbit6

bne clrs61

bset PTS,$40

bra next61

clrs61 bclr PTS,$40

next61 asl rowbit6

bra shfend6

colshf6 ldaa colbit6

cmpa #$20

beq colend6

ldab index

tfr b,x

ldaa cols,x

anda colbit6

cmpa colbit6

bne clrs62

bset PTS,$40

bra next62

clrs62 bclr PTS,$40

next62 asl colbit6

bra shfend6

colend6 movb #$01,rowbit6

movb #$01,colbit6

lbra shfdat6

shfend6 rts

;**********************************************

; SHIFT DATA 7

;

; - shifts ascii data per column into shift register 7

;**********************************************

shfdat7

ldaa rowbit7

cmpa #$80

beq colshf7

ldab index

addb #30t

tfr b,x

ldaa darray,x

anda rowbit7

cmpa rowbit7

bne clrs71

bset PTS,$80

bra next71

clrs71 bclr PTS,$80

next71 asl rowbit7

bra shfend7

colshf7 ldaa colbit7

cmpa #$20

beq colend7

ldab index

tfr b,x

ldaa cols,x

anda colbit7

cmpa colbit7

bne clrs72

bset PTS,$80

bra next72

clrs72 bclr PTS,$80

next72 asl colbit7

bra shfend7

colend7 movb #$01,rowbit7

movb #$01,colbit7

lbra shfdat7

shfend7 rts

;**********************************************

; SHIFT DATA 8

;

; - shifts ascii data per column into shift register 8

;**********************************************

shfdat8

ldaa rowbit8

cmpa #$80

beq colshf8

ldab index

addb #35t

tfr b,x

ldaa darray,x

anda rowbit8

cmpa rowbit8

bne clrs81

bset PTL,$01

bra next81

clrs81 bclr PTL,$01

next81 asl rowbit8

bra shfend8

colshf8 ldaa colbit8

cmpa #$20

beq colend8

ldab index

tfr b,x

ldaa cols,x

anda colbit8

cmpa colbit8

bne clrs82

bset PTL,$01

bra next82

clrs82 bclr PTL,$01

next82 asl colbit8

bra shfend8

colend8 movb #$01,rowbit8

movb #$01,colbit8

lbra shfdat8

shfend8 rts

;**********************************************

; SHIFT DATA 9

;

; - shifts ascii data per column into shift register 9

;**********************************************

shfdat9

ldaa rowbit9

cmpa #$80

beq colshf9

ldab index

addb #40t

tfr b,x

ldaa darray,x

anda rowbit9

cmpa rowbit9

bne clrs91

bset PTL,$02

bra next91

clrs91 bclr PTL,$02

next91 asl rowbit9

bra shfend9

colshf9 ldaa colbit9

cmpa #$20

beq colend9

ldab index

tfr b,x

ldaa cols,x

anda colbit9

cmpa colbit9

bne clrs92

bset PTL,$02

bra next92

clrs92 bclr PTL,$02

next92 asl colbit9

bra shfend9

colend9 movb #$01,rowbit9

movb #$01,colbit9

lbra shfdat9

shfend9 rts

;**********************************************

; SHIFT DATA 10

;

; - shifts ascii data per column into shift register 10

;**********************************************

shfdat0

ldaa rowbit0

cmpa #$80

beq colshf0

ldab index

addb #45t

tfr b,x

ldaa darray,x

anda rowbit0

cmpa rowbit0

bne clrs01

bset PTL,$04

bra next01

clrs01 bclr PTL,$04

next01 asl rowbit0

bra shfend0

colshf0 ldaa colbit0

cmpa #$20

beq colend0

ldab index

tfr b,x

ldaa cols,x

anda colbit0

cmpa colbit0

bne clrs02

bset PTL,$04

bra next02

clrs02 bclr PTL,$04

next02 asl colbit0

bra shfend0

colend0 movb #$01,rowbit0

movb #$01,colbit0

lbra shfdat0

shfend0 rts

;**********************************************

; LOAD NEXT ADDRESS

;

; - loads the next character's address into the temp

; variable chaddr

;**********************************************

ldnxtad

ldaa mode

cmpa #$00

bne dotime

ldab msgindx

tfr b,x

ldaa msg,x

bra chk0

dotime cmpa #$01

bne dotemp

ldab msgindx

tfr b,x

ldaa timtext,x

bra chk0

dotemp ldab msgindx

tfr b,x

ldaa tmptext,x

chk0 cmpa #'A'

bne chk1

ldx #bchara

lbra adexit

chk1 cmpa #'B'

bne chk2

ldx #bcharb

lbra adexit

chk2 cmpa #'C'

bne chk3

ldx #bcharc

lbra adexit

chk3 cmpa #'D'

bne chk4

ldx #bchard

lbra adexit

chk4 cmpa #'E'

bne chk5

ldx #bchare

lbra adexit

chk5 cmpa #'F'

bne chk6

ldx #bcharf

lbra adexit

chk6 cmpa #'G'

bne chk7

ldx #bcharg

lbra adexit

chk7 cmpa #'H'

bne chk8

ldx #bcharh

lbra adexit

chk8 cmpa #'I'

bne chk9

ldx #bchari

lbra adexit

chk9 cmpa #'J'

bne chk10

ldx #bcharj

lbra adexit

chk10 cmpa #'K'

bne chk11

ldx #bchark

lbra adexit

chk11 cmpa #'L'

bne chk12

ldx #bcharl

lbra adexit

chk12 cmpa #'M'

bne chk13

ldx #bcharm

lbra adexit

chk13 cmpa #'N'

bne chk14

ldx #bcharn

lbra adexit

chk14 cmpa #'O'

bne chk15

ldx #bcharo

lbra adexit

chk15 cmpa #'P'

bne chk16

ldx #bcharp

lbra adexit

chk16 cmpa #'Q'

bne chk17

ldx #bcharq

lbra adexit

chk17 cmpa #'R'

bne chk18

ldx #bcharr

lbra adexit

chk18 cmpa #'S'

bne chk19

ldx #bchars

lbra adexit

chk19 cmpa #'T'

bne chk20

ldx #bchart

lbra adexit

chk20 cmpa #'U'

bne chk21

ldx #bcharu

lbra adexit

chk21 cmpa #'V'

bne chk22

ldx #bcharv

lbra adexit

chk22 cmpa #'W'

bne chk23

ldx #bcharw

lbra adexit

chk23 cmpa #'X'

bne chk24

ldx #bcharx

lbra adexit

chk24 cmpa #'Y'

bne chk25

ldx #bchary

lbra adexit

chk25 cmpa #'Z'

bne chk26

ldx #bcharz

lbra adexit

chk26 cmpa #'a'

bne chk27

ldx #chara

lbra adexit

chk27 cmpa #'b'

bne chk28

ldx #charb

lbra adexit

chk28 cmpa #'c'

bne chk29

ldx #charc

lbra adexit

chk29 cmpa #'d'

bne chk30

ldx #chard

lbra adexit

chk30 cmpa #'e'

bne chk31

ldx #chare

lbra adexit

chk31 cmpa #'f'

bne chk32

ldx #charf

lbra adexit

chk32 cmpa #'g'

bne chk33

ldx #charg

lbra adexit

chk33 cmpa #'h'

bne chk34

ldx #charh

lbra adexit

chk34 cmpa #'i'

bne chk35

ldx #chari

lbra adexit

chk35 cmpa #'j'

bne chk36

ldx #charj

lbra adexit

chk36 cmpa #'k'

bne chk37

ldx #chark

lbra adexit

chk37 cmpa #'l'

bne chk38

ldx #charl

lbra adexit

chk38 cmpa #'m'

bne chk39

ldx #charm

lbra adexit

chk39 cmpa #'n'

bne chk40

ldx #charn

lbra adexit

chk40 cmpa #'o'

bne chk41

ldx #charo

lbra adexit

chk41 cmpa #'p'

bne chk42

ldx #charp

lbra adexit

chk42 cmpa #'q'

bne chk43

ldx #charq

lbra adexit

chk43 cmpa #'r'

bne chk44

ldx #charr

lbra adexit

chk44 cmpa #'s'

bne chk45

ldx #chars

lbra adexit

chk45 cmpa #'t'

bne chk46

ldx #chart

lbra adexit

chk46 cmpa #'u'

bne chk47

ldx #charu

lbra adexit

chk47 cmpa #'v'

bne chk48

ldx #charv

lbra adexit

chk48 cmpa #'w'

bne chk49

ldx #charw

lbra adexit

chk49 cmpa #'x'

bne chk50

ldx #charx

lbra adexit

chk50 cmpa #'y'

bne chk51

ldx #chary

lbra adexit

chk51 cmpa #'z'

bne chk52

ldx #charz

lbra adexit

chk52 cmpa #'1'

. bne chk53

ldx #num1

lbra adexit

chk53 cmpa #'2'

bne chk54

ldx #num2

lbra adexit

chk54 cmpa #'3'

bne chk55

ldx #num3

lbra adexit

chk55 cmpa #'4'

bne chk56

ldx #num4

lbra adexit

chk56 cmpa #'5'

bne chk57

ldx #num5

lbra adexit

chk57 cmpa #'6'

bne chk58

ldx #num6

lbra adexit

chk58 cmpa #'7'

bne chk59

ldx #num7

lbra adexit

chk59 cmpa #'8'

bne chk60

ldx #num8

lbra adexit

chk60 cmpa #'9'

bne chk61

ldx #num9

lbra adexit

chk61 cmpa #'0'

bne chk62

ldx #num0

lbra adexit

chk62 cmpa #$7E

bne chk63

ldx #tilde

lbra adexit

chk63 cmpa #$21

bne chk64

ldx #exclam

lbra adexit

chk64 cmpa #$40

bne chk65

ldx #at

lbra adexit

chk65 cmpa #$23

bne chk66

ldx #pound

lbra adexit

chk66 cmpa #$24

bne chk67

ldx #dollar

lbra adexit

chk67 cmpa #$25

bne chk68

ldx #percnt

lbra adexit

chk68 cmpa #$5E

bne chk69

ldx #carat

lbra adexit

chk69 cmpa #$26

bne chk70

ldx #ampers

lbra adexit

chk70 cmpa #$2A

bne chk71

ldx #astrsk

lbra adexit

chk71 cmpa #$28

bne chk72

ldx #lparen

lbra adexit

chk72 cmpa #$29

bne chk73

ldx #rparen

lbra adexit

chk73 cmpa #$5F

bne chk74

ldx #unders

lbra adexit

chk74 cmpa #$2D

bne chk75

ldx #minus

lbra adexit

chk75 cmpa #$2B

bne chk76

ldx #plus

lbra adexit

chk76 cmpa #$3D

bne chk77

ldx #equal

lbra adexit

chk77 cmpa #$7B

bne chk78

ldx #lbrace

lbra adexit

chk78 cmpa #$7D

bne chk79

ldx #rbrace

lbra adexit

chk79 cmpa #$5B

bne chk80

ldx #lbrack

lbra adexit

chk80 cmpa #$5D

bne chk81

ldx #rbrack

lbra adexit

chk81 cmpa #$7C

bne chk82

ldx #pipe

lbra adexit

chk82 cmpa #$5C

bne chk83

ldx #bslash

lbra adexit

chk83 cmpa #$3A

bne chk84

ldx #colon

lbra adexit

chk84 cmpa #$3B

bne chk85

ldx #semcol

lbra adexit

chk85 cmpa #$22

bne chk86

ldx #quote

lbra adexit

chk86 cmpa #$27

bne chk87

ldx #apost

lbra adexit

chk87 cmpa #$3C

bne chk88

ldx #lsthan

lbra adexit

chk88 cmpa #$3E

bne chk89

ldx #grthan

lbra adexit

chk89 cmpa #$2C

bne chk90

ldx #comma

lbra adexit

chk90 cmpa #$2E

bne chk91

ldx #period

lbra adexit

chk91 cmpa #$3F

bne chk92

ldx #qmark

lbra adexit

chk92 cmpa #$2F

bne chk93

ldx #fslash

lbra adexit

chk93 cmpa #' '

bne chk94

ldx #space

bra adexit

chk94 cmpa #$7F

bne chk95

ldx #degree

bra adexit

chk95 cmpa #NULL

bne adexit

clr msgindx

lbra ldnxtad

adexit stx chaddr

rts

;**********************************************

; LOAD DISPLAY ARRAY

;

; - loads the 50 element array of hex values representing

; each column of data to be shifted into the shift

; registers. Only called at program start.

;**********************************************

ldarray

clr arindex

clr ledindx

clr msgindx

ldy #50t

ldloop ldaa ledindx

cmpa #$05

bne ld1

clr ledindx

inc msgindx

clra

ldab arindex

tfr b,x

staa darray,x

inc arindex

bra ld2

ld1 jsr ldnxtad

ldab ledindx

ldx chaddr

abx

stx chaddr

ldx #$0000

ldaa [chaddr,x]

ldab arindex

tfr b,x

staa darray,x

inc arindex

inc ledindx

ld2 dbne y,ldloop

rts

;**********************************************

; SCROLL

;

; - shifts all the data in the display array to the left

; by one.

;**********************************************

scroll

ldx #$0001

sc1 ldaa darray,x

dex

staa darray,x

inx

inx

cpx #$0032

bne sc1

ldaa ledindx

cmpa #$05

bne sc2

clr ledindx

inc msgindx

clra

ldab #49t

tfr b,x

staa darray,x

bra sexit

sc2 jsr ldnxtad

ldab ledindx

ldx chaddr

abx

stx chaddr

ldx #$0000

ldaa [chaddr,x]

ldab #49t

tfr b,x

staa darray,x

inc ledindx

sexit rts

;*************************************************************

;*************************************************************

;** **

;** MISC Routines **

;** **

;*************************************************************

;*************************************************************

;**********************************************

; Delay 500 us

;

; waste 6250 cycles

;**********************************************

delay500

pshd

ldy #1t

d500o ldx #1247t ;#2497t / 2

d500i nop

nop

dbne x,d500i

dbne y,d500o

puld

rts

;**********************************************

; Delay 410 us

;

; waste 5125 cycles

;**********************************************

delay410

pshd

ldy #1t

d410o ldx #1022t

d410i nop

nop

dbne x,d410i

dbne y,d410o

puld

rts

;**********************************************

; Delay 70 us

;

; waste 875 cycles

;**********************************************

delay70

pshd

ldy #1t

d70o ldx #172t

d70i nop

nop

dbne x,d70i

dbne y,d70o

puld

rts

;**********************************************

; Delay 10 us

;

; waste 125 cycles

;**********************************************

delay10

pshd

ldy #1t

d10o ldx #22t

d10i nop

nop

dbne x,d10i

dbne y,d10o

puld

rts

;**********************************************

; Delay 8 us

;

; waste 100 cycles

;**********************************************

delay8

pshd

ldy #1t

d8o ldx #17t

d8i nop

nop

dbne x,d8i

dbne y,d8o

puld

rts

;**********************************************

; Delay 6 us

;

; 1/12.5Mhz = 80ns per clock cycle

; waste 75 cycles

; ((5*x) + 5) * y + 10 = 75

;**********************************************

delay6

pshd ;2 cycles

ldy #1t

d6o ldx #12t

d6i nop

nop

dbne x,d6i

dbne y,d6o

puld ;3 cycles

rts ;5 cycles

;**********************************************

; Delay 4 us

;

; waste 50 cycles

;**********************************************

delay4

pshd

ldy #1t

d4o ldx #7t

d4i nop

nop

dbne x,d4i

dbne y,d4o

puld

rts

;**********************************************

; DELAY

;

; - creates a 1 sec delay

;**********************************************

delay

pshx

pshy

pshd

pshc

ldy #$1F40 ;#$1F40 1sec

loopo ldx #$01F4 ;#$01F4

loopi nop

nop

dbne x,loopi

dbne y,loopo

pulc

puld

puly

pulx

rts

;**********************************************

; HEX to ASCII

;

; - converts hex nibble in A into its ascii equivalent

;**********************************************

htoa adda #$90

daa

adca #$40

daa

rts

;**************************************************************

;* Interrupt Vectors *

;**************************************************************

org $FFF0

fdb rti_isr ; real-time interrupt

org $FFE0

fdb tim_isr ; standard timer channel 7

org $FFFE

fdb Entry ; Reset

Appendix G: FMECA Worksheet

PA = 5V Power Supply Circuit,

PB = 3.3V Power Supply Circuit,

M = Microcontroller Circuit,

L = LED Display Panel Circuit,

T = Temperature Sensor Circuit,

E = Ethernet Circuit,

V = Voltage Level Translator Circuit

High Criticality = less than 10^-9 failures per hour

Low Criticality = less than 10^-5 failures per hour

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

| |Output = 0V |Any failure of any components within |Loss of power to drive LEDs and other|Observation |High | |

|PA1 | |the block and short circuit |components, short circuit could make| | | |

| | | |an overheat/fire hazard | | | |

| |Output > 5V |Failure of power adaptor or the 5V |Potential damage to shift register |Observation |High | |

|PA2 | |power regulator |and LEDs that could make an | | | |

| | | |overheat/fire hazard | | | |

| |Output out of tolerance |Any failure of any components within |Unpredictable |Observation |High | |

|PA3 | |the block | | | | |

| |Output = 0V |Any failure of any components within |Loss of power to supply the |Observation |Low |The webserver and temperature |

|PB1 | |the block |microcontroller, short circuit could | | |sensor will not function |

| | | |make an overheat/fire hazard | | | |

| |Output > 3.3V |Failure of 5V power regulator or |Potential damage to the |Observation |High |  |

|PB2 | |linear regulator |microcontroller and voltage level | | | |

| | | |translator | | | |

| |Output out of tolerance |Failure of the 5V power supply circuit|Unpredictable |Observation |High | |

|PB3 | |and any components within the block | | | | |

| |Output continuously 0 |Any failure of any components within |LEDs, temperature sensor and Ethernet|Observation |Low | |

|M1 | |the block, or software |will not function properly | | | |

| |Output continuously 1 |Any failure of any components within |LEDs, temperature sensor and Ethernet|Observation |Low | |

|M2 | |the block, or software |will not function properly | | | |

| |Noisy signal from the |Failure of the oscillator |Incorrect or no data display on LEDs |Observation |Low | |

|M3 |oscillator | | | | | |

| |Microcontroller is not |Failure of the microcontroller and any|Designed circuit does not function |Observation |Low | |

|M4 |function properly |components within the block | | | | |

| |Shift register is not |shift register, voltage level |Incorrect or no data display on LEDs |Observation |Low | |

|L1 |working |translator, Darlington transistor | | | | |

| |Darlington transistor is |shift register, voltage level |One or more LEDs’ columns may not |Observation |Low | |

|L2 |not working |translator, Darlington transistor |function properly | | | |

| |Output continuously 0 |Temperature sensor |Temperature display on LEDs |Observation |Low | |

|T1 | | |incorrectly | | | |

| |Output continuously 1 |Temperature sensor |Temperature display on LEDs |Observation |Low | |

|T2 | | |incorrectly | | | |

| |Output out of tolerance |Any failure of any components within |Ethernet may not function properly |Observation |Low |Panel may not connect to the |

|E1 | |the block | | | |internet |

| |Output < 3.5V |Voltage level translator |LEDs will not turn on |Observation |Low | |

|V1 | | | | | | |

| |Output out of tolerance |Voltage level translator |LEDs and shift registers will not |Observation |Low | |

|V2 | | |function properly | | | |

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

Comments:

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

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

Google Online Preview   Download