Free Essay

Automated Cocktail Mixer

In:

Submitted By arlandianto
Words 8877
Pages 36
SUMMARY
In this experiment, a cocktail mixer is constructed.
Cocktail mixers are usually used to stir various type of cocktails in order to maintain their clarity and texture. In addition, the mixer can be used for other beverages such as juices. The rotatory part that was implemented for this experimentation is a stepper motor. PIC microcontroller is used to control the operation, while two infrared obstacle sensors are utilized to start and stop the motor. For safety measure, a fail-safe switch to deactivate the motor is implemented. Consequently, these functions will help to enhance the impression and experience to the consumer.

AUTOMATED
COCKTAIL MIXER
Final Report

Author:
Boby Hartanto Aliono
(6512453)
Hartomo Arlandianto Prabowo (6509899)

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Table of Contents
Outline............................................................................................................................................. 3
Introduction ..................................................................................................................................... 3
Cocktail Mixer ............................................................................................................................ 3
Stepper Motor ............................................................................................................................. 3
Electronics Components ............................................................................................................. 4
Changes ....................................................................................................................................... 5
Implementation of Software and Hardware .................................................................................... 6
Software ...................................................................................................................................... 6
Hardware ..................................................................................................................................... 9
Results ........................................................................................................................................... 12
Discussion ..................................................................................................................................... 14
Conclusion .................................................................................................................................... 15
References ..................................................................................................................................... 16
Appendix ....................................................................................................................................... 17
Hardware ................................................................................................................................... 17
1.

A Unipolar Stepper Motor .......................................................................................... 17

2.

5 and 6 wire arrangement for Unipolar Mode [12] .................................................... 17

3.

Wire Arrangement of 57BYGH7630 [9] .................................................................... 17

4.

Wave Drive Stepping Sequences [11] ........................................................................ 18

5.

Wave Drive Coil Waveform [12] ............................................................................... 18

6.

Flyback Diode............................................................................................................. 18

7.

LED in series with resistor ......................................................................................... 18

8.

Circuit Diagram of the Cocktail Mixer....................................................................... 19

9.

Sensor Circuit Diagram (Obtained from the datasheet given by the supervisor) ....... 19

10.

Switch-Push Button Diagram (Obtained from the Lab Refreshing Exercise) ............ 20

11.

Using Transistor 2N3904 for the Driver Circuit ........................................................ 20

12.

Using TIP 120 for the driver circuit ........................................................................... 20

13.

Calculation of Base Resistor....................................................................................... 21
Page | 1

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

14.

Calculation of LED resistor ........................................................................................ 21

15.

Soldering Connections on the Perforated Board ........................................................ 21

16.

Final Soldered Circuit ................................................................................................. 22

17.

Counterclockwise Waveform ..................................................................................... 22

18.

Clockwise Waveform ................................................................................................. 23

19.

Rotation Frequency According to Optical Encoder ................................................... 23

Software .................................................................................................................................... 24
1.

State Machine and Flowchart ..................................................................................... 24

2.

Main Code .................................................................................................................. 25

3.

SPI_LCD.c .................................................................................................................. 29

4.

Var.h ........................................................................................................................... 34

5.

LCD.h ......................................................................................................................... 34

Page | 2

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Outline
The objective of this project is to design an automated mixer, which utilizes stepper motor to stir cocktail beverages. The functionality of this mixer is enhanced by the implementation of two infrared sensors which act as a turn on and turn off switch, one fail-safe push-button switch to turn off the stepper motor and LCD display to provide the display to the user.
This report consists of:
1.
2.
3.
4.
5.

Introduction to cocktail mixer and theoretical background of the components used
Implementation of software and hardware
Results obtained by the end of this experiment
Discussion and personal evaluation
Conclusion

Introduction
Cocktail Mixer
Cocktail mixer is a device that is utilized to mix beverages (usually alcoholic) by stirring them in a blender-like machine. While a lot of common people might argue that the cocktail can just be shaken, many type of cocktails especially those that involves transparent liquid such as martinis and vodka are designed to be stirred. This is due to the fact that shaking them will lead to a cloudy appearance as it introduces air bubbles into the drink [1]. Consequently if those drinks are not stirred, this will lead to multiple concerns in aesthetic and taste.
In many cocktail bars, bartenders are usually the busiest person as they are the one who prepares all the drink to numerous of customers [2]. Without a presence of automated machines with them, this bartenders are very likely to make mistakes during the cocktail mixing process which in the end will result in the loss of satisfaction from the customers. Due to these demands, a cocktail mixer is constructed in this experiment. The automated cocktail mixer will reduce the burden of bartenders and help to fulfill the need of the customers. This paper shows how the utilization of stepper motor and PIC microcontroller are implemented to create a cocktail mixer.

Stepper Motor
For more information on the stepper motor overview, one can see the project proposal which has covered most of the basic information [3]. The theoretical background in this section will cover a more in-depth explanation of the theory that are utilized in this experiment.
Recapping from the project proposal, stepper motor is a type of motor that will rotate to a specific number of degrees depending on the digitally controlled electrical pulse that was fed into the motor.
One of stepper motor’s main advantages is the ability to be accurately controlled without any feedback system (an open-loop system) [4]. The stepper motor used in this experiment is
Page | 3

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

57BYGH7630 stepper motor which is a hybrid stepper motor [5]. Hybrid stepper motor is the amalgamation of a permanent magnet and variable reluctance stepper motor. It has the combination of best features from both of them [6]. As a result, this type of stepper motor can create a greater amount of power than the other type of stepper motor with a similar size. This is due to the fact that a permanent magnet type of stepper motor will relies only on its magnets while a variable stepper motor will count on its teeth to rotate the motor accurately [7]. However, a hybrid stepper motor combines both feature in its working principle. As a result, it becomes a more accurate and reliable stepper. Nonetheless, the setback of a hybrid stepper motor is the fact that it tends to be considerably more expensive [6].
This experiment operates a unipolar arrangements on the electromagnetic coils winding. Simple recap from the project proposal, a unipolar stepper motor will rotate when current is introduced from its center tap into one of the winding, creating north and south pole in its stator [3].
Subsequently, the rotor will move into the position that is dependent on which windings that are energized. Example and illustration can be seen from appendix 1 (Hardware Section). Unipolar motors usually have either 5 or 6 wire connections. The five-wire connection type indicates that the center taps has been connected internally, while the six-wire type does not [8]. Their configuration can be seen on appendix 2 (Hardware Section). The 57BYGH7630 stepper motor uses a six-wire type configuration (See Appendix 3 Hardware Section) which can be seen from its datasheet [9]. The arrangement of the wire will then require the common A and B to be connected together to the power supply and then the other wires to be coupled to the unipolar circuit driver
[10].
As explained in the project proposal, this experiment implements wave drive stepping sequences to move the stepper motors. Wave drive sequence requires the stepper motor be rotated by turning on a single winding at any given time as illustrated by appendix 4 (Hardware Section).
Consequently, this behavior makes wave drive to be faster than the rest of the stepping mode since only one winding needs to be energized by the current at any given time [11]. The waveform of the activated coil can be observed from appendix 5 (Hardware Section). Nonetheless, this stepping sequences produce the lowest torque compare to other stepping sequences [6]. Since torque is not the main priority in a cocktail mixer system, a unipolar mode will be sufficient to drive the stepper motor which benefits in lower cost and complexity [8].

Electronics Components
The explanation of each electronic components has been mentioned in the project proposal. Even though there are changes in the design, all electronic components that has been explained are still used. Consequently, it will not be discussed again in this section. Nonetheless, there are additional notes required for the light emitting diode as in the project proposal, the LED was only used as an

Page | 4

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

electronic device to tell the user the difference in speed and the presence of glass. Another records are the change of the purpose of the infrared obstacle sensor.
Diodes are required in the driver circuit to protect the components from the coil’s inductive kickback, which are the TIP 120 transistors in this case. When a coil is switched, an inductive surge flows in the circuit. Consequently, a diode is then placed across each transistor collector current which prevent damage in the transistor by delivering a safe way of dispersing the reverse current [8]. The illustration is shown by appendix 6 of Hardware Section. However, the diode that are implemented in this experiment is a light emitting diode and unlike normal diode, LEDs cannot be directly connected to a power supply. If it is directly connected with a power supply, it will most likely burn out in an instant due too much current passing through. Consequently, LEDs should have a resistor in series to limit the current to a more secure value [13]. This is further illustrated by appendix 7 (Hardware Section). A greater resistor value should be chosen when the calculated value is not available in order for the current to be less than the one that has been calculated. The effect of utilizing a greater resistor value will result in the reduction of the LEDs’ brightness [8].

Changes
During the construction process, some changes are made along the way. First, the sensor is no longer implemented to detect the presence of glass. Instead, two infrared obstacle sensors are utilized in this experiment to turn on and turn off the stepper motor. Next, there is only one switchpush button that are operated in the circuit to act as a fail-safe switch that turn off the stepper motor if the sensor is not working. Previously, four switch-push button were implemented. However, the limitation on the amount of interrupt and the time constraint make this function unable to be applied. Consequently, the change of speed are not implemented into this circuit. The revised state machines and flowchart of the system can be seen in Appendix 1 (Software Section).

Page | 5

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Implementation of Software and Hardware
Software
The software implementation of this project comprises of 3 main coding aspects, which are: stepper motor coding, interrupts coding, and LCD display coding. Stepper motor coding focuses on how to drive and stop the stepper motor. These two are the main objectives of this project. Then, interrupts coding handles all of the external sensors and switches to control the stepper motor. At last, the LCD display coding is implemented to display the program menu as well as the current status of stepper motor.
Stepper Motor Coding
As discussed earlier in the introduction of the project, wave drive stepping sequence is the one to be applied for this stepper motor. Referring to this wave drive concept, it means there will be only one winding is active or energized at a given time [11]. Thus, the coding of this stepper motor is designed to give high values towards the four windings one by one to complete one cycle of rotation. This is done by implementing these following C syntaxes taken from Fast_Clockwise() function: (See Appendix 2 Software Section ) port = 0b00001000;
Delay100TCYx(DELAY);
port = 0b00000100;
Delay100TCYx(DELAY);
port = 0b00000010;
Delay100TCYx(DELAY);
port = 0b00000001;
Delay100TCYx(DELAY);

The syntax port here refers to the PORTD registers in
PIC18F87J11, which all of the 8 bit pins have been preconfigured to be output pins for the stepper motor. In
0b00001000, the right most value refers to pin 0 (RD0), then it is followed on the left by the value of zero on RD1 pin, value of zero on RD2 pin, and finally value of 1 on RD3 pin. Since there are 8 bit pins, therefore there will be pins available from
RD0 to RD7.

Now, to energize one winding at the time, high value (1) is given to the specific port pin in which the winding is connected to. For instance, based on the circuit design in Appendix 8 (Hardware
Section), the winding A of stepper motor is connected to RD3 or PORTD pin number 3. Thus, port = 0b00001000; will energize that winding A because high value (1) is given to the RD3 pin. Then, the syntax continues to energize RD2 (winding B), RD1 (winding Ȧ) and ends at RD0
(winding Ḃ). Those following syntaxes will enable the motor to rotate in clockwise direction.
It can also be noticed a delay function Delay100TCYx(DELAY)is inserted between each stepping sequence. This delay function will control the period of stepper motor’s rotation. The longer the delay, the slower the stepper motor rotates. Variable DELAY is set to equal to 12, which is the fastest the motor is able to rotate under 8.9V power supply. Rather than using direct values into the Delay100TCYx()function, DELAY variable is applied to satisfy good software engineering practice. Page | 6

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Counterclockwise direction is also required in this project. port = 0b00000001;
This can be done easily by reverting the energizing sequence of
Delay100TCYx(DELAY);
the winding. Now, the winding is energized starting from port = 0b00000010; winding Ḃ to winding A (RD0 to RD3). These
Delay100TCYx(DELAY);
counterclockwise syntaxes can be found in the port = 0b00000100;
Fast_Counter() function. Meanwhile, to ensure the clockwise
Delay100TCYx(DELAY);
and counterclockwise rotation occurs at 5 seconds each, both of port = 0b00001000; the syntaxes are capsuled into for-loop function. for(i = 0; i
Delay100TCYx(DELAY);
< 1041; i++). Doing so, it will kept the rotation occurs for 5 seconds if there are no interrupts presence. Trial and error procedure is implemented to determine the value of i and any change on variable DELAY requires change in value of i subsequently.
On the other hand, stopping the motor rotation is relatively simple. By not energizing any windings at all, the stepper motor will not rotate. This function is written inside the Stop_Motor() function, which will set all the PORTD bits equal to zero (port = 0b00000000).
Interrupts Coding
There are two types of interrupts available in PIC18F87J11 [14]. These are external interrupts initiated by PIC18F87J11’s interrupt pins, and internal interrupts initiated by internal peripheral devices such as on-chip A/D converter and on-chip timers [14]. In this project, external interrupts are chosen since IR sensors and push-button switch are external components. Inside the external interrupt itself, can be more classified into two groups: high-priority interrupt levels and lowpriority interrupt levels [15]. High-priority interrupt events are able to interrupt any low-priority interrupts that may be in progress, but low-priority interrupt cannot interrupt high-priority events
[15]. However, before going into further, setting up the interrupt is the first thing to do.
First, Microchip Technology has predefined an address for the interrupt functions or also known as “Interrupt address vector” [15]. At this address, the Interrupt Service Routine (ISR), which contains the program to rotate / stop the
#pragma code InterruptVectorHigh = 0x08 stepper motor, is written. The directive void InterruptVectorHigh (void){
#pragma code InterruptVectorHigh = asm 0x08 here is used to assign the address 0x08 goto InterruptServiceHigh for label InterruptVectorHigh, which
_endasm } happens to be the address for high-priority interrupt level. However, since C18 compiler does not allow the program to directly jump to the interrupt service routine at 0x08, assembly language goto should be used [15]. Doing so, the program will jump to #pragma interrupt InterruptServiceHigh when an interrupt flag is raised. Interrupt service routine will be explained in good detail in the latter part.
Inside the main function (see Appendix 2 Software Section), the several syntaxes are written to setting up the external interrupts. Firstly, since IR sensors and push-button switch are connected into PORTB pins, therefore all of the PORTB pins are set as input ports by TRISB = 1.Afterwards,
INTCON2bits.RBPU = 0 will enable all of the PORTB pull-ups to ensure the interrupt routine
Page | 7

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

works properly. On the other hand, INTCONbits.INT0IE = 1, INTCON3bits.INT2IE = 1, and
INTCON3bits.INT3IE = 1, will enable the external interrupt on RB0, RB2, and RB3 respectively
[14]. Based on the circuit design in Appendix 8 (Hardware Section), RB0 port is connected with push-button switch with RB2 and RB3 ports are connected with the IR sensors. All of the external interrupts will be set in high priority levels and this is why INT2IP and INT3IP are set as 1 [14].
Moreover, every interrupt flag should be cleared before any interrupt service routine works. This is done by setting all the values of INT0IF, INT2IF, and INT3IF equals to 0.
At the beginning of the ISR service routine, the #pragma interrupt InterruptServiceHigh should be included to make sure the program jump to that ISR service routine and also to return to the main program at the end of the service routine [15]. This correlates with the goto functions which is discussed earlier. Now, inside the ISR service routine, each external interrupt flags are checked by applying if-else if functions. For instance, if (INTCONbits.INT0IF) will check the interrupt flag on RB0 port, while else if (INTCON3bits.INT2IF) will check the interrupt flag on RB2. Doing so, the program may know which interrupt routine function is going to be executed.
Therefore, inside the if(INTCONbits.INT0IF) and else if(INTCON3bits.INT2IF) will be written Stop_Motor()functions, since both of them handle the stopping interrupt routine. Then,
Fast_Counter()and Fast_Clockwise() are written inside the else if (INTCON3bits.INT3IF).
Extra syntax such as if(INTCONbits.INT0IF || INTCON3bits.INT2IF || INTCON3bits.INT3IF)
{i = 1040;} is also added into the rotating and stopping motor functions to check whether an interrupt flag is raised during the running functions. For example, during the running of
Fast_Clockwise() function, suddenly RB2 interrupt flag is raised, means that the motor should stop immediately. In addition, clearing the interrupt flag should be done right after the interrupt flag is raised. Failing to do so may result in not knowing whether the interrupt flag is raised again or not.
LCD Display
LCD display is the final part of the software implementation in this project. Most of the main coding for LCD display are written inside the spi_LCD.c file but the texts which are going to be displayed in LCD screen is written inside the var.h file. Since the spi_LCD.c is integrated well with the main program, thus any changes mostly done by changing the content of string char array inside var.h file and deciding which LCD screen line the text is going to be to.
The following five lines of syntax can be found throughout the main c file to program the LCD display. LCDInit() should always be written at the beginning
LCDInit();
as the initialization of the LCD display. It should be included
LCDLine_1();
every time LCD display functions are going to be used. On the string_write(#); other hand, LCDLine_1() and LCDLine_2() decide in which
LCDLine_2();
LCD screen should the text be displayed, LCD screen 1 or screen 2 respectively. Then, right after choosing the LCD line string_write(#); screen, the string_write() function is used to display the texts written in the var.h file according to which array number it refers to. For instance,
Page | 8

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

string_write(0) will display the strings from array number 0: “Cocktail Mixer: ”. For all the list of texts which are going to be displayed in this project, refers to Appendix 4 (Software Section).
Notice also that each LCD screen line can only contain 16 characters. Thus, each array values should not exceed 16 characters as well. Even spaces “˽” or tabs are considered as 1 character.
Moreover it is best to use space instead of tabs to complete 16 characters because tabs will result in displaying full black colors on each block the tab is written to, while spaces will leave the block blank [15].
Now, during the startup of this project, the LCD will display the menu of cocktail mixer. It will inform the user to use sensor 1 to start rotating the stepper motor or sensor 2 to turn off the motor.
By then, once the stepper motor starts to rotate, the LCD will display the current speed of motor
(250RPM) and also to inform the user that sensor 2 or push-button switch can be used to stop the motor. Once the motor stopped, the LCD screen will display standby status and inform the user that sensor 1 is ready to be used again to run the stepper motor. Those five lines of syntax are written and edited into different functions accordingly. Thus, Fast_Clockwise() function will have different values of string_write() function compared with Stop_Clockwise() function

Hardware
The final list of the additional major electronic components that are implemented other than the stepper motor and PIC microcontroller are as follows:
Components

Quantity

E18-D80NK Infrared Sensor

2

LED

4

TIP 120 Transistor

4

Resistor (2.2 kΩ)

4

Resistor (560 Ω)

4

Perforated Board

1

Thin Cable Wire (For soldering purposes)

±50 cm

Table 1: Electronic Components

Simple summary of how the circuit works is such as follows. The code will activate each ports correspondingly and transmit small current to the base junction. The transistors act as both switch and current amplifier which is limited by the resistors. Current will then introduce to the collector side. As a result, the corresponding winding is energized and changed at a very pace. The rotor will snap into the position as the energized winding alters. As switch is closed and opened all the time, LED is placed in the collector side to reduce the effect of the voltage spike from the inductive
Page | 9

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

load. The code will activate depending on each sensors or switch that are activated. The implementation of the hardware are divided into two major parts: the breadboarding and the soldering stage.
Breadboarding stage
The circuit diagram of the cocktail mixer circuit can be observed from appendix 8 (Hardware
Section), with sensors and switch push button diagram at appendix 9 and 10 (Hardware Section).
Initially, to rotate the 57BYGH7630 the testing was done in the breadboard and the 2N3904 transistors are implemented (See Appendix 11 Hardware Section). At this stage, the base resistors are not implemented since 2N3904 transistors does not have a high gain [16]. The motor rotates, however the movements are not smooth since it does not have enough current to drive the stepper motor circuit. Consequently, the TIP 120 darlington transistor is utilized since it has a minimum current gain of 1000 [17]. In contrast, 2N9304 has a minimum gain of 100 [16]. The circuit configuration can be seen from appendix 12 (Hardware Section). Since the TIP 120 transistors have a high current gain, base resistors should be introduced to maintain the current flows in the collector side [8]. The base resistors applied are 2.2 kΩ. The calculation to find the base resistor value is shown in appendix 13 (Hardware Section). The voltage supply is initially set to be 3V as the rated voltage. However, this amount of supply is insufficient to provide enough speed for the stepper motor during the experiment. Hence, to get more speed the motor is run at a supply higher than the rated voltage. This implementation should be done very carefully though. By running the motor above the rated specification, the motor will be able to run at a higher speed, however the stepper motor will become very hot and breakdown can occur at this stage. Most stepper motor are designed to sustain temperatures up to 90°C without thermal breakdown occurring [18].
Consequently, when applying the value higher than the rated specifications, one should introduce more grounding into the circuit for safety purposes [8]. Other than that, always keep a finger on the motor to ensure that it is not overheating. After some experiments, it was found out that the motor was not overheating when 8.9 V supply is applied. Thus, the supply voltage is set at that value since it generate a fast motor rotation. Note that the speed of the stepper motor has not been calculated at this stage.
The presence of diode on the collector side is very vital especially since the voltage supply is set at a value higher than the rated one. All the LEDs will then be placed in series with 560 Ω resistor.
The analysis of the resistance value is shown in appendix 14 (Hardware Section) by utilizing the value obtained from the 3mm LED datasheet [19]. The problem that could occur in the breadboard stage is thermal meltdown due to the fact that breadboard has a maximum current rating of 2A.
Nonetheless during the experiment, this problem does not occur very often as long as the grounding is ensured to be rightly connected.

Page | 10

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

For the sensors and switches, the voltage supply must be connected with the supply given by the
PIC Explorer Demo Board. Since their current will be directly fed into the Demo Board, the current from the voltage supply should not be used as they cannot be controlled. However, the current from the PIC Explorer Demo Board has been set such that it will not damage its own circuit. The sensor distance is adjust by rotating the screw in the back. Counterclockwise rotation will reduce the sensing distance. The distance is set as 5 cm. After the circuit works on the breadboard, one can then move to soldering the components.
Soldering Stage
Breadboarded circuit are utilized only for prototyping or testing stage. Once the circuit has worked, the circuit should be soldered into either a printed circuit board (PCB) or a perforated board. In this experiment, a perforated board is used. Unlike PCB, perforated board requires more effort in the soldering stage as the connections have to be made separately. The connections can be made by bridging the soldering lead into the board into specific components or using some wire cables.
For connections that are not very far apart, the bridging method can be performed. The wire cables can be implemented for the connection that are further apart. In this circuit, bridging is also done to connect the supply voltage and the ground voltage. The connections of the perforated board can be seen from appendix 15 (Hardware Section). Once the circuit has been connected properly, then it can be tested with the stepper motor. The most important part is to ensure that the grounding are properly connected. Two grounding cables are applied into this soldered circuit. During the soldering part, it is also important to ensure that the cables are orderly managed, they can be grouped by twisting the cable together. The color of the connecting cables are also matched, e.g. black for ground, red for voltage. Other than that, both the board and the cables are also tagged by using a label printer so that not only the circuit designer can use the circuit. This can be seen from appendix 16 (Hardware Section). The infrared sensor that is marked with number “1” is used to start the motor while the other one that is marked with number “2” is utilized to stop the motor.
Nonetheless, the circuits are able to work

Page | 11

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Results
Rotating and Stopping Stepper Motor
The stepper motor used in this project is able to rotate and stop accordingly depending on which sensors currently detect an object. To be more specific, the stepper motor can rotate in both clockwise and counterclockwise directions in 5 seconds for each direction and stop immediately when the interrupt is coming from push-button switch or sensor number 2. Figure 1 is the latest display of the stepper motor.
The yellow plate surrounding the motor’s shaft is the optical plate sensor. It is used to measure the frequency of the waveform produced in the motor’s coil and subsequently one can obtain the speed rotation of the motor. Good detail on speed measurements can be found in the latter part of this results section.

Figure 1: Stepper Motor with
Optical Plate

LCD Display

Figure 2: Initial LCD Display

LCD display contributes a big role in the user-friendliness of this cocktail mixer. Through LCD screen display, the user may know what the status of the cocktail mixer is and also which sensors or switch should the user choose.
Figure 2 shows the beginning display of this automated cocktail mixer. It informs the user to choose sensor 1 to start rotating the motor or sensor 2 / switch 3 to let the motor stay in standby mode.

Once the sensor 1 is chosen, the stepper motor will immediately start to rotate. During the progress, the LCD will display as it is shown in figure 3. LCD screen line 1 will show that motor is currently on and rotating, then LCD screen line 2 will show the current speed rotation of the motor. Moreover, the users are also informed that they can use sensor 2 / switch
Figure 4: LCD Display When Mixer is On
3 to stop the motor rotation. If the user choose one of those two interrupts, then the motor will stop directly and LCD screens will displayed as shown in figure
4. These results show that all of the coding parts are
Figure 3: LCD Display When Mixer is Standby integrated well with the hardware design.
Page | 12

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Waveform and Speed Measurements
As discussed earlier in the introduction part, the expected waveform from wave drive stepping sequence should be in the form as seen in appendix 5 (Hardware Section). At the same time, the waveform produced from the coil of this final product are shown in appendix 17 and 18 (Hardware
Section). Appendix 17 shows the waveform produced under counterclockwise direction rotation, while appendix 18 shows the clockwise direction. Compared to the expected waveforms, both of them conform the same shape, phase, and stepping sequence. Thus, these results confirm that this stepper motor works correctly under wave drive stepping sequence.
Optical sensor and oscilloscope are used to measure the speed rotation of this stepper motor. By observing the waveform frequency captured by the optical sensor, the rotation speed can be obtained. Figure 5 shows the waveform captured when the motor works under the delay of 12 in
8.9V power supply. This is the lowest delay the motor can work into, which means the fastest the motor can rotate
From appendix 19 (Hardware Section), for 1 pulse
(1 hole in the optical plate side), the waveform frequency is: 417 Hz. Subsequently, the waveform period is: 0.002398 s ( =
Figure 5: Waveform Obtained From the Optical Encoder

1

1

= 417)

Since there are 100 holes on the optical plate; the total period is: 0.002398 × 100 = 0.2398
Revert it back into frequency ( =

1

1

= 0.2398), then the overall frequency is 4.17 Hz. In other

words, the speed rotation of the motor is about 250 RPM (4.17 × 60 = 250 )

Page | 13

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Discussion
This automated cocktail mixer is completed within 10 weeks as planned. It starts from 18th
February to 29th April 2014. A minimum total of 6 laboratory hours are spent every week to complete this project. The lab working hours are divided into two at least two days which consist of three supervised hours on every Tuesday and another three unsupervised hours on every
Wednesday. The rest of the times are usually spent for research since it will be much more efficient to come to the class prepared. At the end week 10, the cocktail mixer is able to run by a single
+8.9V power supply. It is also capable of starting and stopping the motor using 2 infrared obstacle sensors. As mentioned previously, the main concerned with the current cocktail mixer operation is the fact that they are using a higher voltage than the rated one. Since motor winding consists of inductor and resistor, the increase in the voltage supply will result in a faster rate to reach steady state and therefore increasing the motor’s maximum operating speed. However, this benefits come with an undesirable side effects. By running the motor with higher voltage supply, it will start to rotate stiffer. As a result, the motor will start to vibrate due to its tendency to snap into position as the torque output increases with higher voltage. A more audible noise is also generated due to this vibration. Other than that, the temperature of the motor will also increase as the resulting current in the winding that is also increased due to the higher applied voltage [8]. This will then increase the winding power loss which results in heat and can damage the motor if it is too great.
Consequently, it is important to the stepper motor are carefully monitored to ensure that it is not overheating. Nonetheless, restating what has been mentioned in the last section, the stepper motor will not overheat even though higher voltage is applied as long as the grounding is ensured to be properly connected.
Other problem happened during the breadboarding stage due to the limit in the maximum breadboard current rating, especially if the grounding is not done correctly [20]. Therefore, it is highly recommendable not to let the final stage of the hardware implementation stop in the breadboarding stage. Once the circuit has worked on the breadboard, one should directly solder it in the perforated board.
After the experiment, it was also found out that the base resistance is not really affecting the current in the collector junction as the motor resistance in the collector side creates a DC biasing circuit between the collector and the supply voltage. Therefore, the current will flows depending on the voltage applied and the motor resistance value. Nonetheless, the base resistor should not be removed as it works to ensure that if unexpected accidents happen to the motor winding, the collector current is still limited.

Page | 14

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

For further improvements, speed option can be implemented to provide the users with more mixing option. Next, heatsink can be applied to each transistors to prevent overheating that can damage the components or the board. Other possibility is the use of servo motor instead of stepper motor for this application since the servo motor shine for applications where high speed is required.
Stepper motors have more poles than servo motors as a result, stepper motor excels at the application where a high precision is required which is not the priority in this case [8]. Even though servo motors are more efficient and does not suffer from vibration, it should be noted that they are more expensive [21]. Consequently, their operation should be considered wisely. However if the stepper motor is to be utilized, one can apply the linear speed control technique to obtain a higher speed. This technique should also be added to the improvement list of this cocktail mixer.
Furthermore, if the mixer is to be produced in mass, one could search for a cheaper alternative of microcontroller. The implementation of PIC18 explorer demonstration board was completely inefficient in this case since there are many ports and functions that are not being used for this application. Consequently, one should look for other alternative e.g. constructing a personalized microcontroller using individual integrated circuit and chips instead of purchasing the whole explorer demonstration board.

Conclusion
Despite minor changes of the usability of this automated cocktail mixer, the product successfully achieves its main objective. The stepper motor is able to rotate under 5 seconds in clockwise directions and another 5 seconds in counterclockwise direction. The infrared sensors and pushbutton switch are also integrated well into the system such that the motor responds immediately once there is an interrupt occurred. Moreover, LCD display is provided to enhance the userfriendliness of the product. The user will understand how to operate this mixer by simply following the information displayed in the LCD screen. With few improvements and more enhanced functions, this prototype cocktail mixer could be implemented in daily life basis. In summary, the aim of this 10 weeks project not only to achieve the final product, but also teaches engineer learners to think critical and be intuitive. Moreover, it also fosters engineer learners for their time management duty and teamwork skill.

Page | 15

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

References
1. Graham, Colleen. 2012. When to Shake and When to Stir Cocktails. [ONLINE] Available at: http://cocktails.about.com/od/mixology/f/shake_or_stir.htm. [Accessed 18 April 2014].
2. Raphael, Asuncion, 2007. An Automated Microcontroller-based Cocktail Mixer and Dispenser. Engineering E-Journal, 1, 111-125.
3. Boby Hartanto Aliono, Hartomo Arlandianto Prabowo, 2014. Project Proposal of
Automated Cocktail Mixer. University of Nottingham Ningbo China.
4. Omega. 2003. Introduction to Stepper Motor. [ONLINE] Available at: http://www.omega.com/prodinfo/stepper_motors.html. [Accessed 08 March 14].
5. Fonder. 2013. High Quality 57BYGH7630 STEPPER MOTOR. [ONLINE] Available at: http://www.fonder.com/shopping/itemDetail.html?itemId=461441793. [Accessed 28
April 2014].
6. Industrial Application Notes Stepper Motor Basics.
7. NMB.
2010.
Hybrid
Stepper
Motor.
[ONLINE]
Available at: http://www.nmbtc.com/hybrid-step-motors/. [Accessed 29 April 2014].
8. Paul Scherz, 2013. Practical Electronics for Inventors, Third Edition. 3 Edition.
McGraw-Hill/TAB Electronics.
9. Stepper Motor 57BYGH7630 Datasheet.
10. PIClist. 2013. Stepper Motor Connection Options. [ONLINE] Available at: http://www.piclist.com/techref/io/stepper/connections.htm. [Accessed 28 April 2014].
11. Engineers Garage. 2012. How to interface Stepper Motor with 8051 Microcontroller
(AT89C51). [ONLINE] Available at: http://www.engineersgarage.com/microcontroller/8051projects/stepper-motorinterfacing-with-8051-microcontroller-circuit. [Accessed 09 March 2014].
12. All About Circuit. 2007. Stepper motors : Ac Motors. [ONLINE] Available at: http://www.allaboutcircuits.com/vol_2/chpt_13/5.html. [Accessed 29 April 2014].
13. Thomas L. Floyd, 2011. Electronic Devices (Electron Flow Version) (9th Edition). 9
Edition. Prentice Hall.
14. Microchip Technology Incorporated. 2008. PIC18F87J11 Family Datasheet.
15. M. Rafiquzzaman, 2011. Microcontroller Theory and Applications with the PIC18F. 1
Edition. Wiley.
16. Weitron . 2N3904 Transistor Datasheet.
17. Weitron . TIP 120 Transistor Datasheet. 2010.
18. Home Shop CNC. 2010. STEPPER MOTORS FAQ. [ONLINE] Available at: http://www.homeshopcnc.com/index.php?option=com_content&view=article&id=46&ph pMyAdmin=gjQeLcQXonscHADUnJFyBQXt9I5. [Accessed 29 April 2014].
19. LED-TECH.DE Optoelectronics. 2014. 3mm LEDs. [ONLINE] Available at: http://www.led-tech.de/en/3mm-LEDs_DB-3.pdf. [Accessed 30 April 2014].
20. Bus Board. BB830, BB830T – Plugin BreadBoards. [ONLINE] Available at: http://www.busboard.us/pdfs/BPS-MAR-BB830+BB830T-001.pdf. [Accessed 30 April
2014].
21. Advanced Micro Controls Inc. 2014. Stepper vs. Servo. [ONLINE] Available at: http://www.amci.com/tutorials/tutorials-stepper-vs-servo.asp. [Accessed 01 May 2014].

Page | 16

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

Appendix
Hardware
1. A Unipolar Stepper Motor

Picture Source: http://mechatronics.mech.northwestern.edu

When the current flows to winding 1, the vertical poles will become energized whereas the horizontal poles will be energized when the current is removed from winding 1 and introduced through winding 2. A hybrid motor can work in both unipolar and bipolar mode [3].
2. 5 and 6 wire arrangement for Unipolar Mode [12]

Let 1 = , 1′ = ̅, 2 = , Φ2′ = ̅

3. Wire Arrangement of 57BYGH7630 [9]

Page | 17

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

4. Wave Drive Stepping Sequences [11]

5. Wave Drive Coil Waveform [12]

Counterclockwise Waveform

Clockwise Waveform

Let 1 = , 2 = B, 3 = ̅, , 4 = ̅

6. Flyback Diode

Source: http://www.element14.com

7. LED in series with resistor
Resistor value, R is given by:
=



VS = Voltage supply, VL = LED voltage drop, I = LED max current
Source: http://electronicsclub.info/leds.htm

Page | 18

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

8. Circuit Diagram of the Cocktail Mixer

+8.90 V
560 Ω

2.2 KΩ

TIP120
(NPN)
560 Ω

PIC18F87J11
Microcontroller RD3
Demoboard RD2

2.2 KΩ

RB2

RB3

A

Ȧ

B



560 Ω

RD1
RD0
RB0

TIP120
(NPN)

2.2 KΩ

TIP120
(NPN)
560 Ω

Sensor 2

Sensor 1

Switch

2.2 KΩ

TIP120
(NPN)

The circuit diagram for the sensor and switch can be seen from appendix 9 and 10.
9. Sensor Circuit Diagram (Obtained from the datasheet given by the supervisor)
The screw in the back can be used to adjust the accuracy of sensing distance. Yellow Line gives high voltage when there are no obstacles, and low voltage when there is an obstacle.
Notes: Change the green color into black. Page | 19

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

10. Switch-Push Button Diagram (Obtained from the Lab Refreshing Exercise)

RB0

11. Using Transistor 2N3904 for the Driver Circuit

12. Using TIP 120 for the driver circuit

Please note that there base resistor has not been implemented at this stage which is not a good practice as it will most probably burn out instantly.
Page | 20

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

13. Calculation of Base Resistor =



The gain can be obtained from the transistor datasheet which is 1000 in the case of darlington TIP
120 transistor. For the collector current, it has to reach at least 3 A in order to drive the stepper motor smoothly according to the datasheet. Consequently: = 3⁄1000 = 0.003 A = 3 mA
Thus, the base current needs to be 3 mA at least to rotate the stepper motor. By acquiring the minimum base current value, the required base resistor can then be determined by the following
( − )
⁄ . The supply voltage is 8.9 V and the base emitter voltage of the equation: =

(8.9 − 2.5)⁄ transistor is 2.5 V according to the datasheet. Hence, =
0.003 = 2133 Ω. The closest resistor value available is 2.2kΩ.
14. Calculation of LED resistor
By implementing the formula from appendix 7. The supply voltage is 8.9 V and according to the
3mm LED data sheets [19], it was found out that the LED forward voltage is ranging from 1.8V3.6 V and current of 20 mA. To ensure that the current is limited, the lowest voltage value is used.
=

− 8.9 − 1.8
=
= 355 Ω

0.02

Choosing the nearest standard value which is greater, 560 Ω is utilized.
15. Soldering Connections on the Perforated Board

Note that the electronic component wires has not been snipped to length prior to soldering on this picture. Page | 21

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

16. Final Soldered Circuit

17. Counterclockwise Waveform

Channel 4: , Channel 3: , Channel 2: ̅ , Channel 1: ̅

Page | 22

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

18. Clockwise Waveform

Channel 4: , Channel 3: , Channel 2: ̅ , Channel 1: ̅

19. Rotation Frequency According to Optical Encoder

Page | 23

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

Software
1. State Machine and Flowchart
Display LCD
Check Sensor 1

Push Button Switch
Standby

Initialization

Sensor 1
Detected

Start

do / stop rotation

Stepper Motor
Check Interrupt

do/ motor stop + check sensor 1 Complete

do / CW & CCW rotation

Sensor 2 do/ stop rotation

Display LCD

Default

Initialization

Standby

Start

Sensor 2

Push Button Switch

Start

Start

Start

Initialize Interrupt

Port=
0b00000000

Object detected? Initialize LCD
No
Sensor 1 detect? Initialize Delay

No

Yes
Display
LCD

Switch Pressed

No

Yes
End

Display
LCD

End

Display_Beginning()

Goto Stepper
Motor

End

Goto
Standby

Goto
Standby

Stepper Motor
Check
Interrupt

Start

Display LCD Line 1
&2
Clockwise Wavedrive
(5 seconds)

Check Interrupt

Counterclockwise
Wavedrive 5 seconds

Go back to Start

Sensor 1

Goto
Sensor 2

Sensor 2

Goto
Switch

Switch

Goto
Standby

Check
Interrupt

End

Page | 24

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

2. Main Code
//-------------------------------------------------------------------------------------------//
//*************** C O C K T A I L M I X E R *********************************//
//************* PROJECT BY: BOBY HARTANTO ALIONO & HARTOMO
ARLANDIANTO PRABOWO **************//
//-------------------------------------------------------------------------------------------//
/** I N C L U D E S
*************************************************************************/
#include "p18f87j11.h"
#include
#include "LCD.h"
/** P R O T O T Y P E
***********************************************************************/
void Stop_Motor(void); void Fast_Clockwise(void); void Fast_Counter(void); void Display_Beginning(void); void InterruptServiceHigh(void);

/** V A R I A B L E S
**********************************************************************/
#define port PORTD
// The port to connect motor coils int i,j;
// Variables int DELAY = 12;
// Delay to control the speed of motor rotation
/** I N T E R R U P T S
********************************************************************/
// High priority interrupt vector
#pragma code InterruptVectorHigh = 0x08 void InterruptVectorHigh (void)
{
_asm goto InterruptServiceHigh // jump to interrupt routine
_endasm
}

/** D E C L A R A T I O N S
***************************************************************/
#pragma code // declare executable instructions void main (void)
Page | 25

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

{
// Init I/O
TRISD = 0b00000000;
TRISB = 1;

// PORTD bits 7:0 are all outputs (0)
// PORTB bits &:0 are all inputs

INTCON2bits.RBPU = 0;

// enable PORTB internal pullups

// Set up switch interrupt on INT0
INTCON2bits.INTEDG0 = 0;
// interrupt on falling edge of INT0 (switch pressed)
INTCONbits.INT0IF = 0;
// ensure flag is cleared
INTCONbits.INT0IE = 1;
// enable INT0 interrupt
// NOTE: INT0 is ALWAYS a high priority interrupt
// Set up switch interrupt on INT2
INTCON2bits.INTEDG2 = 0;
INTCON3bits.INT2IF = 0;
INTCON3bits.INT2IE = 1;
INTCON3bits.INT2IP = 1;

// interrupt on falling edge of INT2 (switch pressed)
// ensure flag is cleared
// enable INT2 interrupt
// High priority enabled

// Set up switch interrupt on INT3
INTCON2bits.INTEDG3 = 0;
INTCON3bits.INT3IF = 0;
INTCON3bits.INT3IE = 1;
INTCON2bits.INT3IP = 1;

// interrupt on falling edge of INT3 (switch pressed)
// ensure flag is cleared
// enable INT3 interrupt
// High priority enabled

// Set up global interrupts
RCONbits.IPEN = 1;
INTCONbits.GIEL = 1;
INTCONbits.GIEH = 1;

// Enable priority levels on interrupts
// Low priority interrupts allowed
// Interrupting enabled.

Display_Beginning();

// Call Display_Beginning() function

while(1)
{port = 0b00000000;};

// Stop the motor while checking any interrupts

}
// ----------------------------- Interrupt Service Routines --------------------------------/
#pragma interrupt InterruptServiceHigh // "interrupt" pragma also for high priority void InterruptServiceHigh(void)
{
// Check for INT0 interrupt if (INTCONbits.INT0IF)
// Stop the motor using push button switch
{
INTCONbits.INT0IF = 0;
// clear flag
Stop_Motor();
// Call Stop_Motor() function}
// Check for INT2 interrupt
Page | 26

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

else if (INTCON3bits.INT2IF)
{
INTCON3bits.INT2IF = 0;
Stop_Motor();
}
// Check for INT3 interrupt else if (INTCON3bits.INT3IF)
{
INTCON3bits.INT3IF = 0;
Fast_Clockwise();
Fast_Counter();
LCDInit();
LCDLine_1(); string_write(4); LCDLine_2(); string_write(1); 2nd May 2014
Group: 11

// Stop the motor using IR sensor 2
// clear flag
// Call Stop_Motor() function

// Rotate the motor in fast mode using IR Sensor 1
// clear flag
// Call Fast_Clockwise() function
// Call Fast_Counter() function
// Call LCDInit() function
// Display in LCD Line1:
// Standby Mode
// Display in LCD Line2:
// 1 = On 2 = Off

}

} // return from high-priority interrupt
/** F U N C T I O N S
********************************************************************/
void Stop_Motor(void)
{
TRISD = 0x00; port = 0b00000000;
Delay100TCYx(DELAY);

// Set port direction
// Stop the motor rotation

LCDInit();
LCDLine_1();
string_write(4);
LCDLine_2();
string_write(1);

// Call LCDInit() function
// Display in LCD Line1:
// Standby Mode
// Display in LCD Line2:
// 1 = On 2 = Off

} void Fast_Clockwise(void)
{
TRISD = 0x00;
LCDInit();
LCDLine_1(); string_write(2); // Set port direction
// Call LCDInit() function
// Display in LCD Line1:
// Mixer is on!
Page | 27

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

LCDLine_2(); string_write(3); // Display in LCD Line2:
// 250 RPM (2=Off)

//Wavedrive step in clockwise direction for 5 seconds for(i = 0; i < 1041; i++)
{
port = 0b00001000;
Delay100TCYx(DELAY);
port = 0b00000100;
Delay100TCYx(DELAY);
port = 0b00000010;
Delay100TCYx(DELAY);
port = 0b00000001;
Delay100TCYx(DELAY);
//Check another interrupts if(INTCONbits.INT0IF || INTCON3bits.INT2IF || INTCON3bits.INT3IF)
{i = 1040;}
}
} void Fast_Counter(void)
{
TRISD = 0x00;

// Set port direction

LCDInit();
LCDLine_1();
string_write(2);
LCDLine_2();
string_write(3);

// Call LCDInit() function
// Display in LCD Line1:
// Mixer is on!
// Display in LCD Line2:
// 250 RPM (2=Off)

//Wavedrive step in counterclockwise direction for 5 seconds for(i = 0; i < 1041; i++)
{
port = 0b00000001;
Delay100TCYx(DELAY);
port = 0b00000010;
Delay100TCYx(DELAY);
port = 0b00000100;
Delay100TCYx(DELAY);
port = 0b00001000;
Delay100TCYx(DELAY);

//Check another interrupts
Page | 28

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

if(INTCONbits.INT0IF || INTCON3bits.INT2IF || INTCON3bits.INT3IF)
{i = 1040;}
}
} void Display_Beginning(void)
{
LCDInit();
// Call LCDInit() function
LCDLine_1();
// Display in LCD Line1: string_write(0); // Cocktail Mixer:
LCDLine_2();
// Display in LCD Line2: string_write(1); // 1 = On 2 = Off
}
3. SPI_LCD.c
#include
#include
#include "var.h"
//*****************************************************************
// Functions can be called by the main
//*****************************************************************
void LCDInit(void); void LCDLine_1(void); void LCDLine_2(void); void string_write(unsigned char);
//******END********************************************************
void InitSPI(void b); void InitPORTA_SPI(char b); void InitPORTB_SPI(char b); void WritePortA(char b); void WritePortB(char b); void data_write(char b); void command_write(char b);
//*****************************************************************
// Write to MCP923S17 Port A
//*****************************************************************
void WritePortA(char b)
{
LATAbits.LATA2 = 0;
SSPBUF = 0x40; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = 0x12; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
Page | 29

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

SSPBUF = b; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
LATAbits.LATA2 = 1;
}
//*****************************************************************
// Write to MCP923S17 Port B
//*****************************************************************
void WritePortB(char b)
{
LATAbits.LATA2 = 0;
SSPBUF = 0x40; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = 0x13; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = b; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
LATAbits.LATA2 = 1;
}
//*****************************************************************
// Send data to the display
//*****************************************************************
void data_write(char b)
{
WritePortA(0x80);
WritePortB(b);
WritePortA(0xC0);
WritePortA(0x00);
}
//*****************************************************************
// Send a command to the display
//*****************************************************************
void command_write(char b)
{
WritePortA(0x00);
Delay10TCYx(0);
WritePortB(b);
Delay10TCYx(0);
WritePortA(0x40);
Delay10TCYx(0);

Page | 30

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

WritePortA(0x00);
}
//*****************************************************************
// Write to line 1 of the display
//*****************************************************************
void LCDLine_1(void)
{
command_write(0x80);
}
//*****************************************************************
// Write to line 2 of the display
//*****************************************************************
void LCDLine_2(void)
{
command_write(0xC0);
}
//******************************************************************
// Function to write to the PORT
//******************************************************************
void InitWrite(char b)
{
WritePortA(0);
WritePortB(b);
Nop();
Nop();
Nop();
WritePortA(0x40);
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
Nop();
WritePortA(0);
}
//*****************************************************************
// Initialize MCP923S17 Port A
//*****************************************************************
void InitPortA_SPI(char b)
{
LATAbits.LATA2 = 0;
SSPBUF = 0x40;
/*
Page | 31

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

SSP1IF: MSSP1 Interrupt Flag bit
1 = The transmission/reception is complete (must be cleared in software)
0 = Waiting to transmit/receive
*/
while(!PIR1bits.SSPIF);
PIR1bits.SSPIF = 0;
SSPBUF = 0x00; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = b; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
LATAbits.LATA2 = 1;
}
//*****************************************************************
// Initialize MCP923S17 Port B
//*****************************************************************
void InitPortB_SPI(char b)
{
LATAbits.LATA2 = 0;
SSPBUF = 0x40; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = 0x01; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
SSPBUF = b; while(!PIR1bits.SSPIF); PIR1bits.SSPIF = 0;
LATAbits.LATA2 = 1;
}
//*****************************************************************
// Initialize MCP923S17 SPI
//*****************************************************************
void InitSPI(void)
{
// RC3 is connected to SCK: Serial clock input
TRISCbits.TRISC3 = 0;
// RC5 is connected to SI: Serial data I/O (MCP23017), Serial data input (MCP23S17)
TRISCbits.TRISC5 = 0;
// SSPxCON1: MSSPx CONTROL REGISTER 1 (I2C? MODE)
// SSPEN=1, 1 = Enables the serial port and configures the SDAx and SCLx pins as the serial port pins // SSPM=0010, 0010 = SPI Master mode, clock = FOSC/64
// CKP=0, 0 = Holds clock low (clock stretch), used to ensure data setup time
Page | 32

6509899
6512453
Final Report

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

2nd May 2014
Group: 11

SSP1CON1 = 0x22; // 00100010
// CKE: SPI Clock Select bit
// 1 = Transmit occurs on transition from active to Idle clock state
// 0 = Transmit occurs on transition from Idle to active clock state
SSP1STATbits.CKE = 1;
// SSP1IF: MSSP1 Interrupt Flag bit
//1 = The transmission/reception is complete (must be cleared in software)
//0 = Waiting to transmit/receive
PIR1bits.SSPIF = 0;
}

//******************************************************************
// LCD Initialization function
//******************************************************************
void LCDInit(void)
{
// RA2 connects CS: Chip Select (MCP23S17)
TRISAbits.TRISA2 = 0;
LATAbits.LATA2 = 1;
// SPI Sequential Write/Read
Delay10TCYx(0);
Delay10TCYx(0);
Delay10TCYx(0);
// RF6 is connected to RESET of expander: Hardware reset. Must be externally biased.
TRISFbits.TRISF6 = 0;
LATFbits.LATF6 = 0;
Delay10TCYx(0);
LATFbits.LATF6 = 1; // RESET expander
InitSPI(); // see above
InitPortA_SPI(0);
InitPortB_SPI(0);
WritePortA(0);
Delay10TCYx(0);
InitWrite( 0b00111100 );
//0011NFxx
Delay10TCYx(0);
InitWrite( 0b00001100 );
//Display Off
Delay10TCYx(0);
InitWrite( 0b00000001 );
//Display Clear
Delay10TCYx(0);
InitWrite( 0b00000110 );
//Entry mode
}
//******************************************************************
// Write a string on LCD
//******************************************************************
void string_write(unsigned char idx) {
Page | 33

6509899
6512453
Final Report

2nd May 2014
Group: 11

Hartomo Arlandianto Prabowo
Boby Hartanto Aliono

unsigned int i=0; unsigned int z=0; char b; while (i

Similar Documents

Premium Essay

Internship

...\INTERNSHIP (CZBB9019) BA8.1 (Year 2, Term 4) STUDENT NAME: STEVEN KARNADI STUDENT ID: 018BA012 PROGRAMME: REC ADVANCED DIPLOMA IN BUSINESS ADMINISTRATION SUPERVISOR: Mr. Simon Koffi Kpotchie DATE: COMPANY NAME: MUSE ON THE BUND CLUB Project submitted in partial fulfillment of the requirements of the ADVANCED DIPLOMA IN BUSINESS At RAFFLES EDUCATION COLLEGE SHANGHAI, CHINA DECLARATION: 1. Material that is in the analysis of the company internship is the final result of the work of my own work and that due acknowledgment has been given in the source data to all of them in print, electronic or personal. 2. The Word Count of the Internship Project / Dissertation is __________. 3. I have read Raffles College Group Policy on Ethics in assessment and I confirm that ethical issues have been considered, evaluated and appropriately addressed in this study. SIGNED: ACKNOWLEDGEMENTS At the time of this internship I would like to say a big thank you to Mr.Simon kpotchie who has guided me and gave a lot of referrals. then I also want to thank the management of MUSE ON THE BUND CLUB that has given me the opportunity to learn and work in their company so I can get a lot of valuable experience that would be helpful for my future. truly grateful to those who helped! 1.1 The history of Company Muse on the Bund is formed of several members of the founding group...

Words: 6083 - Pages: 25

Free Essay

Report on Dabur

...Market research project report On Usage and Attitude study Of Dabur Real Juice Submitted Towards Partial Fulfillment Of Master of Business Administration SUBMITTED TO SUBMITTED BY DR P.K Agarwal payal morwani Head Of The department MBA MBA Roll No.pgfa1337 COLLEGE OF ENGRINEERING & TECHNOLOGY IILM ACADEMY OF HIGHER LEARNING PlotNo-17&18 Knowledge Park – ll Greater Noida ACKNOWLEDGMENT It is said that life is mixture of achievement, experience, exposure, dreams and efforts to make those dreams come true .There are people around who held you enable realize those dreams come true. There are people around who held you enable realize those dreams .During these sixty days of training I gained invaluable experience in the field of Marketing .the exposure that I went through during the past two months has given immense improvement in my knowledge base where I can put my theoretical knowledge in practical use. At the very outset, I would like to express my gratitude to Mr. N.A Zaidi and Mr. Rakesh Sharma for providing me with a wonderful opportunity to pursue my project in...

Words: 12428 - Pages: 50

Premium Essay

Anket7

...rP os t op yo Match Supply and Demand in Service Industries No tC W. Earl Sasser Do Harvard Business Review 76608 This document is authorized for use only by Ramanna Shetty until June 2012. Copying or posting is an infringement of copyright. Permissions@hbsp.harvard.edu or 617.783.7860. rP os t HBR NOVEMBER–DECEMBER 1976 op yo Match Supply and Demand in Service Industries W. Earl Sasser No tC What makes service industries so distinct from manufacturing ones is their immediacy: the hamburgers have to be hot, the motel rooms exactly where the sleepy travelers want them, and the airline seats empty when the customers want to fly. Balancing the supply and demand sides of a service industry is not easy, and whether a manager does it well or not will, this author writes, make all the difference. In this rundown of the juggling feat service managers perform, the author discusses the two basic strategies—‘‘chase demand’’ and ‘‘level capacity’’— available to most service companies. He goes on to discuss several ways service managers can alter demand and influence capacity. W. Earl Sasser is associate professor of business administration at the Harvard Business School, where he developed the second-year MBA course ‘‘Management of Service Operations.’’ He currently teaches another secondyear course, ‘‘The Operating Manager,’’ and is conducting research on managing service operations. Mr. Sasser has had a previous...

Words: 5244 - Pages: 21

Premium Essay

Food and Bevarage

...co Food and Beverage Operations DHM 102 The Official Guide Boston Business School 520 North Bridge Road #03-01 Wisma Alsagoff Singapore 188742 www.bostonbiz.edu.sg All rights reserved; no part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise without the prior written permission of the Publisher. This guide may not be lent, resold, hired out or otherwise disposed of by way of trade in any form of binding or cover, other than that in which is published, without the prior consent of the Publisher. The Guide is a useful resource for those seeking to gain the internationally recognised CTHCM qualifications. The Guide however must be used together with the recommended textbooks. CONTENTS 1. Introduction 2. Food Production Methods 3. Food Service Outlets 4. Food Service Methods 5. Food and Beverage Service Staff 6. Menus and Beverage Lists 7. Food and Beverage Service Area and Equipment 8. Food Service – Accompaniments and Covers 9. Food and Beverage Service Sequence 10. Beverage Service – Non Alcoholic Beverages 11. Alcoholic Beverage Service – Wine and Beer 12. Alcoholic Beverage Service – Spirits, Liqueurs and Bar Operations 13. Customer Care and Selling Skills 14. Functions and Events 15. Supervisory Aspect of Food and Beverage Management 1 5 31 46 65 77 92 113 128 167 181 207 228 244 262 1 Introduction Description The aim of Food and...

Words: 94338 - Pages: 378

Premium Essay

Food and Beverages Operation

...Food and Beverage Operations DHM 102 The Official Guide Boston Business School 520 North Bridge Road #03-01 Wisma Alsagoff Singapore 188742 www.bostonbiz.edu.sg All rights reserved; no part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise without the prior written permission of the Publisher. This guide may not be lent, resold, hired out or otherwise disposed of by way of trade in any form of binding or cover, other than that in which is published, without the prior consent of the Publisher. The Guide is a useful resource for those seeking to gain the internationally recognised CTHCM qualifications. The Guide however must be used together with the recommended textbooks. CONTENTS 1. Introduction 2. Food Production Methods 3. Food Service Outlets 4. Food Service Methods 5. Food and Beverage Service Staff 6. Menus and Beverage Lists 7. Food and Beverage Service Area and Equipment 8. Food Service – Accompaniments and Covers 9. Food and Beverage Service Sequence 10. Beverage Service – Non Alcoholic Beverages 11. Alcoholic Beverage Service – Wine and Beer 12. Alcoholic Beverage Service – Spirits, Liqueurs and Bar Operations 13. Customer Care and Selling Skills 14. Functions and Events 15. Supervisory Aspect of Food and Beverage Management 1 5 31 46 65 77 92 113 128 167 181 207 228 244 262 1 Introduction Description The aim of Food and...

Words: 94338 - Pages: 378

Premium Essay

Hot Spot and Grill Bar

...Executive Summary A. Market Study Food and parties have been a part of the culture of the Filipino. Filipino have always been a food lover, be it traditional food or food from another country. Hot is an adjective word that means having or giving off heat; having a high temperature; showing intense; requiring immediate delivery or correspondence; demanding priority. Spot is a noun word that means a place or locality; a specific position in a sequence. The owners chose this name because of the very reason that it is catchy and the word itself is explainable; it will be easily understood by their chosen target markets. Also, the owners thought of using this name because their main mission is to serve their customers with products that are warm and fresh. It features a variety of menu such as salads, pasta, hamburgers, rice meals, desserts and beverages hot or cold, alcoholic or non-alcoholic. It is also known for having the best ambiance having a laid back style with a twist of modernized furniture. Rest assured that Hotspot bar restaurant will maintain its security well. Hotspot bar and restaurant is an establishment that is very flexible and in its operations, it will make sure to cater to the needs and wants of every individual of all ages. B. Technical Study Burgers was introduced to the Philippines by the Americans, since then the Filipinos are fond of eating burgers. Hotspot bar and restaurant wants to be known for their best tasting burgers but they...

Words: 19178 - Pages: 77

Premium Essay

Nature of the Hospitality Industry

...Introduction to Hospitality Industry UNIT 1 1.1 1.2 1.3 Meaning and definition Historical evolution and development Hospitality as an Industry 1.1 Introduction Meaning and definition Tourism is not just about the facilities and attractions provided for visitors. It is about people and especially about the relationship between the customer and the individual providing service. Everybody employed in tourism needs to have the knowledge, skills and attitudes to provide the standard of product and service that customers expect. Knowing about the tourism industry, its component parts and especially where you fit in is an important starting point to a successful career in tourism. What Is Tourism? Tourism may be described as the activities of tourists and those who cater for them. It is a highly diversified business with many component parts ranging from airlines to hotels. Tourism is concerned with providing:       Travel and transport facilities Accommodation Food and drink Entertainment/recreation Information and assistance Souvenirs Above all, tourism is a hospitality industry providing a service to visitors in a warm and welcoming way. ICHM Page 1 Introduction to Hospitality Industry Who Are Tourists? Tourists are people who for a variety of reasons travel to destinations, where they stay at least one night. Excursionists are also visitors that do not make an over-night stop, such as daytrippers or people on cruises. There are several basic types of tourists:   ...

Words: 40041 - Pages: 161

Free Essay

Physcal

...IET ELECTRICAL MEASUREMENT SERIES 12 Microwave Measurements 3rd Edition Other volumes in this series: Volume 4 Volume 5 Volume 7 Volume 8 Volume 9 Volume 11 The current comparator W.J.M. Moore and P.N. Miljanic Principles of microwave measurements G.H. Bryant Radio frequency and microwave power measurement A.E. Fantom A handbook for EMC testing and measurement D. Morgan Microwave circuit theory and foundations of microwave metrology G. Engen Digital and analogue instrumentation: testing and measurement N. Kularatna Microwave Measurements 3rd Edition Edited by R.J. Collier and A.D. Skinner The Institution of Engineering and Technology Published by The Institution of Engineering and Technology, London, United Kingdom © 1985, 1989 Peter Peregrinus Ltd © 2007 The Institution of Engineering and Technology First published 1985 (0 86341 048 0) Second edition 1989 (0 86341 184 3) Third edition 2007 (978 0 86341 735 1) This publication is copyright under the Berne Convention and the Universal Copyright Convention. All rights reserved. Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act, 1988, this publication may be reproduced, stored or transmitted, in any form or by any means, only with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licences issued by the Copyright Licensing Agency...

Words: 32727 - Pages: 131

Free Essay

Resume Google

...To my mother and grandmother, whose engineering endeavors paved the way for my own. Copyright © 2011 by Gayle Laakmann. All rights reserved. Published by John Wiley & Sons, Inc., Hoboken, New Jersey. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions. Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies...

Words: 72645 - Pages: 291

Premium Essay

Holly Farm

...Robert Johnston Stuart Chambers Christine Harland Alan Harrison Nigel Slack Cases in Operations Management third edition Cases in Operations Management We work with leading authors to develop the strongest educational materials in operations management, bringing cutting-edge thinking and best learning practice to a global market. Under a range of well-known imprints, including Financial Times Prentice Hall, we craft high quality print and electronic publications which help readers to understand and apply their content, whether studying or at work. To find out more about the complete range of our publishing, please visit us on the World Wide Web at: www.pearsoneduc.com THIRD EDITION Cases in Operations Management Robert Johnston Warwick Business School, University of Warwick Stuart Chambers Warwick Business School, University of Warwick Christine Harland School of Management, University of Bath Alan Harrison Cranfield School of Management, Cranfield University Nigel Slack Warwick Business School, University of Warwick Pearson Education Limited Edinburgh Gate Harlow Essex CM20 2JE United Kingdom and Associated Companies throughout the world Visit us on the World Wide Web at: www.pearsoned.co.uk First published 1993 Second published 1997 Third Edition 2003 © Robert Johnston, Stuart Chambers, Christine Harland, Alan Harrison and Nigel Slack 1993, 2003 The rights of Robert Johnston, Stuart Chambers, Christine Harland, Alan Harrison...

Words: 207956 - Pages: 832

Free Essay

Stars Without Number

...STARS WITHOUT NUMBER For Eden, who gave me a reason. TABLE OF CONTENTS Introduction ..............................................................................................................5 Character Creation ....................................................................................................7 Psionics ...................................................................................................................25 Equipment ..............................................................................................................33 Systems ...................................................................................................................59 The History of Space ...............................................................................................71 Game Master’s Guide ..............................................................................................78 World Generation ...................................................................................................87 Factions .................................................................................................................113 Adventure Creation ...............................................................................................128 Alien Creation .......................................................................................................138 Xenobestiary ........................................................................

Words: 143564 - Pages: 575

Premium Essay

Buisness Ideas

...101 Small Business Ideas for Under $5,000 Corey Sandler Janice Keefe John Wiley & Sons, Inc. 101 Small Business Ideas for Under $5,000 Corey Sandler Janice Keefe John Wiley & Sons, Inc. This book is printed on acid-free paper. ● ∞ Copyright © 2005 by Word Association, Inc. All rights reserved. Published by John Wiley & Sons, Inc., Hoboken, New Jersey. Published simultaneously in Canada. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008. Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose...

Words: 90587 - Pages: 363

Free Essay

Stuff My Stocking: M/M Romance Stories That Are Nice and… Naughty

...maStuff My Stocking M/M Romance Stories that are Nice and… Naughty Stuff My Stocking: M/M Romance Stories that are Nice and… Naughty An M/M Romance Group Publication copyright 2010 With stories by: M.J. O'Shea Brian Jackson Deanna Wadsworth Missy Welsh Jade Archer Michael S. Xara X. Xanakas Mark Alders Em Woods Rachel Haimowitz SJD Peterson Kari Gregg Kim Dare A.J. Llewellyn Serena Yates Ocotillo Jessica Freely Heinrich Xin William Cooper Wren Boudreau Selah March Sarah Madison Stephani Hecht Amy Lane Angela Benedetti edited by: Diane W. (mailto:diane.goodreads@gmail.com) Jason B. Kathy H. Stuff My Stocking: M/M Romance Stories that are Nice and… Naughty What you’ve gotten yourself into… The stories you are about to read are the product of a very special project sponsored by the Goodreads M/M Romance groupthe online community for readers who love to read about men in love (Male/Male). The group moderators issued an invitation for members to choose a photo and pen a Letter to Santa asking for a short M/M romance story inspired by the image; authors from the group were encouraged to select a letter and write an original tale. The result was an outpouring of creativity that shined a spotlight on the special bond between M/M romance writers and the people who love what they do. This book is an anthology of those letters and stories. Whether you are an avid M/M romance reader or new to the genre, you are in for a delicious treat. So sit back, relax and enjoy...

Words: 121001 - Pages: 485

Free Essay

Growing Up Asian in Australia

...Growing Up Asian in Australia file:///D|/ /Calibre Library/Wei Zhi/Growing Up Asian in Australia (799)/text/part0000.html[2014-6-18 23:54:32] Growing Up Asian in Australia file:///D|/ /Calibre Library/Wei Zhi/Growing Up Asian in Australia (799)/text/part0000.html[2014-6-18 23:54:32] Growing Up Asian in Australia Growing up Asian in Australia file:///D|/ /Calibre Library/Wei Zhi/Growing Up Asian in Australia (799)/text/part0001.html[2014-6-18 23:54:33] Growing Up Asian in Australia Growing up Asian in Australia ...................................... Alice Pung Edited by file:///D|/ /Calibre Library/Wei Zhi/Growing Up Asian in Australia (799)/text/part0002.html[2014-6-18 23:54:33] Growing Up Asian in Australia Published by Black Inc., an imprint of Schwartz Media Pty Ltd Level 5, 289 Flinders Lane Melbourne Victoria 3000 Australia email: enquiries@blackincbooks.com http://www.blackincbooks.com Introduction and this collection © Alice Pung & Black Inc. Individual works © retained by the authors. Reprinted 2008 . ALL RIGHTS RESERVED. 2008. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means electronic, mechanical, photocopying, recording or otherwise without the prior consent of the publishers. Photo of Hoa Pham by Alister Air. Photo of Joy Hopwood by Yanna Black. The National Library of Australia Cataloguing-in-Publication entry: Pung, Alice (ed.) Growing up...

Words: 113124 - Pages: 453

Premium Essay

Leadership

...Fourth Edition Reframing Organizations Artistry, Choice, and Leadership LEE G. BOLMAN TERRENCE E. DEAL B est- se l l i n g a u t h o rs of LEADING WITH SOUL FOURTH EDITION Reframing Organizations Artistry, Choice, and Leadership Lee G. Bolman • Terrence E. Deal Copyright © 2008 by John Wiley & Sons, Inc. All rights reserved. Published by Jossey-Bass A Wiley Imprint 989 Market Street, San Francisco, CA 94103-1741—www.josseybass.com No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400, fax 978-6468600, or on the Web at www.copyright.com. Requests to the publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, 201-7486011, fax 201-748-6008, or online at www.wiley.com/go/permissions. Credits are on page 528. Readers should be aware that Internet Web sites offered as citations and/or sources for further information may have changed or disappeared between the time this was written and when it is read. Limit of Liability/Disclaimer...

Words: 193447 - Pages: 774