Up until this point in the circuit the signal representing the force applied was analog. The real magic takes place inside the microprocessor where the signal is converted in to a digital signal which is suitable for display on the LCD. Again we want to give credit to Mike Toth in the lab for doing most of the programming that was required. The MSP430F449 is a microcontroller unit complete with timers, analog to digital converters, and a LCD driver. It also contains memory which can be used to program the device to perform specific functions. The primary use for such a device is to capture analog signals, convert them to digital, and output the digital signal to an LCD or to some other device [2]. They can be purchased or procured as student samples at the Texas Instrument website. Figure six is a flow chart provided by Mike Toth that illustrates the flow of the program we used in this device. Notice the infinite loop (wait forever) and the one second interrupt. The infinite loop tells the program to execute a command with no predefined condition (that is not always true). Technically speaking this is like telling a program to run without ever giving it instructions on when to stop. This means that the only way to halt operation is to power down the device using the sliding switch on the front of the package. In C, the programming language used by engineers, there are different ways to exit an infinite loop. You can use the break command to end the cycle when a specific condition is encountered. Another method is to include in the program what is called an interrupt.
In this case, an interrupt is programmed which tells the device to sample the input from the FSR and UGB network, convert it to digital, and update the LCD with the new information. This interrupt occurs one time per second. What this means is that the sensor is sampled and the LCD is updated only once per second. After the sampling, control is handed back to the loop until the next interrupt occurs.
Inside the microprocessor the instantaneous value of the analog signal is converted into a digital value and stored under a previously declared floating point variable. The following equation is used to calculate the actual weight in grams of the object on the sensor. The data is displayed on the LCD.
In the equation, “y” equals the weight in grams and “x” is the value stored under the floating point variable that is representative of the analog signal present on the microprocessor’s input pin. This equation was derived from the specifications sheet of the FSR when using a ten kilo-ohm resistor (See figure seven, use the purple plot). Using a different resistor might have allowed the use of a simpler equation. Bear in mind however that the rail voltage to the UGB was only 3.3 volts. This was necessary because 3.3 volts was the max allowable input to the microprocessor. The 10 kilo-ohm resistor yields a maximum output very close to 3.3 volts and was thus ideal.

Because the equation is cumbersome it takes the microprocessor some time to crunch the numbers. Mike Toth suspected that this is the cause of the flickering on the LCD. It turns out that the microprocessor we used is better suited for solving linear or quadratic equations in any efficient manner.