Remote Target - TLM

The Target Link Monitor is a small, ~800 byte, program that allows the communication with the Host PC and implements multitasking. This small program is however self contained. It requires no further code to allow full modification and inspection of all the MSP430s resources.

This is all carried out by the word SERVER which is defined as follows:

: SERVER (S - ) BEGIN ADDR@ EXECUTE $A5 CHAR-OUT AGAIN ;

We must thank the University of Rostock, in what was East Germany, for this deceptively simple idea. The words ADDR@ waits for the Host to send two bytes of data, LSB first, to the Target stack. This 16 bit value must be a valid CFA, Code Field Address, of an existing Target definition. The word EXECUTE performs a BR to this address. The $A5 CHAR-OUT is used as an acknowledgement for the communications.

The basic TLM words are:

ADDR@, C@, C!, EXECUTE, PAUSE, @, !, , FLASH! , REG@ , SERVER, SP0, STOP, WORD>

With only these it is possible for SERVER to interrogate the MSP430 internals.

For example, if we wish to look at the current value of the SR register, we need to perform a REG@ and send the result to the Host for display. This is what happens:

  I/O 2 REG@ H. <cr>

Host sends CFA of ADDR@, EXECUTE runs it.

Host sends $02 (SR) which ADDR@ puts on Target stack.

Host sends CFA of REG@, EXECUTE runs it and REG@ fetches the value.

Host sends CFA of WORD>, EXECUTE runs it and sends result to Host.

Host displays the 16 bit value in Hex.

SP@ puts the value of the stack pointer, DP ,on the stack so using WORD> and C@ the Host may display the current Target stack contents. When in the Remote mode, .S does this function.

With C! the Host may modify MSP430 resources. This allows you to write Host programs that require no further Target code but that will exercise hardware external to the MSP430. This is very useful in development and production, to do initial testing

 

Contents