Chronulator commands

Tessellated Circuits: Home => Old Home => The Chronulator SMD => serial cmds  

The “secret” serial commands.

How to use the serial port:

(Note: this is also how to set up the ChronulatorSMD to be programmed as an Arduino.)

The original Chronulator kit was designed for low power and utility in the same board. The presence of a plug in the power jack is sensed by port pin PC1: if the plug is plugged in the input is pulled high, if the plug is absent the pin is low. In the latter case the software assumes it is running on a system powered only by a battery and both the serial port functions and any LED backlighting which may be wired in are disabled. Since there is no power jack on the ChronulatorSMD, the same function is supplied by a “solder blob jumper” SJ5. As shown on the layout page , this jumper is the only one on the top side of the board. The PCB is manufactured with a narrow track already connecting the 2 sides of the jumper which enables these features. If the track has been cut to get the longest maximum life from the battery but if the serial mode is now wanted, then a solder blob needs to be made to jump both sides of SJ5 again.

To use the serial port, a 5-way header needs to be installed at JP2. Just solder it in. (It can be on either side of the board. One neat choice is to use a right angle header on the bottom of the board pointing to the nearest, left-most, edge.) Then a logic-level serial port needs to be plugged in to it. The easiest USB to serial adapter to use is probably the Adafruit “FTDI friend” . Either set up the FTDI friend to power the ChronulatorSMD (either 3 V or 5 V, it doesn't matter) or open both power supply blob jumpers on it and power from your original power source. For the serial connection the RTS output does not need to be connected: if it is connected then the ChronSMD may be reset when you least want it to be.

Now use your favourite terminal emulator to talk to the board at 9600 baud. That's it.-

The original software's commands:

The original code has 5 serial commands: t, hv, mv, hl and ml. See the table:

Command Function
treturns both meters to showing the time of day
hvsets the hours PWM to xxx/255
mvsets the minutes PWM to xxx/255
hlsets the hours LED PWM to xxx/255
mlsets the minutes LED PWM to xxx/255
Note that all commands are case-insensitive

Command syntax:

Commands which require an argument only accept the syntax cmd=nn where nn is a decimal number. There must be no spaces between the command and the “=” sign, but one or more spaces are allowed between the “=” sign and the first digit of the number.

Added commands:

I changed the command software a bit (the changed code has not yet been made available) so that it echoes the characters that are received, and to add a few more commands which set the internal hours and minutes values directly. The later means that some external software could set the time, perhaps to an accurate source. I also added another command which returns the time of day, in ascii. These three commands could be used to check drift and calibrate the time of day.

Command Function
hssets the clock's internal hours number
mssets the clock's internal minutes number
qquery the time of day, answer on the serial line
If either the hv or mv command is in effect then
these values are shown as well
As above, all commands are case-insensitive

Additionally I modified some of the original commands:

Command Function
hvsets the hours pwm to xxx/239. The limit was
changed to protect the meters
mvsets the minutes pwm to xxx/239. The limit was
changed to protect the meters
As above, all commands are case-insensitive