Add processor speed to the emulator configuration


From Jens Kuhner's Expert .NET Micro Framework:
Emulator Timing
This section covers the emulator timing and special emulator timers. For this, the .NET Micro
Framework SDK provides the Microsoft.SPOT.Emulator.Time.TimingServices emulator component
and its embedded classes. This section looks closely at these classes and shows how to
simulate a certain processor speed. In addition, it explains how to put tasks asynchronously
into the queue of the emulator to process. You will learn what continuations and completions
are and how you can use special emulator timers to simulate correct time intervals. Finally, you
will see how to implement a custom oscillator component for the emulator that toggles a GPIO
pin periodically.
Simulating the Processor Speed
The Microsoft.SPOT.Emulator.Time.TimingServices class possesses only one configurable
property—the SystemClockFrequency property for setting the clock rate of the processor in
Hertz. To simulate a processor at 32 MHz, you need to use the XML configuration in Listing 13-30.
Listing 13-30. Setting the Processor Speed
<?xml version="1.0" encoding="utf-8" ?>
Note that you do not need to specify a unique ID for the component, since the component
can be obtained in the emulator code via the TimingServices property of the emulator class.
If you do not specify a system clock frequency, the default value 27 MHz is applied. The
slowest processor on which the .NET Micro Framework is able to run is, by the way, exactly
clocked at 27 MHz.
Closed Oct 12, 2008 at 7:02 AM by purerobot


wrote Oct 12, 2008 at 7:02 AM

Resolved with changeset 4771.

wrote Feb 13, 2013 at 12:32 AM

wrote May 14, 2013 at 9:06 PM