Editing Alpha Clock Serial v2
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
− | The serial port on Alpha Clock Five is a "TTL Serial" type that is connected directly to the microcontroller. To interface with a computer, it is normally used with an FTDI serial interface such as the [http:// | + | The serial port on Alpha Clock Five is a "TTL Serial" type that is connected directly to the microcontroller. To interface with a computer, it is normally used with an FTDI serial interface such as the [http://evilmadscience.com/productsmenu/partsmenu/130-usbttl FTDI TTL-232R] or the Adafruit [http://evilmadscience.com/productsmenu/accessories/210 FTDI Friend]. Note that since the interface supports logic-level signals, it cannot be interfaced directly to a traditional RS232 serial port on a computer. |
The interface is normally configured for 19,200 baud, 8N1. | The interface is normally configured for 19,200 baud, 8N1. | ||
Line 20: | Line 20: | ||
== Daisy-Chained Serial == | == Daisy-Chained Serial == | ||
− | Alpha Clock Five features a second hardware serial port, located at location J5 on the circuit board. For daisy chaining, you can use a [http://shop.evilmadscientist.com/productsmenu/partsmenu/586 six pin SIL F-F header cable] to connect from J5 directly to the main serial port (J2) on a second Alpha Clock Five unit. Multiple Alpha Clock Five units can be connected together in this same way, to produce larger | + | Alpha Clock Five features a second hardware serial port, located at location J5 on the circuit board. For daisy chaining, you can use a [http://shop.evilmadscientist.com/productsmenu/partsmenu/586 six pin SIL F-F header cable] to connect from J5 directly to the main serial port (J2) on a second Alpha Clock Five unit. Multiple Alpha Clock Five units can be connected together in this same way, to produce larger yet alphanumeric displays. |
In revision B of the circuit board, J5 is located just below the middle chip, U2. Pin 1, where the "black" side of the cable goes is indicated by an arrow. In revision C of the circuit board, J5 is located below U3, on the lower right side of the circuit board. Pin 1, where the "black" side of the cable goes is indicated by an arrow. Pin 1 is also indicated as the ''square'' pin of header J5. If your kit did not come with a header at location J5, you will need to add one at that location in order to have a place to attach the cable. | In revision B of the circuit board, J5 is located just below the middle chip, U2. Pin 1, where the "black" side of the cable goes is indicated by an arrow. In revision C of the circuit board, J5 is located below U3, on the lower right side of the circuit board. Pin 1, where the "black" side of the cable goes is indicated by an arrow. Pin 1 is also indicated as the ''square'' pin of header J5. If your kit did not come with a header at location J5, you will need to add one at that location in order to have a place to attach the cable. | ||
Line 31: | Line 31: | ||
== Supported commands == | == Supported commands == | ||
− | Firmware version 2.0 supports | + | Firmware version 2.0 supports three serial commands: Set time (ST), Ascii display (A0), and Mode Time (MT). |
Each command consists of exactly 13 bytes: A single header byte (0xFF), followed by a two-letter command code and then 10 additional bytes of data. | Each command consists of exactly 13 bytes: A single header byte (0xFF), followed by a two-letter command code and then 10 additional bytes of data. | ||
Line 51: | Line 51: | ||
− | The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClock_SetTime) that can sync the time on your Alpha Clock Five to that on your PC. | + | The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClock_SetTime) that can sync the time on your Alpha Clock Five to that on your PC. To run the example sketches, download Processing [http://processing.org from processing.org]. |
− | |||
Line 75: | Line 74: | ||
Note that the decimal point protocol has been changed from that in firmware v1, for which the display characters were 'U', 'L', and 'B' for upper, lower, or both decimal points. | Note that the decimal point protocol has been changed from that in firmware v1, for which the display characters were 'U', 'L', and 'B' for upper, lower, or both decimal points. | ||
+ | |||
+ | |||
+ | The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClockv2_SendText) that can can display text on the Alpha Clock Five LEDs. To run the example sketches, download Processing [http://processing.org from processing.org]. | ||
To blank the display, you can send an string consisting of five spaces (" ") for both the ASCII and DP strings. | To blank the display, you can send an string consisting of five spaces (" ") for both the ASCII and DP strings. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 99: | Line 96: | ||
When Alpha Clock Five receives an A''x'' command on its main serial port (where ''x'' is not equal to zero), it relays that command out through its second serial port, decrementing it from A''x'' to A''(x-1)''. For example, suppose that two Alpha Clock Five units are connected together via their serial ports. Then, the command A1, followed by a text/decimal string, will be received by the first Alpha Clock Five and then sent to the next as an A0 command, so that it will display that text/decimal string on the second unit. | When Alpha Clock Five receives an A''x'' command on its main serial port (where ''x'' is not equal to zero), it relays that command out through its second serial port, decrementing it from A''x'' to A''(x-1)''. For example, suppose that two Alpha Clock Five units are connected together via their serial ports. Then, the command A1, followed by a text/decimal string, will be received by the first Alpha Clock Five and then sent to the next as an A0 command, so that it will display that text/decimal string on the second unit. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 122: | Line 111: | ||
− | + | B00: Set brightness | |
− | The display brightness is specified as a two-character ASCII string indicating the brightness on a scale of 0 to 11. The string must be exactly two characters long, and leading-zero-filled. For example, "01" and "10" are acceptable, but "1" and " 1" are not. The remainder of the data string | + | The display brightness is specified as a two-character ASCII string indicating the brightness on a scale of 0 to 11. The string must be exactly two characters long, and leading-zero-filled. For example, "01" and "10" are acceptable, but "1" and " 1" are not. The remainder of the data string should consist 7 additional bytes, which will be ignored. |
Example: (0xFF) followed by "B0011*******" will set the brightness to maximum. | Example: (0xFF) followed by "B0011*******" will set the brightness to maximum. | ||
− | + | B01: Set number character set | |
− | Alpha Clock Five features 10 built in number font styles, that you can choose between. The character set chosen is indicated by a single ASCII character in the range '0' to '9' that follows the | + | Alpha Clock Five features 10 built in number font styles, that you can choose between. The character set chosen is indicated by a single ASCII character in the range '0' to '9' that follows the B01 command. The remainder of the 10-byte data string should consist of 8 additional bytes, which will be ignored. |
Example: (0xFF) followed by "B014********" will select number font style number 4. | Example: (0xFF) followed by "B014********" will select number font style number 4. | ||
− | + | B02: Edit font character | |
− | The shape of any character in the font table | + | The shape of any character in the font table, which again spans from " " (space, ASCII 32) to "e" (lower-case "e", ASCII 101), can be edited with the B02 command. |
− | |||
− | + | ==== B''x'': Set Parameters (Daisy-Chained) ==== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==== MT: Mode Time ==== | ||
− | + | The MT function is used to resume normal display mode-- typically showing the time --after command A0 has been issued. | |
− | A | + | The full command consists of 13 bytes, as follows: |
+ | * The header byte, 0xFF | ||
+ | * The command MT | ||
+ | * A 10-character string (the contents of this string will be ignored). | ||
+ | Please see the Sample Programs section below for an example program that displays characters with A0, and then uses MT to display the time again. | ||
− | |||
− | + | == Sample programs == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment. Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==== AlphaClock_SetText ==== | ||
+ | Download this file [http://evilmadscientist.s3.amazonaws.com/source/alphafive/AlphaClock_SetText.pde here] (2 kB .pde file). --NOT YET UPDATED FOR v2. | ||
− | |||
+ | When you run the application, it presents a window. Click your mouse in the window to alternately display a text string ("ALPHA", plus some added decimal points) and to resume clock display. This demonstrates the use of the A0 and MT serial functions. | ||
+ | Note that you may need to edit the file to select the correct serial port, defined by the "portIndex" variable, in order to select the serial port where your clock is attached. | ||
− | |||
− | + | ==== AlphaClock_SetTime ==== | |
− | |||
− | |||
+ | Download this file [http://evilmadscientist.s3.amazonaws.com/source/alphafive/AlphaClock_SetTime.pde here] (2 kB .pde file). | ||
+ | When you run the application, it presents a window. Click your mouse in the window to set the time on the clock to your present computer system time. This demonstrates the use of the ST function, and also provides an accurate way to set the display time. | ||
− | + | Note that you may need to edit the file to select the correct serial port, defined by the "portIndex" variable, in order to select the serial port where your clock is attached. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Line 215: | Line 181: | ||
The listed function names are reserved for use in future firmware. If you extend the firmware with additional serial command functions, it is strongly advised that you do not use the following function names: | The listed function names are reserved for use in future firmware. If you extend the firmware with additional serial command functions, it is strongly advised that you do not use the following function names: | ||
− | * SA (May be used for Set Alarm time in future firmware) | + | * B* (B, followed by any character) |
+ | * SA (May be used for Set Alarm time in future firmware) | ||
+ | * SB (May be used for Set Brightness in future firmware) | ||
* M* Where * is in the range 2-9. (May be used for mode setting in future firmware) | * M* Where * is in the range 2-9. (May be used for mode setting in future firmware) | ||
* TP (May be used for producing sounds in future firmware) | * TP (May be used for producing sounds in future firmware) |