User Manual

GAMMA instabus
Release: 12/2015
Application Program Bus Interface Modules M130, M131, M132 and M135
Runtime Environment for KNX-Processors 184/11 and 184/21
Siemens AG pages 17 Technical Manual
Building Technologies
Control Products and Systems
P. O. Box 10 09 53, © Siemens AG 2015 page 5
D-93009 Regensburg Subject to change without further notice.
2 Task switch system
To allow the implementation of the user application program in an endless loop the operating
system provides a simple task switch system, that interrupts the user application program
every 3.3ms for one complete system cycle.
The ‘TESTPIN2’ on the evaluation board is logical one while the user application is running
and logical zero after it was interrupted. The macro ‘FORCE_TASKSWITCH’ can be used to
force a task switch immediately, the macro ‘DIS_TASKSWITCH’ to disable the task switch
and ‘EN_TASKSWITCH’ to enable it again. The task switch should only be disabled in critical
sections, for example on access to communication objects that are larger than one byte.
Normally at the beginning of a task switch interrupt all processor registers are saved on the
stack and restored before the ‘RETI’ command is executed. This is not done here, because
the Renesas 78K0 microcontroller has 4 times the complete set of processor registers (AX,
BC, DE and HL). The actual register set is stored in the processor status word that is pushed
on the stack of each task.
AppInit()
user cstartup
main
loop
of the
user
appl.
3.3ms
3.3ms
3.3ms
One
system
cycle
User application
program
Operating
System