University of Florida



[pic]

Department of Civil and Coastal Engineering

The University Teaching Clock Tower

[pic]

Electronic Interface Device: Specifications and Instructions

Eric Donnelly

eric@

8/26/2004

Table of Contents

1. Abstract 4

2. Introduction 5

3. Electronic Interface 6

4. External Connections and Setup 7

4.1. Motors 7

4.1.1. Instructions 7

4.2. WWVB Receiver 7

4.2.1. Instructions 8

4.3. Pendulum Sensor 8

4.3.1. Instructions 8

4.4. Programmer 8

5. Instructions for Use 9

5.1. Enter dial positions 9

5.1.1. Instructions 9

5.1.2. Format 9

5.1.3. Mapping 9

5.1.4. Dial Correction 10

5.2. Manually Enter Time (Optional) 10

5.2.1. Instructions 11

5.2.2. Format 11

5.2.3. Receiver Failure 11

5.3. Other Features 11

5.3.1. The main screen 11

5.3.2. Pendulum Error 12

5.3.3. System Status 12

5.3.3.1. Instructions 12

5.3.3.2. Display Description 12

5.3.4. Reset 13

5.3.5. Time correction 13

6. Troubleshooting 14

7. Appendix A—The Clock Dials 15

8. Appendix B— Components 16

8.1. Bill of Materials 16

8.2. MegaAVR-Dev Development Board 16

8.3. Motors and Control Boards 17

8.3.1. Control Boards 17

8.3.2. Stepper Motors 17

8.4. AVRISP In-System Programmer 18

8.5. Ultralink Model 325 WWVB Receiver/Decoder 18

8.6. Other Parts 19

8.6.1. Power Supply 19

8.6.2. Optical Switch (Pendulum sensor) 19

8.6.3. Liquid Crystal Display (LCD) 19

8.6.4. One-Ohm Power Resistor 19

8.6.5. Matrix Keypad 19

9. Appendix C—Technical Specifications 20

9.1. Power Supply Considerations 20

9.2. Internal System Connections 20

9.2.1. PORT A—Stepper Motor Control 20

9.2.2. PORT B—20x4 LCD 21

9.2.3. PORT C—Matrix Keypad 21

9.2.4. PORT D—Slotted Optical Switch 22

9.2.5. Power Connector 22

9.2.6. Programmer 22

10. Appendix D—Special Programming Mode 23

10.1. Programming Stepper Specifications Into Flash 23

10.1.1. Instructions 23

11. References 24

Abstract

The Teaching Clock Tower has four clock dials, which are controlled electronically. The electronic controls are interfaced with the clock tower’s pendulum via an infrared emitter/detector. This signal is interpreted by the microcontroller which in turn increments the four stepper motors that mechanically turn the clock dials. To account for clock drift which occurs on all clocks (digital and analog), the microcontroller is also interfaced with a WWVB receiver. This receives a 60 kHz radio signal from Fort Collins, CO, that contains the Coordinated Universal Time (UTC) derived from an atomic clock. This allows the microcontroller to set/adjust the time on the dials so they are always accurate. This mends the old with the new to create a classical clock tower which is as accurate as modern day radio clocks.

Introduction

Conceptualized in 1990, Dr. Ted Crom proposed the idea of a clock tower designed completely by students. This idea evolved into the Teaching Clock Tower Project which aims to create a clock tower on the Southeast corner of North-South Drive and Stadium Road. This clock tower has four clock dials which are replicas of 18th Century watch faces (Appendix A). These faces use unique methods of displaying time compared to the conventional two-hand display method of hours and minutes.

The clock tower mechanism was donated by Dr. Crom and is a Howard Clock Movement (circa 1913) that is weight driven and electrically wound. However, this mechanism lacks the gearing and rods needed to operate the clock dials [1]. It was decided that an electronic interface was to be used to operate motors which control the clock dials. This interface senses pendulum movement using an infrared emitter/detector. A WWVB receiver is also used to ensure the accuracy of the time shown on the dials. This also allows the clock tower to be “maintenance free” in regards to manually setting/adjusting the time to be shown on the clocks.

Electronic Interface

The Electronic Interface device revolves around an Atmel ATMega16 microcontroller. This microcontroller interfaces/controls all the electronic aspects of the clock tower. It is interfaced with a keypad and LCD to allow for human interaction/setup. The device is also connected to an infrared emitter/detector which senses pendulum movement. The microcontroller is interfaced with four (4) stepper motor control boards, which in turn are connected to four (4) stepper motors. These motors control each of the clock dials independently. There is also a WWVB receiver which informs the device the current UTC time. This allows the device to set/correct the clock dials to the correct time. The WWVB receiver is connected via UART while the other interfaces use the microcontroller’s four (4) digital I/O ports.

Detailed documentation on the various components can be found in Appendix B. Appendix C contains information on the entire system.

External Connections and Setup

The electronic interface has a few connections that must be attached before normal operation can occur. For safety purposes, the power cord should be connected last.

[pic]

1 Motors

Each stepper motor (see 8.3.2) has four (4) wires that need to be connected to the electronic interface device. The grey and red wires connect one motor coil and the black and yellow wires connect the other.

1 Instructions

1. For clock dial 1 (Wandering Hour), connect the yellow wire to the terminal labeled “Y” on the Wandering Hour terminal block (1) (Figure 1)

2. Connect the black wire to the terminal labeled “B” on the Wandering Hour terminal block (1) (Figure 1)

3. Connect the grey wire to the terminal labeled “G” on the Wandering Hour terminal block (1) (Figure 1)

4. Connect the red wire to the terminal labeled “R” on the Wandering Hour terminal block (1) (Figure 1)

5. Repeat steps 1-4 for clock dials 2-4 (Sun and Moon, Differential, and Metric) (Figure 1)

2 WWVB Receiver

The WWVB receiver (see 8.5) has two (2) sets of connections on the interface device—the modular connection and the power connection.

1 Instructions

1. Connect the modular (telephone) cable to the WWVB receiver

2. Connect the other end of the cable to the connection labeled “Rx” on the interface device (Figure 1)

3. Connect the 2.5mm power jack to the WWVB receiver

4. Connect the white striped wire on the jack to the “+5” terminal on the “Radio” terminal block (Figure 1)

5. Connect the solid black wire on the jack to the “GND” terminal on the “Radio” terminal block (Figure 1)

Note: The receiver should be mounted with the long side horizontal. It can be mounted flat (table/shelf) or vertical (wall mount). Best reception occurs when the long side is perpendicular to Fort Collins, Co (W-NW of Gainesville, FL).

3 Pendulum Sensor

The pendulum sensor (see 8.6.2) has three (3) wire connections—power, ground, and signal.

[pic]

1 Instructions

1. Connect the solid black wire labeled “+5” to the terminal labeled “+5” on the 3-terminal terminal block (Figure 1)

2. Connect the solid black wire labeled “GND” to the terminal labeled “GND” on the 3-terminal terminal block (Figure 1)

3. Connect the white striped wire labeled “SIG.” to the terminal labeled “SIG. on the 3-terminal terminal block (Figure 1)

4 Programmer

If the onboard microcontroller ever needs to be programmed, it can be accomplished through the external serial connection (Figure 1)—see 9.2.6 for detailed information. For normal operation no connection is required.

Instructions for Use

1 Enter dial positions

Upon startup and reset, the user is required to enter the times shown on the clock dials (See Figure 3). Since this device uses open-loop control to control the clock dials, the device must first be aware of the positions of the clock dials. Then the device keeps track of how much the dials have been incremented so it always knows their position.

[pic]

1 Instructions

1. Enter time shown on clock dial 1 (see Figure 3, 5.1.2, and 5.1.3)

2. Press [*] to confirm (See Figure 4)

3. Repeat steps 1 and 2 for clock dials 2-4 (see 5.1.3)

2 Format

The time entered is the 24-hour time format and the user is required to enter all six (6) digits with no colons (:). This means if the time on the clock dial shows 3:05:00 AM, the user will enter 030500. Here are some other examples:

• 4:23 PM is entered as 162300*

• 6:30:07 AM is entered as 063007**

• 12 Midnight is entered as 000000

(*) Note that most clock dials are only 12-hour dials (like the classic analog clock face). Therefore AM and PM is not distinguishable on the clock face and can be interchanged.

Ex. 4:23 showing on the dial can be entered as 042300 or 162300

(**) Even though it might not be possible to distinguish the number of seconds showing on a particular clock dial, a guess must be entered.

3 Mapping

The mapping of the dial name to its particular number is as follows:

1. Wandering Hour Dial

2. Sun and Moon Dial

3. Differential Dial

4. Metric Dial

Pictures of these dials can be found in Appendix A.

4 Dial Correction

[pic]

If for some reason the time shown on the clock faces becomes out of sync with the time the device thinks is being shown, the time can be re-entered. This is done by first pressing [A] from the main screen (Figure 8), and then [A] again from the menu (Figure 5). The corresponding dial should be chosen (1-4) (Figure 6), and then the time shown on that clock face should be entered (Figure 3). For instance, if the Sun and Moon dial is showing 1:30 PM but all the other dials are correctly showing 3:15 PM, then a correction needs to be made. The user would chose “[A] Input Clock Dials” from the menu (Figure 5) and then select dial “2” (Figure 6) which corresponds to the Sun and Moon dial (the name-to-number mapping is shown on the side of the electronic interface box and 5.1.3). The user would then enter 133000 to inform the device that the Sun and Moon dial is currently showing that time. The device will then make the necessary corrections.

2 Manually Enter Time (Optional)

[pic]

The electronic interface device uses a WWVB receiver to find out the actual time of day. Therefore there is never any need for the user to set/adjust the current time of day on the device. However, if on startup the user wants to enter a guess of the current time of day he/she can do so. This allows the device to begin adjusting the clock dials to the correct position, then when the WWVB receiver receives the actual atomic time (which can take anywhere from minutes to hours), the device only needs to make a small correction to the clock dials. This is completely optional.

Note: If the WWVB receiver is in-sync with the current atomic time you will not be allowed to manually enter the time. The WWVB receiver would have to be disconnected first.

1 Instructions

4. Press [A] from the main screen to enter the menu (Figure 8)

5. Press [B] to manually set time (Figure 5)

6. Enter the current time of day (see Figure 7 and 5.2.2)

7. Press [*] to Confirm (Figure 4)

2 Format

The time entered is the 24-hour time format and the user is required to enter all six (6) digits with no colons (:). This means if the current time of day is 3:05:00 AM, the user will enter 030500. Here are some other examples:

• 4:23 PM is entered as 162300

• 6:30:07 AM is entered as 063007

• 12 Midnight is entered as 000000

3 Receiver Failure

If the WWVB receiver ever stops working, the electronic interface can still run normally. However, the user would then be required to manually enter the current time of day, as well as adjust the time for daylight savings or clock drift from time to time. This can be done by following the steps outlined in section 5.2.1.

3 Other Features

1 The main screen

[pic]

The main screen shows some very valuable information (shown in Figure 8).

• The first line shows the current time.

• The second line shows the time for each clock dial (this display rotates through all four dials).

• The third line displays error information (in this case a pendulum error).

• The fourth line informs user to press [A] for the menu screen.

• The top right corner (line 1) displays WWVB receiver information

o ‘V’ or ‘N’ informs the user if the current time is synched with the atomic clock or not (‘N’—not synched shown).

o +1-5 represents WWVB signal strength (5—highest), 8—no connection (timeout), and 9—frame error (8—no connection shown).

• Line 2 of the top right corner displays the number of hours since the WWVB receiver has synched with the atomic time (Note: time must be valid for this information to be useful).

Note: In order to prolong the LCD’s lifetime, the screen goes blank after four (4) minutes of inactivity. Pressing any key will cause the screen to turn on.

2 Pendulum Error

If for some reason the pendulum stops moving, or the sensor malfunctions, the clock tower will still be able to function normally. The microcontroller will notice that the motors haven’t been incrementing. If 60 seconds goes by and the motors still aren’t incrementing, the microcontroller determines some sort of malfunction. A “Pendulum Error!” message is displayed on the main screen (see Figure 8), and the microcontroller will start using its internal clock to time the clock dials’ movement. If the sensor or pendulum begins working again, the error message will go away and the device will resume its normal operation.

Note: This means the clock tower can function without using a pendulum at all!

3 System Status

If you think the clock tower is not functioning like it should, you can use the system status screen to help determine the problem.

1 Instructions

1. Press [A] from the main screen (Figure 8)

2. Press [C] from the menu for System Status Figure 5)

3. Press [#] when done viewing to return to main screen

2 Display Description

[pic]

The System Status display is separated into three (3) columns (Figure 9):

• Column 1 displays the time (in seconds) of each of the four (4) clock dials. Shown above each clock dial is showing 60 seconds (12:01:00 AM).

• Column 2 displays the offset (in seconds) of each of the clock dials from the current time. Shown above each clock dial is 40,233 seconds (11 hours, 10 minutes, 33 seconds) behind the current time (hence, a correction is due soon).

• Column 3 displays other various information:

o Line 1 displays the current atomic time received from the WWVB receiver (11:11:33 AM). If current time is manually inputted it will be displayed here also.

o Line 2 displays the actual current time as interpreted by the microcontroller (11:11:33 AM). This should always be the same as line 1 (atomic time) unless a sync has not occurred, then it should read 99999.

o Line 3 displays the number of corrections that have been made to the clock dials since last reset or power-up.

o Line 4 informs user to press [#] to exit to main screen.

4 Reset

If the electronic interface begins to behave abnormally, a system reset may need to be performed. Though rare, extreme heat or lightning could cause the microcontroller to stop running normally.

[pic]

To perform a reset: take off the cover and press the button shown in Figure 10. The time shown on each of the clock dials will need to be re-entered.

Note: The system can be reset by turning the power off, wait about 10 seconds, then turn the system back on. This will cause the WWVB receiver to reset also, so the current time will not immediately be available.

5 Time correction

If any of the clock dials show a time different from the current (actual) time, there is no need to worry. If a clock dial shows an incorrect time for more than 60 consecutive seconds (even only a one-second difference) the device will begin to correct the time. The motor will spin at maximum speed in the direction that will reach the correct time the fastest. This ensures all clock faces will be accurate to the second at all times.

Troubleshooting

| |Problem |Solution |

|1 |The system won’t turn on. |Make sure the power cord is properly connected, and the power switch is |

| | |switched on. |

|2 |The LCD screen is blank. |Press any key to turn the screen on. |

|3 |I typed in the wrong time. |See 5.1.4. |

|4 |The current time is wrong. |Check connections to WWVB receiver. If the power light on the receiver is |

| | |on, then check the signal strength indicator (see 5.3.1). If the signal |

| | |strength is low (1 or 2), try re-positioning the WWVB receiver for better |

| | |reception. Remember, time synchronization can take hours. You can also |

| | |manually enter the current time (5.2). |

|5 |All the clock dials show incorrect times. |See question 4. If the current time is correct see 5.3.5 then see question |

| | |6. |

|6 |Some of the clock dials show incorrect times |The dial(s)’ time(s) being shown probably need to be re-entered (See 5.1.4).|

|7 |How do I know what the current time is? What time|Either look at the main screen (5.3.1) or the system status screen (5.3.3). |

| |does each of the clock dials have? |You can also look on the actual clock faces! (App. A). |

|8 |I don’t want to use the WWVB receiver anymore. |Then don’t! Whatever your motivation may be, just disconnect the power or |

| | |modular cable and manually enter the time (See 5.2). |

|9 |I don’t want to use the pendulum. |Just disconnect the pendulum sensor from the pendulum. The device can work |

| | |properly without it (See 5.3.2). |

Appendix A—The Clock Dials

|[pic] |[pic] |

|Figure 11. Wandering Hour Dial (c. 1700) |Figure 12. Sun and Moon Dial (c. 1700) |

|The hour appears in a small round window. The hour numbers |The hour is indicated by the position of the sun and moon. The |

|rotate clockwise in the semicircular arc window. The upper |minutes are shown by the minute hand as it sweeps 360 degrees |

|tangent of the hour window indicates quarter hours which were |clockwise around the dial. The sun is just coming up at the left|

|more familiar to the older generation [1]. |and the moon is setting on the right [1]. |

|Time Shown: 5:00 and 30 seconds |Time Shown: 5:55 AM |

| | |

|[pic] |[pic] |

|Figure 13. Differential Dial (c. 1700) |Figure 14. Revolutionary or Metric Dial (c.1700) |

|The single hand rotates 360 degrees in one hour, showing the |The hour is indicated by the position of the shortest hand. The |

|minutes on the outer ring. The smaller center plate or dial |metric hour is shown in roman numerals. The minutes are shown by|

|moves 330 degrees in one hour. Thus the hour and minute show |two minute hands. The longest hand shows standard time while the|

|correctly beneath the single hand [1] . |mid-sized hand shows metric time. Metric timekeeping consists of|

|Time Shown: 9:30 |100 min/hours and 10 hour/day [1]. |

| |Time shown: 7:16 pm (Standard), 8:03 pm (Metric) |

| | |

Appendix B— Components

1 Bill of Materials

|QTY |ITEM |DESCRIPTION |

|1 | |MegaAVR-Dev Development Board |

|4 |TM98CTL3145 |Herbach and Rademan Bi-Polar Stepping motor control board |

|4 |C57L048A19-S |Thompson 4.5 VDC Stepper Motor |

| |TM02MTR4553 | |

|1 |AVRISP |AVR In-System Programmer |

|1 |Model 325 |Ultralink WWVB Receiver/Decoder |

|1 | |POWMAX 250 Watt AT Switching Power Supply |

|1 |OPB660N |Optek Slotted Optical Switch |

|1 |TCH35P1R00J |Ohmite TO220 Power Resistor (35W, 1Ω) |

|1 |DMC 20434 |Optrex 20x4 LCD Display |

|1 | |4x4 Matrix Keypad |

2 MegaAVR-Dev Development Board

[pic]

Figure 15. Development Board. Courtesy of [2].

The MegaAVR-Dev Development Board contains an Atmel ATMega16 microcontroller. The microcontroller features 16KB of Flash program memory, 1 KB SRAM, 512 Byte EEPROM and 32 I/O pins. The datasheet can be found at .

Relevant documentation for the development board is attached. It can also be found at [2] .

3 Motors and Control Boards

1 Control Boards

[pic]

The stepper motor control boards are produced by Herbach and Rademan. The TM98CTL3145 board requires 5V power for the logic and up to a 50V supply for the motor coils. For this project we are using a 12V motor coil supply.

2 Stepper Motors

[pic]

The 2 RPM 30 Ft-Lbs Torque Geared PM "Super" Stepping Motor has a maximum speed of 2 RPMs at 320 steps/second. This means there is 9600 steps in a full rotation which gives the motor a resolution of .0375 degrees per step.

Relevant documentation for the control board and motor is attached. More information can also be found at .

4 AVRISP In-System Programmer

[pic]

AVR In-System Programmer is used to program the flash memory of the Atmel ATMega16 microcontroller. The product website is .

5 Ultralink Model 325 WWVB Receiver/Decoder

[pic]

This device receives the 60 kHz time signal from Fort Collins, CO. The product is discontinued, but the website is .

*Important: The 4-wire modular (telephone) cable used is not regular cable. Normal cable “flips” the pins from one side of the cable to another. Ex. Pin 2 on one side of the cable is Pin 3 on the other side. The cable used with the Ultralink receiver does not crossover. Ex. Pin 1 on one side is Pin 1 on the other side. Pin 2 is Pin 2, etc…

Relevant documentation for the WWVB receiver is attached.

6 Other Parts

1 Power Supply

The AT switching power supply was chosen to meet the power requirement by the motors. Each motor control board sends approx. 1.5A to the corresponding motor; therefore the power supply needs to supply at least 6A current at +12V. This power supply is rated for 10A.

2 Optical Switch (Pendulum sensor)

The Optek Slotted Optical Switch was chosen to sense the pendulum movement. The datasheet is available at . The switch consists of an infrared (IR) LED on one side of the slot and an IR transistor on the other. A 100Ω resistor inside the electronic interface box is connected to the LED portion to give it the rated current of 50mA.

3 Liquid Crystal Display (LCD)

The Optrex DMC-20434 20x4 LCD display is a standard LCD. Its datasheet can be found at .

4 One-Ohm Power Resistor

The Ohmite Power Resistor is used to load the power supply.

5 Matrix Keypad

The 4x4 matrix keypad has no datasheet available.

Appendix C—Technical Specifications

1 Power Supply Considerations

Switching power supplies need to be loaded approximately 20% for proper operation. Since the 5V supply is rated at 25A, all the connections to this supply will not fulfill this requirement. Without proper loading, the power supply can be damaged. A 1Ω power resistor rated at 35W (see 8.6.4) is used to guarantee that the supply is always loaded with at least 5A. This power resistor therefore dissipates 25W of power.

2 Internal System Connections

1 PORT A—Stepper Motor Control

PORTA on the development board is connected to the control lines on the stepper motor control boards. PORTA acts as a bus line across all four (4) control boards. The pin mapping of PORTA is as follows:

|PORTA Pin |Stepper Motor Control |Line Function |

|Number |Pin Number | |

|0 |7 |Phase B |

|1 |6 |Phase A |

|2 |5 |Motor 4 Clock |

|3 |4 |Motor 3 Clock |

|4 |3 |Motor 2 Clock |

|5 |2 |Motor 1 Clock |

|6 |Unused | |

|7 |Unused | |

The phase lines determined the direction the motor will turn, and the clock line is used to latch the phase values into the corresponding motor control board. There are four (4) different phases with the corresponding logic values:

|Number |Phase B |Phase A |

|0 |0 |0 |

|1 |0 |1 |

|2 |1 |0 |

|3 |1 |1 |

So to turn a motor clockwise, you would sent the sequence 0, 1, 2, 3, 0, 1, 2, 3, … triggering the clock line each time.

2 PORT B—20x4 LCD

PORTB is connected to the LCD. The pin mapping is as follows:

|PORTB Pin |LCD Pin Number |Line Function |

|Number | | |

|0 |11 |Data I/O |

|1 |12 |Data I/O |

|2 |13 |Data I/O |

|3 |14 |Data I/O |

|4 |4 |Reg. Select |

|5 |5 |R/W |

|6 |6 |Enable |

|7 |Unused | |

The other LCD Pins are connected as follows:

• LCD Pin 1 is connected to ground via protoboard connection

• LCD Pin 2 is connected to +5V via protoboard connection

• LCD Pin 3 is the contrast selector and is connected to a potentiometer between ground and +5. Adjusting the potentiometer adjusts the contrast.

3 PORT C—Matrix Keypad

PORTC on the development board is connected to the matrix keypad. The pin mappings are as follows:

|PORTC Pin |Keypad Pin Number |Line Function |

|Number | | |

|0 |1 |Row 1 |

|1 |2 |Column 4 |

|2 |3 |Column 3 |

|3 |4 |Column 2 |

|4 |5 |Row 4 |

|5 |6 |Column 1 |

|6 |7 |Row 3 |

|7 |8 |Row 2 |

The matrix keypad is used as follows:

1. The column pins on the microcontroller are set as inputs with the internal pull-up resistor activated. Therefore, there default value is 1.

2. The row pins are set as outputs with a value of zero.

3. When a key is pressed, one row and column pin are connected, which in turn changes the value of the corresponding column pins to 0.

4. The microcontroller sees which column pin is 0, therefore determining the column of the key being pressed

5. This process is repeated with the column pins as outputs of 0 and the row pins as inputs (with internal pull-ups activated). This way the corresponding row is determined

4 PORT D—Slotted Optical Switch

Currently the only pin used on PORT D is pin 2, the external interrupt0 pin. This pin is connected to the collector of the optical switch. This pin is set as an input with the internal pull-up enabled. Therefore, the pin will normally read 1.

As stated in 8.6.2, the switch consists of an infrared (IR) LED on one side of the slot and an IR transistor on the other. The emitter of the transistor is connected to ground, and the collector to pin 2 on PORT D (which has the internal pull-up resistor activated). With this configuration if no infrared light is present, the transistor is off, and a value of 1 is present on pin 2. If infrared light is present, the transistor is on, and current flows from the collector to the emitter. This essentially shorts the emitter to the collector, pulling pin 2 to ground (hence giving it a value of 0).

A 100Ω resistor inside the electronic interface box is connected to the LED portion to give it the rated current of 50mA. This LED is always on, so if nothing is in the slot on the optical switch, pin 2 will read 0. If something is in the slot, the IR light from the LED will be blocked from the transistor, and so pin 2 will read 1. This is to be placed somewhere on the pendulum to sense when every second occurs.

Note: The rest of the I/O ports on PORT D are unused, so if later modifications to the project are desirable, these I/O pins can be used. Possible additions include limit switches on the clock dials so the user would never have to enter the time shown on them (this would provide for closed-loop control).

5 Power Connector

The protoboard is connected to +5V and ground via 5VDC output pin on the MegaAVR-Dev Board.

6 Programmer

If reprogramming of the board is ever required, it can be accomplished by using one of a computer’s serial (COM) ports. The original programming is done using the WinAVR programming suite which consists of AVR-GCC, Binutils, AVR-Libc, and AVRDude. AVRDude is the program used to transfer the binary file from the computer to the AVRISP programmer (via COM port) and then into the microcontroller. More information on WinAVR can be found at .

Appendix D—Special Programming Mode

1 Programming Stepper Specifications Into Flash

Since the electronic interface device was completed before the gearing of the motors was determined, a way for the internal program to be easily updated without reprogramming the entire system needed to be established. A simple program was created and loaded into the bootloader section of the Flash memory to allow the program memory to be updated from the keypad.

Warning! Undesirable operation will occur if done improperly!

|[pic] |[pic] |

|Figure 20. Enter steps/sec for motor. |Figure 21. Enter the direction for motor. |

|[pic] |[pic] |

|Figure 22. Confirmation screen. |Figure 23. After all motor specs. have been entered, press [*] to|

| |write FLASH. |

1 Instructions

1. Press [A] from the main screen (Figure 8)

2. From the menu, press [4] (not displayed)

3. A warning message will appear, press [A] to continue

4. Enter the 4-digit pin code ____

5. Starting with motor 1, enter the number of steps/second required (Figure 20) or press [#] if the value for that motor is already entered (a 1:1 gear ratio would require 160 steps/second, and would make the stepper motor go one revolution per minute, like the second hand on a normal clock)

6. Enter the direction the motor should turn for normal operation (Figure 21)

7. The values entered will be displayed, press [*] to confirm, or any other key to re-enter values (Figure 22)

8. Repeat steps 5-8 for motors 2-4

9. Press [*] to write the values into Flash (Figure 23)

10. The program will then reset, and the time shown on each of the clock dials will need to be re-entered (see 5.1 and possibly 5.2)

References

1] Chi Epsilon, University of Florida. The Teaching Clock Tower Project at the University of Florida. Chi Epsilon. (2004, August 26).

2] MegaAVR-Dev – Development Board. Progressive Resources LLC. (2004, August 26).

3] Herbach and Rademan. (2004, August 26).

4] AVR ISP In-System Programmer. Atmel Corp. (2004, August 26).

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

[pic]

Figure 2. The slotted optical switch (see h¿qˆh¿qˆ5?CJ^J[?]h¿qˆhi‹5?CJ^J[?]h¿qˆ5?CJ^J[?]hi‹5?CJ^J[?]jõh75­h75­U[pic]^J[?]h¿qˆh75­^J[?]h75­^J[?]h¿qˆh¿qˆ5?CJ$^J[?]h¿qˆh;,£^J[?]h;,£^J[?]h¿qˆ^J[?]hïC h¿qˆ5?CJ,aJ,hïC REF _Ref81624140 \r \h [pic]8.6.2)

[pic]

Figure 8. The main screen.

[pic]

Figure 5. Menu screen.

[pic]

Figure 4. [*] to Confirm.

[pic]

Figure 3. Enter dial positions.

[pic]

Figure 6. Choose clock dial to input.

[pic]

Figure 7. Manually input the current time.

[pic]

Figure 9. Status display.

[pic]

Figure 10. Reset button.

[pic]

Figure 1. External Connections.

[pic]

Figure 16. Herbach and Rademan stepper motor control board. Courtesy of [3].

[pic]

Figure 17. Stepping Motor. Courtesy of [3].

[pic]

Figure 18. AVRISP programmer. Courtesy of [4].

[pic]

Figure 19. WWVB receiver.

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

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

Google Online Preview   Download