Turnkey Operation

At some point in your application development it is necessary to run the code directly from Reset. There are two ways this may be done;

The first is the way that a final system should be compiled. The second is useful in testing as the vector may be reset to $FFFF with;

after the operation has been tested but without having to REPROGRAM. Also RUN <name> may be used to test an individual section of your code. The word used by RUN would be compiled to set any variables, ports, etc. and would then execute your code. RUN places the address of this test routine into $01,$02 of the EEPROM, tri-states the SCK, MOSI and MISO pins from the programmed and Resets the Target CPU. When reset the TLM initialises the Target and runs the test routine from the vector placed in the EEPROM. The RUN command invites you to press the ESC key to exit. This resets the EEPROM vector and does a ?REM to get back to interactive development. Any other key will exit without resetting, which will leave the code in a turnkey mode. Any ?REM or reset will run the test code until the EEPROM vector is reset.

IS-APPLICATION performs the same function as RUN but also creates a JMP to the application code address at code address $0000.

This should be placed at the end of you code to create a turnkey system.

NOTE: It is necessary for the application code start to set up the MAIN-TASK and Forth registers before running the high level code. See MAIN in TLM.

NOTE: It is possibe to get into a lock-out situation if your test or application code uses the development UART port, as with the muli-tasking demo. Here the ISP will not enter the program mode because there are characters being sent back by the running application. To fix this use the following;

NEW-APP is a mark at the end of the TLM compilation. When developing code it is possible to forget back to the end of the TLM and erase ready for a new or modified application load. You may use (name) <MARK> to place a mark anywhere in your application. When the (name) is executed all will be erased back to that point.