Tampere Technical Aid, Well-being & Home Fair 10-12 Nov 2011

Tampere Technical Aid Fair was held 10-12 November at Tampere Exhibition and Sports Centre. My visit to this fair was really an eye opening experience for me. I have been thinking a mobile phone (Apple, Nokia etc.) or similar gadget to represent state-of-the-art high-tech. But after visiting this fair I know better. A tiny-tiny hearing-aid from Denmark has an body-internal network; a signal processor, an amplifier and a microphone — all contained in a tiny hearing aid with 3D printed circuit technology! Check out the image gallery from the fair and just wonder how the technology can help people with different problems and difficulties.

Technical Aid Fair at Tampere

Visitors examining gadgets for visually impaired at AVIRIS stand

Posted in research, startup-world | Leave a comment

Side-effect programming: a MIDI-based electronic music generator

Electronic MIDI-music generator source code

An interrupt routine reads A/D value and converts the value into a MIDI code

Sometimes a very simple program can generate interesting results.  I have discussed the concept of “side-effect programming” (SEP) in a previous post so I don’t repeat the stuff here. Instead I show a practical example of SEP: a MIDI-based electronic music generator.

The example system is composed of an ATM18POC-board, an Atmel SAM2195 single-ship-based MIDI synthetizer and a Tektronix 3102 signal generator. The ATM18POC software converts the signal generator signals into MIDI USART-messages. An example of the resulting music is available as a mp3-file from here.

The most interesting part of the source-code for the “Strange MIDI electronic music generator” is shown in the picture.

A basic question we should ask when we look the source-code: where is the music? And how is the “music” controlled? Is the music any good? The answer to all these questions is ofcourse the SEPs. And it is interesting to note – I try to proof my case here.. – that *all* software *requirements* as seen by the end-user (=listener of the music generated) are given in SEP-language!
My list of side-effects in the program-fragment are:

  • The miracle transformation of USART-messages into acoustical waves. This is an OUTPUT-type SEP.
  • A miracle change of a memory location ADCH when in the interrupt routine. This is an INPUT-type SEP.
  • A miracle of the interrupt routine to be called at all. And here we see the TIME-SEP in action.

A SEP is – by definition – something that happens outside the software – in the real world. So my final comment is: why we describe computer programs using “non-SEP” languages when everything we think,want,test,code,try-hard etc. is to get SEPs into the external world? We need to develop a programming language where the SEPs (=end-user requirements) are taken care in the code-level too!

Posted in AVR, research | Leave a comment

A milestone

A milestone is something that you work hard to achive and you feel something special when you achive the milestone.

TCG has now reached a milestone in 2011: we have created our first real embedded hardware design ATM18POC.  ATM18POC is an 8-bit Atmel ATmega-based design for doing R&D experiments in energy harvesting ubiquitous applications . I also plan to use it in side-effect-programming experiments.

TCG has done deep background litterature research (thanks Waleed!) in ubiquitous computing and now I feel it is time to put the theory into good work.

ATM18POC

ATM18POC is based on Atmel ATMega-processor. Main applications for this board are in energy harvesting R&D and code generation research.

After ATM18POC there will be most exciting R&D journey into land of energy harvesting.. What is energy harvesting? It is the field near magic: we harvest and store energy from various sources, e.g. heat-differences, sound, light, electromagnetic disturbances. The goal is to get rid of the batteries or cabels in ubiquitous applications. The application runs when there is energy and otherwise the device is in deep hypernation. Stay tuned the next milestone is more exciting than the first!

Posted in AVR | Leave a comment

Nordic long-distance skating

When in Rome do what the Romans do. In North; you must do long-distance skating on natural ice. This year the season started unusually early, 28.11.2010; check the picture. The thickness of the ice is about 7-8 cm and you *must* wear safety-gear to safely glide over the next-to-heaven-on-earth-ice.

The official skating-club web-pages are located at: http://www.skrinnari.fi. On Skrinnari-pages you can find more information about this dangerous but so-cool (and yes, very cool) winter sports! A-most-do for anyone doing a startup in North.

Posted in Uncategorized | Leave a comment

ArcticStartup is Getting Real with Seth Godin

The moments when you really find something inspirational in the web are getting rare nowadays. But luckily there are real gems out there. Here is my list of real inspirational sites for start-up-minded people:

  • http://www.arcticstartup.com: This site is about the emerging start-up-community in Nordic-area including Baltic. Really good place to start when in start-up mood especially if you are located north of everything.
  • http://37signals.com: Check out the “Getting Real” pamphlet about web-application development. It *will* change your way of working.
  • http://www.sethgodin.com/sg/: Seth Godin’s blog-writings are a must-read for anyone in/on/out/of a small-business. I am always amazed how simple and doable Seth’s ideas are like: “ship it”.
Posted in startup-world | Tagged | Leave a comment

What type of side-effects are there?

As explained in previous posts; a side-effect (in my notation) is something that happens outside the domain of a computer or computer program.

Here is a short list of side-effects with short explanations:

  • time. Time is something that a computer program can not change or control. The time value is only read from some register and next time you read the time value it has changed.
  • memory (i.e., storage, persistency). This is more hard to crasp. A memory location stores over time something. When you write “42″ into a register and later read the value, the expected result is “42″ again. The side-effect nature of memory comes from the fact that  the “storing process” or “storing functionality” is outside the domain of the computer. Not every register carry the value over time; some registers do. With memory we move into a multi-dimensional space where the location of the memory is specified by its coordinates (= address) and time.
  • output kind of physical phenomena. This side-effect is easier to handle; a light-emmiting diode (LED) emmits light when a specific value is written into a correct register.
  • input kind of physical phenomena. These correspond to push-buttons, mouse movements, 3D hand tracking devices etc. Nothing happens in a computer program unless an external force or action is causing an event to be fired.
  • composite side-effect. Any combination of the previous ones. A parallel LED-side-effect might show a picture or movie of a horse on a LED TV-screen.
  • abstract side-effect. This is most probable the nearest to classical computer science side-effect definition. A specific value/structure/object/thing within a program has a surprising and non connected usage outside the domain of the current program.
Posted in research | Tagged | Leave a comment

So what is a side-effect anyway?

So what is a side-effect? To me a side-effect is a phenomena that happens outside the domain of a computer program. Figure 1 explains this idea.

Figure 1. A basic side-effect within a state-machine transition from state S1 to state S2. The side-effect is "emmited" when the state transition is done.

Figure 1 shows a basic side-effect that is emmited when the state machine transition occur. The computer is not aware that this side-effect is occuring. Why? Because, by definition the side-effect is something that happens outside the domain of the program. An example will clarify the concept.

Example
An embedded microprocessor is connected to a light-emmiting diode (LED named LED2) with a connection shown in Figure 2. The LED2 will turn on, if the output line PD0 is set to one (1). The LED2 will turn off if a value zero (0) is set to the line PD0.

A LED connected to an embedded-processor

Figure 2. A light-emmitting diode (LED named as LED2) connected to a microprocessor bus signal named as PD0.

Now a code fragment that turns the LED2 on is below.


...
/**
* Turns on LED2
* @return Returns The answer to life and universe and everything.
*/
int turnOnOnlyLED2()
{
int theAnswer = 42; // Thanks Douglas Adams; we know the answer!
PORTD = 0x01;
return theAnswer;
}
...

By looking the code we can observe couple of things about side-effects:

  1. The computer program can’t differentiate a side-effect cousing action from a normal registry operation like writing to a register x in the shown code fragment.
  2. The operation of the LED2 is totally and completely isolated from the code fragment. The code does not contain any glue that a surprise of green LED turning on is happening.The operation of the LED2 in physical universe is totally and completely isolated from the code fragment.
  3. The owner of the embedded system does not talk codish; The owner talks “side-effectish”; or how she wants to see a LED2 turning on. Thus all *requirements* the owner is stating in requirements management systems and Scrum-meetings and where ever are about – you guess now already – The owner is interested in only about side-effects.

So what side-effects are there? Here your list is as good as mine. Here is my short list:

  • Any physical phenomena that happens due to a computer operating is a side-effect (both input and output type of side-effects). A side-effect can be a simple like turning on a LED2 or as complex as  a complex video game in your game console.
  • Time is a side-effect. I will come to this later post.
  • Memory is a side-effect based on Time-side-effect working on a place

So now you know something about side-effects. I will try to develop some ideas how a computer program can be generated directly from user side-effect speech without intermediate representations. Hey that sounds impossible to do. Yes – it is.

Posted in research | Tagged | Leave a comment

Side-effect programming

Side-effect programming (SEP) is a programming paradigm that has long been in my mind. SEP and more specifically AI-driven SEP (AISEP; hm.. the acronym is not very sexy..) is something I have been thinking of.

The idea/problem that leads to AISEP is as follows; I will use an 8-bit AVR evaluation-kit as an example here.

A Requirement by a stake-holder (beef-owner, program-owner, scrum product owner): “I want to see a green LED in channel B position 1 turning on when I press a push-button connected to channel C position 0.”

Now after the Requirement has seen the light and been stated out; in classical programming metaphors like waterfall/scrum/iterative etc., the requirement is trans-coded into something else (UML,word-document,heroic-program sweet dream); you name it. Based on this trans-coded intermediate requirement representation, a programmer will create a program (and unit tests and regression tests and…) that implements the code. Fine.

Why I don’t like this pattern of creating software? Here are my list of issues:

  • The connection between requirements and implementation goes through intermediate representations
  • The final code is not connected to requirements. The requirements management system could help here, but I want more direct connection
  • Any line of code must be able to answer a question: “Why you are here?”
  • If a change to requirements is made, the whole programming process must be started again and again we loose sight to code + requirements.

In AISEP-world the example would go like this:

  • An AISEP code-generator would ask the beef-owner: “What is your platform”? The answer is “AVR-evaluation kit”
  • The AISEP would continue: “What you want to do with the kit?” Answer: “I want to see LED1 go on when I press BUTTON0″.
  • The AISEP would state: “Nice, but there is no BUTTON0 in your platform, do you mean BUTTON2?”. Answer: Yes.
  • The AISEP goes on: “Anything else?”: Answer: No..
  • And this would *generate* the code.. Any line of generated code is directly connected into the above questions. The critical observation here is that the AISEP is making questions about side-effecs. The grand theory of SEP is that only side-effects matter. No more is needed; if we collect every side-effect for a system, the whole system can be generated out of this side-effect collection.

More about this in future posts.

Posted in research | Tagged | Leave a comment

Infotech Oulu

I just got a document called “Infotech Oulu Annual Report 2009″. Browsing this quite “annual-reportish” document I wonder what is this “Infotech Oulu” anyway?

…Infotech Oulu is an umbrella organization established by Oulu university in 1996… …The main research ares of Infotech Oulu are:

  • electronics
  • communications engineering
  • computer science and information engineering

According to the annual report, Infotech Oulu organizes quite interesting “Oulu Distinguished Lecture Series on Ubiquitous Technology”.

The web-site of the Infotech is here: http://www.infotech.oulu.fi/index.html

Posted in research | Leave a comment

Elektor-magazine AVR-board starts to run

Elektor-magazine published a very readable Atmel AVR article with detailed instructions how to build a working AVR-board with Atmega88 processor (ATM18-board, elektor 4/2008 ). I ordered the kit from the Elektor reader-service and so my humble task was to assemble the parts and create a program using my AVR tool-chain (I will document the AVR tool-chain in a future blog-entry). The feeling of constructing the hw and creating the embedded software and getting it running is once again something you don’t feel everyday in enterprise computing world. Embedded programming has something more in it!
I will leave you with a picture of the AVR running with all LEDs blinking happily in sync with a signal generator. The scope is Tektronix MSO 2024 and signal generator Tektronix AFG 3102.

An Elektor-article-based AVR-board is running inan A/D conversion test.

An Elektor-article-based AVR-board is running in an A/D conversion test.

Posted in AVR | Tagged | Leave a comment