Portable devices or small-sized electronic appliances used in the office or at home, such as refrigerators, cleaners, printers or flash memory cards, are equipped with middleware that cooperates with a real time operating system in order to control devices installed in the electronic appliances, such as motors, in real time.