Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Titan GPIO test port for Raspberry Pi
Titan GPIO test port for Raspberry Pi [message #1752909] Mon, 30 January 2017 14:36 Go to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 853
Registered: January 2015
Senior Member
Dear all,

Titan was born in an industrial environment and one thing that is frequently associated with is complexity:
it is executed in complex setups (server clusters), it is capable to mimic convoluted traffic mixes and data flows over
intricate telecom networks; it also has a steep learning curve as it requires the knowledge of a domain specific language plus the
knowledge of the tool itself.

This complexity may appear scary sometimes. If someone worked with NBAP or RANAP signaling, knows exactly what I'm talking about: an average NBAP message may easily fill 40-50 A4 pages
in regular (10-12) size font if printed.
However this is not necessarily the case; one may start with simple test cases requiring basic test ports (UDP, HTTP)
and simple code and can acquire the feeling of "flow" , that is, of success and joy of accomplishment.
To ease this, and to permit our users to play with Titan, we have produced a build for Raspbian/Raspberry Pi.
In continuation of this idea, we have also published recently a GPIO test port for Raspberry Pi, available at the below links

git clone git://
git clone

The port can be used to set a logical low or high value to any of the 27 pins of the GPIO if set for output,
or else read logical values form any of the 27 pins if programmed for input.
An instance of a port corresponds to a pin; an array of ports can be used for convenience.
The GPIO is described in detail here:

A piece of code to exemplify usage:

module GPIOTests {

import from GPIOPinPort all;

type component GPIO {
	port GPIO_Pin_Port gpio27; //single port declaration
	port GPIO_Pin_Port gpio[2..26]; //port array declaration
	timer t_short;

testcase TC_GPIOPinTests_all_off() runs on GPIO {
	log("Starting GPIO PIN port tests");
	log("Mapping port");
	//Map the port, this will export the gpio	
	map(self:gpio[11], system:gpio[11]);
	map(self:gpio27, system:gpio27);
	map(self:gpio[26], system:gpio[26]);

	//Set direction on the gpio to OUT
	var GPIO_PIN_DIRECTION gpio27_direction := OUT;

	var GPIO_PIN_VALUE gpio27_value := HIGH;

	t_short.start(1.0); //send a pulse of 1 second duration ; if a lED is connected, it will flash shortly

	gpio27_value := LOW;

	log("Start waiting for signal to appear...");

	var integer v_index;

	var GPIO_PIN_DIRECTION gpio_direction := IN;

	alt {
	[] gpio[26].receive {
	        setverdict(pass,"message received on port index 27");
	[] any from gpio.receive -> @index value v_index {
	       setverdict(fail,"unexpected message received on port index: ",v_index);
	[] t_short.timeout {
	       log("Timeout while waiting for input to change");
	//Unmap the port, this will unexport the gpio
	log("Unmapping ports");
	unmap(self:gpio27, system:gpio27);
	unmap(self:gpio[11], system:gpio[11]);
        unmap(self:gpio[26], system:gpio[26]);

control {


This code has been tested with LEDs and switches ( see picture),


but a similar code can be used to drive simple home automation circuits,
LEGO motors (with an appropriate driver which supports current etc. requirements), you name it; also, a language course exemplifying usage of TTCN-3 can be built around this setup. It's a low cost and simple alternative to get familiar with the language and with Titan.

Best regards


[Updated on: Mon, 30 January 2017 15:42]

Report message to a moderator

Re: Titan GPIO test port for Raspberry Pi [message #1752916 is a reply to message #1752909] Mon, 30 January 2017 16:06 Go to previous messageGo to next message
Gustavo Gonnet is currently offline Gustavo GonnetFriend
Messages: 34
Registered: October 2015
Location: Montreal, Quebec, Canada
Hey, this is very very cool!
thank you for posting it.
Re: Titan GPIO test port for Raspberry Pi [message #1752945 is a reply to message #1752916] Tue, 31 January 2017 07:37 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 853
Registered: January 2015
Senior Member
Hey Gustavo,

long time no hear.
Thank you for the good words.

Best regards
Re: Titan GPIO test port for Raspberry Pi [message #1752949 is a reply to message #1752909] Tue, 31 January 2017 08:19 Go to previous message
Lenard Nagy is currently offline Lenard NagyFriend
Messages: 26
Registered: September 2016
Junior Member
Just to be on the safe side and spare You from failing: The latest officially released version of Titan does not compile this sample code. To compile it You will want to compile Your own Titan from source on the Raspberry. The next official release will contain the modification and will compile this code.
Previous Topic:How do test systems evolve on the long run?
Next Topic:Using the address type in Titan
Goto Forum:

Current Time: Wed Nov 14 09:12:56 GMT 2018

Powered by FUDForum. Page generated in 0.02338 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top