Archive for April, 2005

Win CE : More graphs etc

April 3, 2005

Refined to code to allow for when ticks counter rolls ove (low part, ie increments high part)  between LPT2 interrupt ISR and IST.  This was creating superiously large results, actually very negative ones because the timing uses the lower part of the ticks counter only.

Added some more refned graphs and sorted latencies on size so that you can see teh distribution of IST latency.

Windows CE Real-time: Got it to work

April 2, 2005

ie I now can use LPT2 as the source of interrupts instead of timer ticks.

Can’t measure ISR latency (see previous discussion) by via CRO this is about 7 us.
Timertick ISR latency is about 2.5us from ilTiming.

LPT interrupt ISR to IST latency is about 58 us min, where as
Ticks latency for this is about 46 us.

ie There is about 12 us difference.  Possible reasons:

  1. The code in PeRP( ) that handles all ISRs initially takes longer to get the part for LPT2
  2. LPT2 requires further calliing down hardware chain from PeRP( )

See the attached graphs.

Of interest is there are clearly 3 to 4 interrupt scenarios each taking a different time ISR-IST

eg LPT2 58 , 64, 72 and 88us
Ticks has the same but shifted down by about 12 us.

Win CE Qs 1 to 4

April 2, 2005

Many of these have been gleaned from Paltform Builder NG.

Thanks for the entries by others.

  1. (Q) I have an nk.bin image created elsewhere (ie no source).
    Is it possible to use Platform Builder to launch that image?
    • Yes, File/Open Workspace -> select the nk.bin file as the workspace.
      [Bruce Eitman (eMVP)]
  2. (Q) I have an nk.bin file (ie an image file) without source.  How do I view the contents of the image file?
    • Use "Viewbin.exe" .It allows you to analyze nk.bin files.
      Find it in %root%\public\common\oak\bin\i386
    • viewbin <options> nk.bin
      If you run viewbin without any arguments, you will see the list of options.
      [Bruce Eitman (eMVP)]
    • You can use a utility called VIEWBIN.EXE.
      Also, ROMIMAGE.EXE constructs the NK.BIN file by using the contents of a
      file called CE.BIB, so looking at that file should give you a pretty good
      idea of what is included in your ROM image NK.BIN.
      [Michael Schaffner, P.E]
  3. When I installed PB I chose x86 and XScale (not Armv4i)
    The July Sept QFE for CE5 has X86 and ArmV4i only.
    Should there be an XScale update or what? 
    • XScale and ARMV4I are the same thing.  I think they put XScale in as a
      placebo for those who don’t know better, and think the OS doesn’t support
      that processor family…
      [Dean Ramsier – eMVP]
  4. I have an ICOP eBox.
    They are quite useful and compact devices but it has no CF slot.
    Has any one developed a USB WiFi Driver for any such device for CE5?
    Alternatively I can use a wireless to ethernet bridge such as the DLink 810+
    but I’d prefer to use a USB adapter.
    • No replies to this.  As I understand it there is no USNB wireless driver for Windows CE.
    • There is no USB webcam drivers for Windows CE.
    • I feel very strongly that there is a need for both.

Windows CE Real-time 3(A)(The NG discussion)

April 2, 2005
The NG Discussion
(Thanks Steve and Karel)

ILTiming uses the System Timing Ticks (1000 per sec, but you choose how
to generate an ILtiming interrupt, default 5.)
(Q) Is it possible to use another source, eg IRQ 5= LPT2 Interrupt?

I note in iltiming.c that the code has calls such as

if (!InterruptInitialize(SYSINTR_TIMING, hEvent, 0, 0)) {

In some other code, SYSINTR_TIMING is made equal to the system interrupt

number for an IRQn IRQ5.
In the iltiming.c code it is not defined. In one of its headers it is
defined as follows:



(Q) So would it be possible to replace SYSINTR_TIMING with a lookup of
IRQ5 (to a system int no.) and use that instead?

You’ve got the source to both the OAL and ILTIMING application code so
theoretically anything is possible. But the real question is why do you
to do that? It’s already written to use the timer? It doesn’t matter
interrupt is used, nor even the rate that it fires. What matters is the
timing measurements.


I want to compare the RT performancefor CE as per iLtiming against that
measured by external devices. I’ve set up a testbed a bit like that
used by
Maarten Struys (See MSDN library "Real-time Behavior of the .NET Compact

Framework"). I then want to see system perforance under load, esp. with

I am working on a version of iLtiming that will alow the interrupt to be

specified at command line along with some other output options.


No, as ILTIMING is measured it must be system timer. On other interrupts
can only measure ISR to IST latency. So you will miss interrupt to ISR

I can live with that.
I will put a hw pulse at the start of PeRPISR() in fwpc.c and time
my incoming hw interrupt.

David Jones
Senior Lecturer
School of Electrical & Computer Engineering
RMIT University
+61 3 99255318
"Your calculations are correct, but your physical insight is
-Einstein to Lema’tre Re: His theory of expaning Universe (Big Bang)

Windows CE Real-time 4: Terminology

April 1, 2005

When a an interrupt occurs, there is a hardware source.  With  a PC system these can be:

Timer Ticks, LPT1 or 2, COM1,2,3,or 4, PIC2 etc 

See pc.h  I added LPT1, LPT2, COM1 and COM2 as #defines 6,5,4,3 respectively.
eg #define INTR_LPT2   5

When an interrupt occurs a handler called and ISR (Interrupt Service Routine) fires up.  Its latency is probably mainly hardware but also will depend upon how long thecurrent thread takes to yield.

When an interrupt is configured by sw for use, a thread, the IST (Interrupt Service Thread)  is created along with an event.  The thread is largely a loop; but blocks at start of the loop waiting for that event.  The event is triggred by the ISR.

This allows for the fast handling of interrupts at a high priority but the sw in configuringthe priority of the IST thread ultimately determines the priority of the repsonse to the interrupt.

Windows CE Real-time 3

April 1, 2005

I had posted a query related this on the Paltform Builder NG:
Do a search on
David Jones
and choose the topic "ILTiming: Interrupt Source …"

Steve Maillet indicated what I thought might be the situation:  The timing as measured by ilTiming., although actioned by CE software (albiet at a low level), does do an insitu measurement of of interrupt latencies and that the timings are same regardless of the interrupt source.  ilTiming uses system timing ticks as the interrupt source (1000 high speed timing counts which are running at about 1 MHz).  [iltiming in its report indicates the period of these ticks.]

Karel Danihelka indicated that timing ticks must be the interrupt source as ther is no other way to measure the ISR latency.  (I need to explain ISR and IST latency (later).

Mu intention is to compare the iltiming with real hardware timing.  I can now generate a a hw pulse at the start of the ISR and can do so at the start of the IST.  I can then compare both to the interrupt source (I intend using LPT2) on external hw, eg a CRO.

Windows CE Real-time 2

April 1, 2005

I now can "see" what is the interrupt source.

I set a bit on LPT1 depending upon the source, for a short period.

In the same function as previous.