Tutorial: Building a Mainloop Application (Step 5)

Starting the Simulation

In order to test your application, you need to start the simulation in the redBlocks Simulator and start the application from the redBlocks Workbench. Then you can issue the commands '0', '1' and 'f' in the redBlocks Simulator's terminal and check the Led behavior and logging output in the redBlocks Simulator.

Note the toggling AwakeLed in the Oscilloscope control as long as a software timer is active. When the software timer is switched off, because the Led is set to constant high or low, the AwakeLed is only switched on for a short moment, when a command is received. Hence, this example also demonstrates, how you can gather information about the energy consumption of your application while running your application within the redBlocks Simulator.

 

Screenshot Simulator XMC2Go Running

 

Up to now we have only dealt with rather trivial application functionality and simple peripheral interfaces like digital inputs and outputs. With the redBlocks toolkit, it is possible to model the behaviour of any hardware device. Have a look at the example VendingMachine that is preinstalled in the redBlocks Workbench workspace. There, the application level functionlity is distributed over several application modules and more sophisticated peripheral hardware is used in the simulation environment.

While it is a great benefit to work on the host during application software development and for developing automated tests, the application must be integrated on the target hardware at some point. The next tutorial shows how to integrate the HelloMainloop example on an XMC2Go target.