AVR Scope Clock H3-1

 

Dutchtronix AVR Oscilloscope Clock Hardware 3.1, "basic" version FAQ
Firmware Version 3.3

November 5, 2008

 

 Sections:

 
bullet

Introduction

bullet

Interfacing

bullet

User Interface

bullet

Clock Operation

bullet

External Clock Source, incl. NMEA Input

bullet

Serial Interface

bullet

Warnings

bullet

Hardware Issues

bullet

AVR-Specific Issues

bullet

Fun 

 

The following description applies to the "basic" Dutchtronix AVR Oscilloscope Clock. The “basic” version allows the user to display various clocks on an analog CRT device, like an oscilloscope, and control the options using the on-board push button using on screen menus, all powered by an external wall wart (user provided). The hardware 3.1 PCB has footprints for other functions, like on-board BNC connectors, an RS-232 level converter circuit and even a USB interface. The components for these other functions are not included in the basic kit.

 

Would you like to upgrade your Dutchtronix AVR Oscilloscope Clock Hardware 3-1 Basic version to the Enhanced version? You can now upgrade from the Basic version to the Enhanced version!

 

Introduction.

Dutchtronix is proud to present a new hardware version for the Dutchtronix AVR Oscilloscope Clock, version 3.1. The main improvements in hardware 3.1 are:

 

bullet

 Use of the Analog Devices AD7302 DAC with built-in OpAmp. This DAC has a  low output impedance while generating an excellent image.  The low output impedance allows the use of regular wires or BNC cables to connect the Clock board to a display device like an oscilloscope, an XY monitor or even a home made CRT device. Probes are still supported.

bullet

On board power supply. Allows the use of an 7-15V wall wart with a standard DC connector (5.5mm outside diameter Barrel Jack, center positive) to power the AVR Oscilloscope Clock. A LED indicates the presence of power. A separate 5V connector is present too.

bullet

 On board trimpot to set the output voltage range of the DAC. Maximum voltage range is 5V.

bullet

 Intensity control is now present with both positive (Z) and inverse (ZINV) drive levels.

bullet

 More capacitors for reliability.

bullet

Direct access to the AVR serial interface, for those times you need to do serial communication at the 5V level.

 

The PCB also has footprints for these improvements:

 

bullet

True RS-232 level serial interface with DB-9 female connector. This allows you to connect the AVR Oscilloscope Clock to a computer using a standard serial cable. The hardware V3.1 PCB has headers to easily bypass the RS-232 level conversion

bullet

 Two on-board BNC connectors for use with standard BNC cables. Probe connectors (“turret terminals”) are always present.

bullet

 Room for an extra push button switch, which will allow easier control in the future.

bullet

 Support for a USB connection using a standard USB cable. With the USB connection parts installed, you can optionally power the AVR Oscilloscope clock form the USB connection.

 

The firmware is version 3.3, compatible with version 3.0 but modified to support the AD7302 DAC.

Image quality varies from scope to scope of course. X-Y monitors, which are like oscilloscopes but without the time-base section, work best. All pictures showing the Dutchtronix AVR Oscilloscope clock with V3.3 firmware were taken on a Tektronix 608 X-Y monitor using the Intensity Control output ('Z') available on the board.

 

Features of the V3.3 firmware:

 

bullet

Binary Clock Display option (Menu-Dial:Bin). This is a BCD binary clock. Show them you are an ubergeek! Try changing the current time when the Numeric Display is turned off!

bullet

24 Hour Clock Dial option (Menu-Dial:24hr).To see the exact time on an analog dial, when no numeric date is being shown (for example  when the current date is displayed or when the Numeric Display has been turned off), you need a dial showing the 24-hour time digits. The dial will switch automatically, based on the current time.

bullet

More into a classical clock dial? Use Roman Numerals Dial option (Menu-Dial:Rom)

bullet

Date Display (Menu-Num:Date). The date can be changed using a long push while the date is being displayed in the Numeric Display.

bullet

Hexadecimal Numeric Time Display (Menu-Num:Hex). This option was designed to work together with the Binary Clock Display to form a "Bi-Hex" clock.

bullet

Fractional Seconds Display option (Menu-Chrono:On). This mode will add a display of 1/100 of a second unit to either the 24 hour Numeric Display or the Hexadecimal Numeric Display

bullet

The AVR Oscilloscope Clock supports a total of 30 different display combinations.

bullet

GPS device NMEA parsing ($GPRMC records) allows you to connect your GPS device to the AVR Oscilloscope Clock and always display the correct Date and Time. You select the correct Local Time Offset (-12 to +12) when enabling this option in the Menu. If Automatic Daylight Saving Time Adjustment is enabled (see below), you don't have to worry about that either.

bullet

Automatic Daylight Saving Time Adjustment is supported for two zones: USA and EU for the years 2008 to 2014. Not only will the AVR Oscilloscope Clock set the time forward or backwards at a transition, it will also apply the proper adjustment when the clock has been turned off for a while and is turned on when Daylight Saving Time is active, and it will only do it once. Keep in mind that the Real Time Clock present on the AVR Oscilloscope Clock knows nothing about Daylight Saving Time.

bullet

User Name Display on the clock face is now supported. This User Name can be up to 20 characters in length. By default the name "Dutchtronix" is displayed but you can edit the User Name in the menu (granted, it is a slow process but it only needs to be done once). Spaces can be used in the User Name, but 2 adjacent spaces indicate the end of the User Name. You can also turn off the User Name Display.

bullet

Need to return the clock to its original state? Select the Menu-Reset:On option. This will clear the EEProm configuration data. Handy if the EEProm configuration data ever get messed up. This option requires an explicit ON value to prevent the user from accidentally erasing the EEProm configuration data.

bullet

Play option: Menu-Play:Norm/Rev/FF/FR where FF means Fast Forward and FR means Fast Reverse.

bullet

The Serial Command Line interface; some commands require sub-values. For example to set the Numeric Display to show the date, enter "xn", followed by "03". The clock will prompt for the sub-values, showing the valid range.

bullet

The AVR is always the clock master, reading the current time/date from the Real Time Clock (RTC) when starting up. The RTC interrupts the AVR every second to advance the time. The current time is saved to the RTC every minute. The RTC date is updated whenever the date is changed (user or GPS input).

bullet

Demo mode allows you to demonstrate many of the features of the AVR Oscilloscope Clock to friends and family.

bullet

An on-screen menu using push button switch S1. This on-screen menu has 13 fields and going through them all without making a change takes 13 long pushes. If you enter the menu by accident, just advance to the "Boot" field and do a short push; the clock will restart instantly.

 

AVR Clock Interfacing

 

Q: What kind of oscilloscope can I use?

A: Any analog scope with X-Y mode should work without problems. Low-end digital scopes will surely not work, High-end digital scopes may work (Tektronix 2014B works ok, HP54600B works well) . High-end analog scopes (400 MHz or better) like the Tektronix 7904 or 7854 will not have as stable a picture because their phosphor decay time is so short; this will make the picture look less stable, even at a refresh rate of over 150 times a second. On scopes like the Tektronix 465 and 475, the picture is rock solid. Please let me know if you’ve been successful with a digital scope.

 

Q: What kind of cables should I use to connect the clock to the oscilloscope?

A: The easiest way to connect the AVR clock to your scope is to use two probes with pincer tips. The CH1 and CH2 terminals were selected to be easily useable for probes with pincer tips. The AD7302 DAC is a low output impedance DAC which allows the use of 1X probes, BNC cables or straight wires. Connect the scope’s intensity control to the Z or ZINV output of the AVR clock to improve the image even more.

Connect the probes heads to the terminals marked 1 and 2. Set the scope in X-Y mode and connect the probe BNC connectors to channels 1 and 2. Turn R8 all the way counterclockwise (maximum image size). Set both channels to DC mode and the voltage range to 0.5V per division. Now turn R8 clockwise to make the image fit your screen.  You can tweak the image, for example to make it completely square (8 divisions), by manually reducing the voltage per division value (VAR knob.) If your scope does not support 0.5V per division, reduce the image size by turning R8 until the generated images matches your scope.

Most scopes define CH1 and the X axis and CH2 as the Y axis. Some, for example the Tektronix 485, reverse this convention. As a result, you will need to swap the probes.

Please note that if the image looks distorted, you may have to adjust the probe compensation (they usually have a small adjustment screw).

 

Q: How do I power the AVR clock?

A: Use a standard wall wart which generates somewhere between 7 and 15V DC and has a 5.5mm outside diameter DC power plug, center positive. This is the most common power connector used. The AVR Clock has protection against reverse polarity. You can also connect a 5V regulated power source directly on the VCCPOWER adapter, + and - are marked. The +(positive) is on the side of the power led, the –(negative) is next to the VCCSELECT header. The –(negative) side is marked as a ‘1’ on the connector itself, though the marking is very small. You can make a cable using the supplied 2-pin connector. This connector is polarized so reversing the power when you using this connector is not possible (provided the cable is made correctly).

As an added benefit, you can use the VCCPOWER connector to provide +5V to other projects when using an external wall wart since the 7805 regulator is oversized. One possible application is to power a GPS unit.

 

AVR Clock User Interface

 

 

Q: How is the on-board button switch operated?
A: The push button switch has 2 actions: long push (> 1 second, hold until you see a change) and short push (<1 second, push and release). The long push enters the Time/Date Change mode, the short push enters the Menu mode.

 

Time/Date Change mode:

bullet

short push advances the current field one

bullet

long push moves to the next field.

 

Menu mode:

bullet

short push selects the next value (or activates the current option)

bullet

long push moves to the next option.

 

 

 

 

AVR Clock Operation

 

Q: How do I change the time on the AVR Clock using the button switch?

A: To change the time, make sure that the Numeric Display does NOT show the current date. If so, change it using the menu. A long push will enter the Change mode. If the Numeric Display is Off, the time will also be changed, even if the Binary Clock Display is active. The clock is stopped when changing time. The value being changed will flash at this point. If the Numeric Display is Off, one of the Clock Hands will flash in an Analog Dial Display. In a Binary Clock Display, the "lights" columns representing the value being changed will flash. A short push will increment the current field (hours, minutes, seconds). A long push will move to the next field, using the current field value as the new time value. Once done with the seconds field, a "Push To Start" message pops up. A short push will restart the clock at the selected time. However a long push will restart the clock at the actual time, as kept by the on-board Real Time Clock. This is handy if you entered the Change mode by accident or if you changed your mind. Change mode times out after 30 seconds of inactivity.

 

Q: How do I change the date on the AVR Clock using the button switch?

A: To change the Date, make sure that the Numeric Display shows the current date. If not, change it to display the Date using the menu (Menu-Num:Date).  A long push will enter the Change mode. The value being changed will flash. A short push will increment the current field (year, month, day). A long push will move to the next field. The clock leaves Change mode automatically after finishing the Day value. The order of change is Year, Month, Day. This way, the clock can verify the date validity better (number of days per month, leap year etc.) Just FYI, 2000 is a leap year in the Gregorian Calendar because it is divisible by both 100 and 400.  Change mode times out after 30 seconds of inactivity.

 

Q: What options are available using the on-screen menu?

A: A short push will enter the Menu Mode. Once the Menu mode is entered, you'll see the following menu on the oscilloscope screen:
 

Option

 Values

Function

Option

Value

Function

Num

12hr
24hr
Hex
Date
Off

Select Numeric Field to Display

Dial

12hr
24hr
Rom
Bin
Min

Select Clock Dial to Display

GPS

Off
-12 ..
+12

Select GPS NMEA input using the selected local time zone offset

DST

USA
EU
Off

Select Automatic
Daylight Saving Time for USA or EU zones

Boot

 

Reboots the clock

Demo

 

enter DEMO mode

Chrono

Off
On

fractional seconds
display

Cal

Off
On

Turn Calibration Screen On or  Off

Led

On
Off

Controls on-board Led

 

 

On
Off

Turn Burn-in Prevention On or Off

Play

Off
Rev
FF
FR

Fun modes: Reverse, Fast Forward and Fast Reverse

Reset

Off
On

Re-initialize the EEProm area of the Atmega168 to "virgin" state.

Name

On
Off
Edit

User Name Display

   

Current User Name is displayed below the Menu

 

Q: How do I change an option on the AVR Clock using the button switch?

A: A short push will enter the Menu Mode. The option being updated/selected is flashing. Move to the next option by a long push. The options Boot and Demo are activation options. A short push will activate them. The other options are selection values. A short push will show the next selection value. Moving to the next option (using a long push) when the selection value has changed, will activate the selected value and the clock will leave the menu mode. The Boot option is also a convenient way to exit the menu.  Menu mode times out after 30 seconds of inactivity.

 

Q: How do I tell the AVR clock to display only the analog clock?

A: Select the Num option, set the value to Off. This mode is persistent.

 

Q: How do I tell the AVR clock to display a minimal dial on the analog clock?

A: Select the Dial option, set the value to Min. Only 4 hour numbers will be displayed. This mode is persistent.

 

Q: How do I tell the AVR clock to display a dial with Roman Numerals on the analog clock?

A: Select the Dial option, set the value to Rom. Roman Numerals will be now be displayed on the dial. This mode is persistent.

 

Q: How do I tell the AVR clock to show a Binary Clock Display ?

A: Select the Menu-Dial option, set the value to Bin. The clock will switch to a Binary Clock Display. This clock will display 24 Hour time in a BCD Binary fashion. You will see 6 columns displaying from 2 to 4 on-off "lights".  The left-most 2 columns show the hours, the middle 2 columns show the minutes and the right-most columns show the seconds. Each column represents one digit, together they form a value. The lowest position in each columns represents bit 0, the highest can be bit 2, 3 or 4. The size of each column was selected to represent the full range for each digit in its position. For example, the lowest digits for seconds can range from 0..9 so we need 4 bits to display the number 9 in binary. The highest digit for hours can range from 0..2 so we only need 2 bits to display the number 2 in binary. When you select a hexadecimal Numeric Display (Menu-Num: Hex) with this Binary Clock Display, you are looking at a Bi-Hex clock.  This mode is persistent.

 

Q: How do I read the Numeric Time in Hex?

A: The Numeric Time in Hex is a binary representation of the values of the time components, in 24 hr format. Convert each field from hexadecimal to decimal (0..59) and you'll see the current time. There is no separate BCD Hex Numeric Display since such a display is identical to the regular 24 hr Numeric Display since each digit is in the range 0..9 (identical in decimal and hex)

 

Q: How do I tell the AVR clock to display the Numeric Display in AM/PM mode?

A: Select the Num option, set the value to 12hr. This mode is persistent.

 

Q: How do I change the Clock Face to something more serene?

A: The AVR clock provides 3 different controls to change the clock face, providing a total of 30 different combinations. Use the Num option to turn the numeric display Off . Use the Menu-Dial:Min option to remove most digits from the clock face. The combination of no numeric display and fewer digits provides a minimal but elegant display.  You can select the Numeric Display format with the Num option, value 12hr, 24hr, Hex, Date, or Off

 

Q: How do I change the User Name to my own preference?

The current User Name is displayed at the bottom off the menu page, but is not a normally selectable field. You must explicitly select the "Edit" option in the "Name" field to change the User Name. The reason for this is that editing is cumbersome with just one push button. Once a User Name edit has started, you have to go all the way to the end of the name, followed by 2 spaces, to complete the edit. Therefore an explicit selection is required.

If you are impatient like I am, you may produce several expletives when entering your desired name since you just pushed the button one too many times, and ended up with the next letter. Luckily, you only have to enter the desired User Name once only since the name is stored in the AVR EEprom. Flashing may obscure the current char for a very short time (1/2 second) so be patient when incrementing a letter: if you go to far, you'll need to push 96 times to get back to where you were!
The actual edit process is simple: the character being changed flashes. A short push "increases" the char in an ASCII sequence (ASCII 127 is the highest char available, after which rotation to SPACE (ascii 32) occurs.
A long push advances to the next char in the name. Spaces are allowed, but only one at a time since a sequence of 2 spaces is interpreted as the end of the User Name (a full buffer also ends editing). If you entered the edit mode by accident, you can either advance to the end of the name by using long pushes, followed by 2 spaces, or you can just wait 30 seconds and the clock will time-out the edit mode.

Display of the User Name can be turned off using the "Off" option the "Name" field.

 

Q: What is the "Automatic Daylight Saving Time" feature all about?

A: Daylight Saving Time, called "Summertime" in the European Union, is a time system where time is advanced by one hour sometime early in the year and time is set back one hour near the end of the year (in the Northern Hemisphere.) When you live in the USA or Western Europe, you won't have to change the clock to correct for Daylight Saving Time (DST) until 2015! The dates when DST takes effect and ends are programmed in the AVR clock for the years 2008-2014, based on the most recent laws, both for the USA and the European Union. Look at this website for all the details.

Not only will the clock automatically set the time one hour forward (and one hour back) when transitioning in and out of a DST window (the combination of date and time for which DST is active), the clock will also set itself to the proper time if it has been turned off for a while. Even though the Real Time Clock (RTC) on the AVR clock keeps running when the clock is turned off, it is not aware of DST so the RTC time will be off by one hour if it was turned off before a DST window, then turned on within such a window. The AVR clocks make the necessary adjustment when turned on. The clock keeps track of the adjustments made for each of the 7 supported years so that adjustments (forward and backward) are only applied once.

If the user manually changes the date, the clock will check if this new date requires a DST adjustment and will do so, if needed.

If the user manually changes the time, the clock assumes the user knows best, will not do an DST adjustment but will mark that a DST adjustment was made for the current year (if appropriate).

The time at which DST starts and ends is fixed at 2:00 AM. This is valid for the USA and most of Western Europe. However in the United Kingdom (which has UTC time), DST starts and ends at 1:00AM. There is no separate UK zone so the AVR clock is not 100% accurate for those living in the United Kingdom.

The automatic DST feature also works with the GPS NMEA input mode, again assuring you of an accurate date and time. Combine GPS NMEA input mode with Automatic Daylight Saving Time and you'll have the correct date and time until March 8, 2015, 01:59 AM, accurate to within 10 milliseconds (when also using the GPS 1 PPS input.)

 

Q: What does the "Chrono" Menu option do?

A: The Chrono option in the menu enables a fractional seconds display in the 24 hrs and hexadecimal numeric display modes. This fractional seconds display shows the current time in 1/100 of a second increments.

 

Q: Why does the clock display jump ever so slightly every 5 minutes?

A: The AVR clock offsets the display slightly every 5 minutes to prevent screen burn-in on your oscilloscope. You can toggle this burn-in prevention feature on or off using the BurnIn option, value On or Off. This mode is persistent.
Note: this feature is not working in firmware V3.3. It has been fixed in firmware V3.3a.

 

Q: Why doesn’t the Calibration Screen change location to prevent Burn-in?

A: This is a design decision. Having the Calibration Screen move while you are aligning the screen doesn’t seem to be a good idea. Keep in mind when aligning that the actual screen will move by a very small amount every 5 minutes unless burn-in prevention is turned off

 

Q: What does “this mode is persistent” mean?

A: It means that the mode is remembered when the power is turned off, and the clock will start in the same mode when the power is turned back on. This is achieved by setting status bits in the EEProm section of the Atmega168.

 

Q: How do I align the clock properly on my scope?

A: Select the Cal option, set the value to On , which will display a Calibration Pattern on the scope, to adjust the display. While in Calibration Mode, use the Volts/Div VAR knobs together with the position knobs to get the best square possible; this screen can also be used to fine-tune the probe compensation adjustments.  Get back in the Menu mode (short push), Select the Cal option, set the value to Off , to return to the normal clock display.

 

Q: How do I tell the AVR clock to start and stop blinking the LED?

A: Select the Led option, set the value to On or Off to toggle the LED blinking. Stopping the blinking LED will also suppress the valid NMEA record received notification on the display ('G') if GPS mode is enabled. This mode is persistent.

 

Q: How do I reset the AVR clock without disconnecting power?

A: A short push on the button switch on the AVR clock enters the Menu mode, advance to the Boot field (it will be flashing when it is selected). Another short push will active the Boot option, causing a system reset, initiated by the AVR.  Shorting pins 5 (Reset, active low) and 6 (GND) of the ISP connector will hardware reset the AVR clock. Normally, no connector is present on your board, but you can solder in a 2-pin header. There are 5 columns of 2 pins each; use the middle column.

 

Q: Is there another way to communicate with the AVR Clock?

A: Yes, you can also use the serial interface to communicate with the AVR Clock. This requires an RS-232 Level Conversion circuit, a serial cable and a terminal, usually a terminal program on a PC. Use the letter "x" to obtain a prompt. This interface is completely optional.

 

Q: How do I know which version of the firmware my clock is running?

A: Enter menu mode using a short push. The top line shows the current firmware version. The serial connection will also display the firmware version, both when starting up and when using the status command ("s").

 

Using an External Clock Source

 

Q: How do I apply an external clock source to the AVR clock?
A: The AVR clock normally receives a 1 PPS (Pulse per Second) signal from the Real Time Clock (RTC) and triggers on the negative going edge. This pulse can be intercepted and replaced at the header marked "1PPS". The "1PPS" pins are normally shorted by a shorting block, but you can feed your own 1 PPS signal to the left pin of the 1PPS header (closest to the corner).

 

Q: How do I hook up the AVR Clock to a GPS unit?

A: Connecting your GPS unit to the AVR Clock is simple once you get the correct cabling. This step may be frustrating though.

 

bullet

Serial Communication can electrically be done in at least 2 ways:
       - using TTL levels (5V)
       - using the RS-232 convention (-12V to -5V)
The middle pin of the header marked "RXROUTE" accepts incoming serial communication and expects 5V (TTL) level signals. Check what voltage level your GPS unit generates on its outgoing serial port. A bare GPS chip/board usually generates 5V (TTL) levels (but it could also be 3.3V), a more extensive board may generate the RS-232 levels. If your GPS unit generates these RS-232 levels, you'll need to add a RS-232 level conversion circuit, either on the AVR Clock PCB directly or externally.
Upgrading from the Basic version to the Enhanced version is one way of adding the RS-232 Level Conversion Circuit.

 

bullet

Serial communications is based on a TX line and an RX line. You need to make sure that the TX line of the GPS unit is connected to the RX line on the AVR Clock. A serial cable used to communicate with a PC will not work! Making a second serial cable is by far the easiest solution; that way you can switch cables to talk to a PC or to your GPS unit. An alternative is to connect a cross-over cable to your existing cable to switch the RX and TX lines. Make sure you pay attention to the DB-9 connectors used on your cabling: there are male ones and female ones. Combining a "gender changer" and a cross-over cable is a good option.

 

Once the connection is working, configure the GPS unit to send out NMEA $GPRMC records at 4800bps; this is the default on most units. The GPS device may send out lots of NMEA information every second. The AVR clock will have to process every record, discarding most of them. Even though the Serial Input on the AVR Clock is completely interrupt driven and buffered, it does take some time to find the individual NMEA records, time during which the oscilloscope screen cannot be refreshed and you will see an intensified dot on the screen when a lot of unwanted NMEA records are streamed by the GPS unit. If you can, disable the sending of other records and set the send frequency of the $GPRMC record to no more than once every 5 seconds; this is not required but makes it easier for the AVR Oscilloscope Clock. If available, also select UTC time, not GPS time.  Do not connect the cable to the AVR Clock yet at this point.

Start the menu on the AVR Clock and advance to the "GPS" field. The default value is "Off". Short pushes will cycle you through the possible options. These numbers indicate your "local time zone offset" from UTC (Greenwich time). For example, the local time zone offset here in the Northwest is -8. For the United Kingdom, the offset is 0. Activate the selected option and connect the cable. If all is well (you may have to wait quite a while for a cold GPS start), you will see the letter 'G' appear in the status field every 4 to 5 seconds, lasting 1 second. This indicates that the AVR clock has found a valid $GPRMC record. The 4 to 5 seconds is because the AVR clock will wait 4 seconds after finding a valid $GPRMC record before accepting another one. Parsing these records costs time, including several ASCII to binary conversions, so the AVR Clock waits 4 seconds after receiving a valid record. If the AVR clock determines that its own time and/or date differs from the time and/or from the GPS device (after adjustments for the local time zone offset and possibly Daylight Saving Time), it will update itself and start a 5 second warning (flashing 'G'). This should be infrequent. The display of a 'G' every time the AVR Clock receives a valid $GPRMC record can be turned off using the Menu-Led:Off option.

Please remove the GPS cable before changing the "GPS" field in the AVR Clock menu to "Off". First of all the baud rate of the serial port is changed from 4800bps to 19200 bps and secondly, the AVR clock will try to interpret the incoming data (from the GPS device) as commands.

Combining the 1PPS signal from a GPS unit with NMEA parsing will give you an extremely accurate clock which will continue running even if you lose the GPS satellite signal (displaying the 'P' warning); the clock will correct itself, if necessary, once another lock is obtained.

 

SparkFun Electronics kindly made one of their current GPS units, the amazing EM406a Sirf III from USGlobalSat, available for testing and I'm glad to report that it works like a charm, inside, no external antenna required, no configuration required. Here is my setup:

 

I cut off the connector on one side of the cable included with the EM406 and soldered some solid wire to the tiny stranded wires to make them strong enough for breadboarding. Next I plugged these wires in according to the documentation: 1-GND, 2 -VCC, 3 - RX, 4 - TX, 5 - GND, 6 - 1PPS. If you use an external wall wart to power the AVR clock, you can use the +5V connector on the AVR clock to power the GPS unit, like I did in the picture.

 

To connect the setup to the AVR Clock, I used two patch cables, one to make the ground connection (Black), one to make the TTL level Serial signal connection (yellow).

You can also connect pin 6 (1PPS) to the left pin of the 1PPS header on the AVR Clock and you'll have a clock with atomic accuracy!

 

Use the excellent USGlobalSat demonstration software to check the GPS unit and configure the NMEA output to one $GPRMC record every 5 seconds (or less frequently) at 4800bps (this is not required; the default configuration works out of the box).

 

This setup is obviously not the only possible setup but it is a starting point.

 

 

 

Serial (RS-232) interface

 

 

Q: Do I need the use the Serial Interface?

A: No, use of the Serial Interface is optional. The Dutchtronix AVR oscilloscope scope clock uses the on-board button switch S1 to set the time or date and has an on-screen menu to set options, using the same push button switch. To use the Serial Interface on the "basic" version of the Dutchtronix AVR Oscilloscope Clock to communicate with an RS-232 level device (like a PC), you'll need to add an RS-232 level converter, either by installing the required parts on the PCB, or by using an external level converter circuit.

 

Q: What is an RS-232 level converter circuit?

A: The AVR has a serial interface built-in (pins 2 and 3) and the Clock firmware has extensive support for this serial port. The voltage levels generated on these pins are 0 (Low) and +5V (High) and are available on the middle pin of the PCB headers marked TXROUTE and RXROUTE. However, these are not the voltage levels used in the RS-232 Serial Interface specification, as used by a PC for example. Those levels are approximately +12V (Low) and -12V (High). A special IC (MAX232A or equivalent like the HIN232A or SP232A) is usually used to do this voltage level conversion. This IC (IC5 on the PCB) requires four external capacitors (0.1uF) to do the work; it uses another 0.1uF capacitor for its own power stabilization (these are C12-C16 on the PCB). There is also room for a standard serial DB9 connector on the PCB (X1) as well as a 3 pin RS232 header (as available on the original AVR Oscilloscope clock.)

If the user wants the AVR Oscilloscope clock to communicate with a PC, some RS-232 level conversion must be added. There are several possibilities:

 

bullet

Upgrade from the Basic version to the Enhanced version of the Dutchtronix Oscilloscope Clock.

bullet

Add the components IC5, C12-C16 and X1

bullet

Connect an external RS-232 level converter like the Sparkfun PRT-00133 board.

bullet

Connect an external USB to serial board like the Sparkfun BOB-00718 board.

 

For more information, look at this wiki

 

 AVR Clock Warnings

 

Q: Why is there is a flashing B on my clock?
A: The RTC has reported a Low Battery. Please power cycle the clock to check if it happens again. The next step is to test the actual backup battery voltage with the power turned off. If it looks ok (2-3V), you can clear the flag in the RTC by explicitly updating the time (long push) and restarting the clock. If the battery voltage is too low (<1V), you’ll have to change the Lithium backup battery. The original battery is a Renata CR1225FV, Mouser part number 614-CR1225FV-LF; however, any 3V Lithium battery will work, provided you connect it properly. This Battery warning also implies that the clock time may no longer be accurate. This warning will automatically stop after 60 seconds.

 

Q: Why does the AVR clock display a flashing letter P?

A: This happens when the AVR clock is in back-up mode, i.e., it does not receive the 1 PPS signal (1 Pulse per Second) from the RTC (or another external source). The AVR clock has a countdown timer that is activated after roughly 1 1/30 second (based on its own crystal oscillator), and it advances the time if no PPS signal was received.

This will most likely happen when a GPS device feeds the 1PPS signal and the device looses its satellite lock. The clock will keep going in that case, though running a little slow. If you have the NMEA output of the GPS device connected to the Serial Port (and the GPS option is selected with the proper local time zone offset), the AVR clock will automatically set the proper time and date once the GPS device gets another lock. A flashing letter "G" indicates the the time or date was changed based on the incoming NMEA records.

The RTC has its own backup battery and is always powered. To reset the RTC, please remove it from its socket and reinsert it (with the power disconnected, of course)  The time and date will be random if this happens, so please Reset the EEProm configuration data or set the correct time and date immediately.

 

Q: Why does the AVR clock display a flashing letter G?

A: This only applies when the NMEA output from a GPS device is connected to the Serial Port and the GPS option in the menu is enabled. When the AVR clock determines that its time and/or date is different from the time/date obtained from the NMEA output of the GPS device (and the GPS option is selected with the proper local time zone offset). The AVR clock will update its time (and the on board Real Time Clock) to the time/date obtained from the GPS device and will display a flashing letter "G" for 5 seconds.

 

Q: Why does the AVR clock display the letter G once?

A: This only applies when the NMEA output from a GPS device is connected to the Serial Port and the GPS option in the menu is enabled. When the AVR clock receives valid NMEA data from the GPS device (but no more frequent than once every 5 seconds), it will display the letter G for 1 second. This can be turned off using the "Led Off" menu option.

 

AVR Clock Hardware Issues

 

Q: Why are there 3 pins on the connector marked Ground?

A: These three pins are all three Ground. They are there to give you more freedom hooking up ground wires.

 

Q: The clock dial and or digits seem distorted. Is there a way to fix this?

A: This can happen if you are using 10x probes and the probes aren't properly compensated for your scope. Find the adjustment screws on each probe and adjust them until the image is clean. This should not happen with 1X probes or straight wires (incl. BNC cables). If it does, it indicates attenuation issues with your oscilloscope.

 

Q: How does the AVR clock trigger on the 1 PPS signal?

A: By default the AVR clock uses a 1PPS signal generated by the on-board RTC. This is a negative going pulse so the AVR clock triggers on the negative going edge.  Most GPS units have a TIMEKEEP signal that is normally low and pulses high for 200 mSecs every second; by default, the AVR clock triggers on the negative edge at the end of this pulse. You can use the Serial Command 'M' to toggle the trigger mode of the AVR clock (this requires an RS-232 level converter)

Please note the following. The AVR Clock has an internal pull-up resistor enabled on this pin so that the pin is HIGH when not connected (e.g., when the shunt is removed from JP6). If your 1 PPS signal is normally low, it will have to PULL DOWN the signal to LOW, and a small current will run from the AVR to your signal source.

 

Q: What is the purpose of the push button switch S1 on the AVR clock?

A: It is the user input interface. A short push will enter the Menu mode. A long Push will enter the Change Mode. 

 

Q: What is the purpose of the ‘Z’ pin on the AVR clock?

A: The Z (Intensity) output on the AVR clock dims the beam at the appropriate moments. This output will decrease its voltage towards GND to decrease the scope intensity. Please connect this signal to your oscilloscope intensity control input, if present. It is very effective in suppressing highlighted dots on the screen.

 

Q: What is the purpose of the ‘ZINV’ pin on the AVR clock?

A: The ZINV (Inverted Intensity) output on the AVR clock dims the beam at the appropriate moments. This output will increase its voltage towards 5V to decrease the scope intensity (Tektronix 400 scopes convention). Please connect this signal to your oscilloscope intensity control input, if present. It is very effective in suppressing highlighted dots on the screen.

 

Q: What are the voltage levels present on the CH1 and CH2 terminals?

A: The voltage levels on the CH1 (X) and CH2 (Y) terminals range from 0 to 5 Volts. This range can be reduced using the on-board trimpot R8.

 

Q: I’m seeing a pattern on my scope but no clock display. What is wrong?

A: Make sure your scope is in X-Y mode and that the proper Vertical Mode is selected. On many Tektronix scopes this is the CH2 Vertical Mode. Also double check the probe or wire connections, as well as their Ground.

 

Q: I’m seeing an uneven line at the edge of the scope screen. What is wrong?

A: You have only one channel properly connected to the scope. Make sure both channels are properly connected to the AVR clock CH1 and CH2 terminals.

 

Q: My Tektronix 7000 series oscilloscope and its plug-ins have no X-Y mode. Can I still use it with the AVR clock?

A: Yes, but you will need two separate vertical plug-ins, one in the usual vertical slots on the left and one in one of the horizontal slots (on the right).

 

Q: How can I test the accuracy of the RTC?

A: In Calibration Mode (selectable in the on-screen menu), the RTC will output a 32,768 KHz square wave signal on the RTCCAL pin header. The crystal oscillator can be tuned by inserting a variable capacitor between the RTCTRIM pin header and GND. You can read more about the accuracy of the PCF8563 RTC in the application note referenced in the “Technical Information” section of the AVR oscilloscope website. See also the datasheet of the PCF8563 in the same location.

 

Q: Is the oscilloscope I use permanently dedicated to this clock?

A: No, the only connections are the 2 probes or cables and possibly the Intensity Control. Just unhook the probes/cables (and Intensity Control cable), and you can use your scope for its intended purpose.

 

AVR specific Issues

 

Q: How do I know which firmware version my clock is running?
A: The current firmware version is shown on the options menu, top line. Enter the options menu using a short push (push and release) on the button switch.

 

Q: Where can I find the firmware for the AVR Oscilloscope Clock 3.3a?

A: The firmware for version 3.3a is available on the main Oscilloscope Clock page, under "Technical Information", link "AVR Clock Flash Image V3.3a (Serial Download)". This firmware version is the clock application itself (excluding the boot loader) and can be downloaded to the clock using a serial cable (this requires an RS232 level converter and the program avrprog.exe).

Upgrading from the Basic version to the Enhanced version is one way of adding the RS-232 Level Conversion Circuit.

 

Q: Can I use my official AVR programmer (like the STK-500) to reprogram the AVR?

The flash memory on this ATmega168 AVR is configured into two areas, the clock application (word address 0x0000-0x1dff) and the boot-loader (word address 0x1e00-0x1fff). Using the boot-loader to reprogram the AVR will ONLY update the first area, which is all you need to get an updated clock version.

Programming the flash memory using this "clock only" firmware with an official AVR programmer, will reprogram all the flash memory, in effect clearing the boot-loader area. Turn off the "Boot Reset Vector Enabled" fuse and the clock will work just fine. However, you won't be able to update the firmware using the serial link anymore (you still can use the AVR programmer.)  To maintain the ability to update the flash memory using the serial link, you will need a flash image of the combined "clock+boot loader", which is available on request.

You are advised to first save a copy of the entire Flash area and store this copy in a safe place before updating to another application without a boot-loader. This way you can restore the AVR Clock incl. the boot-loader later.
 

Q: My AVR fuses are set incorrectly. How should they be set?

A: First of all, be very careful because you may make the AVR inoperable by setting the wrong fuse, especially the “Use External Clock” fuse. Do NOT attempt to change any fuses by using the Avrprog program. This program is only used to download new firmware, nothing else. Finally, in the AVR world, UNPROGRAMMED fuses (i.e., disabled) have a ‘1’ value, whereas PROGRAMMED fuses (i.e., enabled) have a 0 value. It’s easy to get confused, depending on the program being used to modify the fuses. Here is a list of PROGRAMMED fuses for the Atmega168 AVR used in the scope clock:

 

bullet

Boot Flash section size=512 words

bullet

Boot Reset Vector Enabled

bullet

SPI (Serial Program downloading) enabled

bullet

Preserve EEPROM memory through the Chip Erase cycle

bullet

Brown-out detection level at VCC=2.7V

bullet

Ext. Crystal Osc; Frequency >= 8.00 MHz. 16K CK/14 CK + 65 ms.

 

Programming an AVR microcontroller and setting the fuses need to be done using an AVR programmer. Popular models are the STK-500 compatible types or the AVR Dragon from Atmel (highly recommended for its in-circuit emulation support). Check out the Atmel or AVRfreaks websites for more information.

 

Fun

 

Q: This AVR clock is too serious. Can’t it do anything fun?

A: Do you wish time was passing faster, or do you want to go back in time? Try the Play Rev or Play FF menu options (or use the P command (00-03)). You’ll see the clock obeying your wishes! Try them together using Play FR! Note that for either of these fun modes, the Real Time Clock (RTC) will not be updated; once you exit the Play Mode, the clock will read the actual time and date back from the RTC.

 

Q: Why does this AVR clock have so many options?

A: I used to work for Microsoft, where we tried to please everyone J.

 

Q: How do I show the capabilities of this AVR clock to my spouse?

A: Run the clock in DEMO mode. You can select this form the on-screen menu: Short Push to select the menu, advance to the Demo field by issuing Long Pushes, activate the Demo using a Short Push.  The clock will enter demo mode. No user settings will be changed by the demo, nor will the time in the Real Time Clock be changed. At the end of the demo, the clock will automatically restart in normal operation mode.

 

 

Back to Dutchtronix AVR Oscilloscope Clock

 

 

horizontal rule

Back Next