Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/products/ex-fastclock/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome to the home of EX-FastClock, a fully integrated Fast Clock for EX-CommandStation.

EX-FastClock is a standalone adjustable speed clock built using an additional Arduino Uno microcontroller and a plug-in shield type TFT touch screen. The commands built into the DCC_EX Command Station make it possible to also integrate an existing microcontroller based fast clock.
EX-FastClock is a standalone adjustable speed clock built using an additional Arduino Uno microcontroller and a plug-in shield type TFT touch screen. The commands built into the DCC-EX Command Station make it possible to also integrate an existing microcontroller based fast clock.

Note: if you only want a real-time clock to make things happen at certain times of day, then the [DS1307](?DS1307) is a simpler/cheaper alternative.

Expand All @@ -26,7 +26,7 @@ Each time the time changes the EX-CommandStation looks for a time change event a

EX-FastClock allows the FastClock device to connect to the EX-CommandStation via either Serial Communications or I2C. Even though EX-FastClock provides the code for an Uno based Clock it should be possible for tinkerer level users to add the relevant code if they already have a working clock that they wish to integrate to EX-CommandStation.

To make full use of EX-FastClock**, you will need a basic understanding of EX-RAIL automation, but we'll share the details and some examples to help with this.
To make full use of EX-FastClock, you will need a basic understanding of EX-RAIL automation, but we'll share the details and some examples to help with this.

**NOTE**: EX-FastClock is in public Beta testing, and as such, we encourage regular feedback on the success or otherwise of both the software and documentation. Please reach out via any of our support methods and help us get EX-FastClock as easy to use and reliable as possible.

Expand All @@ -41,9 +41,9 @@ The EX-FastClock integration includes:

## Credit where credit is due

*The EX-FastClock is based on a project originally written by Jim Gifford (Hallet Cove Southern) in June 2017. That project used a 32 x 8 LED matrix to display the time and was controlled by a number of pushbuttons. You can see [Jim's Original Project here](https://www.hallettcovesouthern.com/track-plan-design-info/arduino-projects/fast-clock/).
The EX-FastClock is based on a project originally written by Jim Gifford (Hallet Cove Southern) in June 2017. That project used a 32 x 8 LED matrix to display the time and was controlled by a number of pushbuttons. You can see [Jim's Original Project here](https://www.hallettcovesouthern.com/track-plan-design-info/arduino-projects/fast-clock/).

- MCUFRIEND.kbv credit: This library was written by David Prentice and has become the De-Facto standard for the shield based TFT screens used in this project. This library inherits from the Adafruit GFX library.
- MCUFRIEND_kbv credit: This library was written by David Prentice and has become the de facto standard for the shield based TFT screens used in this project. This library inherits from the Adafruit GFX library.
- Adafruit for the Adafruit GFX Library.

## Next Steps
Expand Down
8 changes: 4 additions & 4 deletions docs/products/ex-fastclock/02-hardware.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

## What you need for EX-FastClock

- An EX-CommandStattion running version 5.0.0 or later
- An EX-CommandStation running version 5.0.0 or later
- An Arduino Uno microcontroller
- An MCUFRIEND type plug in shield TFT touchscreen
- An MCUFRIEND type plug-in shield TFT touchscreen
- A suitable power supply
- Dupont type wires to connect the components, male to female or female to female as required
- A USB cable to connect the Arduino to a PC to load the software

The software for the EX-FastClock can be found in the EX-FastClock repository in the DCC-EX GitHub. The code can be configured to run a clock which will communicate to the Command Station by either Serial or I2C. The options are chosen from the file config.h. Instructions are contained in the README.md file. Which option you choose will depend upon weather you have serial throttles connected to the serial ports in which case I2C might be the better option. Alternatively if you already have lots of I2C devices then it might be better to run the Serial option.

Given that the MCUFREIND style shield is a shield and uses the A4 pin as LCD_RST it is necessary to make a modification to enable the I2C communication. This involces cutting the A4 pin and soldering a jumper from LCD_RST on the back of the TFT board to the pin that aligns with the UNO RST pin. However if one is intending to configure the clock as a serial device then this modification is not required.
Given that the MCUFRIEND style shield is a shield and uses the A4 pin as LCD_RST it is necessary to make a modification to enable the I2C communication. This involces cutting the A4 pin and soldering a jumper from LCD_RST on the back of the TFT board to the pin that aligns with the UNO RST pin. However if one is intending to configure the clock as a serial device then this modification is not required.

![Modified LCD Sheild](/_static/images/ex-fastclock/Modification.png)

This modification allow the A4 & A5 to operate correctly as I2C and was suggested by David Prentice who wrote the MCUFRIEND.kbv library that this project uses. A discussion on this modification can be found on the [Arduino forum here](https://forum.arduino.cc/t/mcufriend-kbv-library-for-uno-2-4-2-8-3-5-3-6-3-95-inch-mcufriend-shields/353100/100).
This modification allow the A4 & A5 to operate correctly as I2C and was suggested by David Prentice who wrote the MCUFRIEND_kbv library that this project uses. A discussion on this modification can be found on the [Arduino forum here](https://forum.arduino.cc/t/mcufriend-kbv-library-for-uno-2-4-2-8-3-5-3-6-3-95-inch-mcufriend-shields/353100/100).

If using Serial communication no modification is required. Pins 0 & 1 (TX/RX) are unused on the LCD PCB therefore wires may be soldered to the Arduino PCB to run to Serial connections on the CS.

Expand Down
12 changes: 6 additions & 6 deletions docs/products/ex-fastclock/05-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

The EX-FastClock Software will be found in the appropriate repository in the DCC-EX repository on Github

This repositry currently contains two branches:
This repository currently contains two branches:

1. Main. This branch contains a copy of the code and ancilliary files on PlatformIO configuration.
1. Main. This branch contains a copy of the code and ancillary files on PlatformIO configuration.
2. Arduino IDE. This branch contains the files in the necessary structure for use with the Ardiuino IDE

## Libraries

The project requires three libraries -
The project requires three libraries:

- Adafruit_GFX
- Adafruit_Touchscreen
- MCUFRIEND_kbv.
- MCUFRIEND_kbv

All three can be installed from the Arduino IDE library manager or Platformio Library system as required however for compatability where possible use the copies supplied in the repositiory folder.
All three can be installed from the Arduino IDE library manager or Platformio Library system as required however for compatibility where possible use the copies supplied in the repository folder.

### Platformio

Expand All @@ -27,4 +27,4 @@ Select the Arduino IDE branch from the repository and click on the CODE button.

### Both Environments

I have generated two special fonts for the project which can be found in the Fonts folder in the Adafruit GFX Library in this repository. These should be copied into the fonts folder in the Adafruit_GFX library once installed. The file Arial9pt7b.h congtains a fullset of the Arial Font as used in Windows. The file Arial48pt7b.h contains a large 48pt Arial font containing only charachters 0-9 and :. This is used to display the time clock on the screen. The full font was too large to fit into the Uno memory.
I have generated two special fonts for the project which can be found in the Fonts folder in the Adafruit GFX Library in this repository. These should be copied into the fonts folder in the Adafruit_GFX library once installed. The file Arial9pt7b.h contains a full set of the Arial Font as used in Windows. The file Arial48pt7b.h contains a large 48pt Arial font containing only characters 0-9 and :. This is used to display the time clock on the screen. The full font was too large to fit into the Uno memory.
12 changes: 6 additions & 6 deletions docs/products/ex-fastclock/06-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The config.h file comes pre-configured to use the clock in standalone mode. No

## Serial Mode

To communicatein Serial mode it is necessary to edit the config.h file and uncomment the following line:
To communicate in Serial mode it is necessary to edit the config.h file and uncomment the following line:

```cpp
//#define SEND_VIA_SERIAL true
Expand All @@ -31,11 +31,11 @@ To operate in I2C mode edit the config.h file and uncomment the following lines:
//#define SEND_VIA_I2C true
```

In this mode the CS will poll the FastClock to obtain the time. It is necessary to set the same I2C address here as used in the myHal.cpp file within the CS. This is set to a default of 0x55 (decimal 85) but can be set to some other value if this conflicts with othere I2C devices on your setup.
In this mode the CS will poll the FastClock to obtain the time. It is necessary to set the same I2C address here as used in the myHal.cpp file within the CS. This is set to a default of 0x55 (decimal 85) but can be set to some other value if this conflicts with other I2C devices on your setup.

## Screen Header

By default the top of the clock screen displays the name of my own layout. To inset your layout name then change the following line.
By default the top of the clock screen displays the name of my own layout. To insert your layout name change the following line.

```cpp
char header[HDDR_SIZE] = {"Nantyderry Junction"};
Expand All @@ -52,7 +52,7 @@ const int TS_LEFT=899,TS_RT=122,TS_TOP=100,TS_BOT=898;

## Configure existing clock

If you already have a FastCLock there are a number of couple of configuration options which allow you to connect your own clock to a Command Station.
If you already have a FastClock there are a number of couple of configuration options which allow you to connect your own clock to a Command Station.

The various configuration options are outlined below

Expand All @@ -63,7 +63,7 @@ The various configuration options are outlined below
Connecting via Serial is the simplest option if available.

- Run a dupont cable from the TX pin on the arduino to a RX pin on the EX-CommandStation. It is not usually necessary to run a cable from RX to the TX on the EX-CommandStation as the FastClock is not receiving data back.
- Find the Serial defines in the config.h file (or copy config.example.h to config.h if you dont have one), locate the following lines:
- Find the Serial defines in the config.h file (or copy config.example.h to config.h if you don't have one), locate the following lines:

```cpp
//#define SERIAL1_COMMANDS
Expand Down Expand Up @@ -158,4 +158,4 @@ void TransmitTime() {

- The CommandStation-EX will now poll the FastClock to request the time. The frequency at which it does so is influenced by the clock speed (i.e. on a slow clock speed it polls less often).

Now that you know how to connect your existing FastCLock, click the "next" button see how you use EX-FastClock.
Now that you know how to connect your existing FastClock, click the "next" button see how you use EX-FastClock.
4 changes: 2 additions & 2 deletions docs/products/ex-fastclock/10-operation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

At startup the clock will calculate a start time based on either a) a coded start time (currently 6:00 a.m.) or b) a run time stored in the EEPROM (see item 2) below.

The clock will start in a paused state and will display the speed rate factor (default = x 4). Once any adjustemts have been made the clock can be started. The usage of the six buttons are as below:
The clock will start in a paused state and will display the speed rate factor (default = x 4). Once any adjustments have been made the clock can be started. The usage of the six buttons are as below:

1. **Start** - Pressing this button will start the clock and the button text will change to **Pause**.
2. **Save** - Pressing this button will pause the clock and save the current time and Speed Factor to the EEPROM. These figures will be used to initialise the clock on nextstartup.
2. **Save** - Pressing this button will pause the clock and save the current time and Speed Factor to the EEPROM. These figures will be used to initialise the clock on next startup.
3. **Reset** - Pressing this button will pause the clock and set the time to 06:00 with a speed factor of 4.
4. **T+** - Pressing this key will pause the clock and add 15 minutes to the time.
5. **T-** - Pressing this key will pause the clock and deduct 15 minutes from the time.
Expand Down
1 change: 0 additions & 1 deletion docs/products/ex-fastclock/15-timecontrol.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Time Control

## EXRAIL Commands
Expand Down