User manual

25
9 Recovery of the Example Programmes
If you want to restore the controller's original condition after some time, this can be done by
entering two bytes FF. In fact, this corresponds to the condition of the unwritten EEPROM. The
firmware of the TPS controller contains a start function that initially reviews the first two
addresses to recognise an empty memory. If two FF-bytes are read here, the controller assumes
that no programme has been entered yet. In this case, the EEPROM is automatically filled with
the example software. This function actually serves to apply the controller with the example
programme in the EEPROM at the first start. However, it can be used at any time to restore
factory settings.
Address
Command
Data
Comment
00
F
F
-
01
F
F
-
Listing 8: Return to the factory condition
Start programming mode by resetting with the S2 button pushed. Enter the value F (decimal 15)
four times then, where all LEDs A1 to A4 are on. Complete the last input with S2 as well.
Then push reset. The controller needs just a moment longer than usual to reprogramme all
bytes from the example programmes. This restores the original condition. Test, e.g., the
alternating flash from page 8 without the jumper at the inputs.
10 TPS Basic Commands
The key-programmable control knows a total of 14 commands (114). Many of these commands
have a parameter in the form of a 4-bit number 0000 to 1111 (0F), i.e. with a number range to
15 (decimal). Other commands know subfunctions that are indicated as a parameter. A
command code may therefore contain up to 16 subcommands. For example, command 7 means
"Compute A = ...". The parameter indicates which computation function is to be performed.
Below, the commands and data are written together in hexadecimal code as one byte.
Command 1 together with parameter 4 thus becomes the command 14h. The hex sign is left out
because all commands and addresses are generally written in hexadecimal code.
The first three commands are:
101F: Direct port output at A1A4, 015, binary 0000 to 1111
202F: Waiting time 015
(1, 2, 5, 10, 20, 50, 100, 200, 500, 1,000, 2,000, 5,000, 10,000, 20,000, 30,000, 60,000 ms)
30–3F: Jump back 015
Command 1 is used for port output of a constant number. This permits outputting any bit pattern
and e.g switching on several LEDs at the same time.