Archive for December, 2007

Remote Debugging (Managed Code)

December 19, 2007
I just revisted this issue.  (See my previous bloggs on this).
Created simple project in VS2005 called fred
Create share called share on target called sata (Security setting open as possible.  fw turned off!)
Copied the Remote debugger dir from VS2005 (Program files, under Common IDE) to the share
When I ran msvmon on target I got a prompt to change local security setting as follows:
Network Acess: Sharing and security model for local accounts , to , Classic Local User authenticate as themselves
Did this
In the project properties in VS2005 I set:
The build dir to \\sata\share on Compile tab
On Debug tab:
"Start External Progarm"  \\sata\share\fred.exe
"Working dir" \\sata\share
-[Tick] "Use Remote Machine" administrator@sata
PS Was logged as administrator (with same password and in in same Workgroup) on both machines.
I was getting  failure to connect.
So enabled everyone in the debugging permissions vis MSMON
Connection registered on target when I tried to rerun (Debug) but failed:
Message on dev machine that was similar to when I tried to MSVMON.
I had to do the same local security setting on the dev machine!
And it worked
.. Wala

Microsoft® Windows® XP Professional for Embedded Systems Service Pack 2c

December 12, 2007

Hot off the press:


Microsoft Windows XP Professional for Embedded Systems SP2c Available the

Week of December 10, 2007

Microsoft® Windows® XP Professional for Embedded Systems Service Pack 2c (SP2c) will be available the week of December 10, 2007 via the Mobile & Embedded Communications Extranet (ECE).

Due to the ongoing popularity of Windows XP Professional as a robust and stable operating system, the inventory of product keys has been reduced to the point where it is necessary to add more keys in order to avoid impacting end users of Embedded Systems. These are the product keys that are printed on the Certificates of Authenticity (COAs) affixed to Embedded Systems preinstalled with Windows XP Professional for Embedded Systems.

To address the shortage of product keys, MS has released SP2c which expands the product key range to support distribution of Windows XP Professional for Embedded Systems through end of life which is currently planned for December 31, 2016.


Weekly Summary Contents

This week’s ECE Weekly Summary announces the availability date of Microsoft® Windows® XP Professional for Embedded Systems Service Pack 2c and updated Additional Licensing Terms for Windows® CE products. Business letters and important alerts from the ECE calendar are also included

Solid State Switches – Zero Crossing

December 12, 2007
I spent today building a prototype microcontroller system to control the power supply to an incar computer system.
The system takes battery, ignition, door lock etc as inputs.
It outputs PC power switch, PSU control signal and audio blanking with processing based upon the inputs with delays.
I am actually using a Basic Stamp Proff. Dev Board because  Rapid Prototyping is easy with it.
(Parallax have doen a nice job on their web site recently)
Intend to go to PCB later with, say, a PIC micro.
I had an earlier system based upon reed switches and ULN2003A (Darlington Pairs switches) as current driver for the relays and outputs back to the car.
For this version I intended to use SSRs (solid state switches) but I spent a couple of hours chasing my tail!
I didn’t have a data sheet and couldn’t find one so I assumed input meant that and output meant that.
Could find the part no. with any internet search engine.
Jaycar, the supplier did not have any data sheets, or link to.
5V Reed Swich CAT. No. SY4030
12V Reed Switch CAT No. SY4032
12V Relay Cat No. SY4052
5V SSR Cat No. SY4088
I’ll post the datasheet linkas as comments below
I eventually found the data sheet by reducing the training characters on teh part no. until I got a match that made sense .. and a supplier.
I then drilled into the supplier’s web site and found it, including a matching picture!
(I used this approach later for some reed switches  as well with success).
On reading the documentation and a bit more Wiki sluething the cause of my problem was this:
– The SSRs were AC SSRs with Z
– This means that they don’t switch after the input logic enables the output until the voltage across the output is zero!
– This won’t happen with a DC voltage !!
– This makes sense of course
So I went back to using reed switches (5V versions) .. Next problem!
Do I need to use a current sink device to power the control circuit of the switch?..Look at the data sheet stupid..if you can find it.
It says that they can be driven by TTL levels, so I was possibly in luck.
I tried this, by driving the reed switches directly from the microprocessor outputs  .. It worked!
My system was instantly simplified
Next I wanted to isolate the power supply from the battery (12V) when the computer is fully turned off (One original reasons for using the multi-amp SSR in teh first place.  I implemented this with a 5A load relay that needs to be driven with 12V (actually 9-15V).  This I drove from a current switch using the input to board’s voltage regulator. .. And it all now works
Tomorrow: Make it all work with the computer incar!
Notes: The Computer runs XP Embedded with HORM
The power supply is M3-ATX device

Every contient covered!

December 4, 2007
I’ve now got vistors (since April) from every continent except Antartica!

More on tracing

December 4, 2007
I created a range of code snippets (C#) to embedd tracing based upon the f.NET ramestack.
This makes it a lot easer to insert tracing.
eg  t-r-a-tab-tab  to insert a trace at a certain line.
Certain snippets handle the class declaration  t-r-d-e-c-tab-tab
Note that to expand code snippets you type its key and tab twice as above.
I wrote my snippets in XML as per the VS help.
Then I placed them in my VS folder under My Documents, Code Snippets sub folder-C#-MySnippets
eg C:\Documents and Settings\David\My Documents\Visual Studio 2005\Code Snippets\Visual C#\My Code Snippets
A sample snippet
The filename doesn’t matter except that it has to have the file extension .snippet (even though its XML)
<?xml version="1.0" encoding="utf-8"?>
 <CodeSnippet Format="1.0.0">
   <Code Language="CSharp">
    <![CDATA[dbg.traceExit( new System.Diagnostics.StackTrace(true));]]>
The CDATA can be spread over several lines.
I’ll refine this and publish it soomewhere.
PS: I ended just using MessageBoxes in the embedded copde though!

Debug: Trace Capability added

December 1, 2007

I’ve added some formal tracing capability to the class.

To call the method trace (eg dbg logit class instance) : 

dbg.trace( new StackTrace(new StackFrame(true)));

//Don’t call this, used by trace method
private void traceLog(String message1, String message2, String message3, String message4, String message5, String message6)
            if (!db) return;
                if (_db) tw.WriteLine("TRACE: " + (_traceIndex++).ToString() +
                    message1 + " " + message2 +
                     message3 + " " + message4 +
                    message5 + " " + message6);
            catch { }


        /// <summary>
        /// Call: 
        ///  trace( new StackTrace(new StackFrame(true)));
        /// Explanation:
        /// Place the call as above, in the line that you want to trace at.
        /// Will log filename, linename and current method
        /// Requires:
        /// using System.Diagnostics;
        /// </summary>
        /// <param name="st">Tackframe object instance</param>
        public void trace(StackTrace st)
            // Display file, line and method nameinformation, if available.
            //trace(new StackTrace(new StackFrame(true)));
            StackFrame sf = st.GetFrame(0);
                " File: ", sf.GetFileName().ToString(),
                " Line Number: ", sf.GetFileLineNumber().ToString(),
                " Method: ", sf.GetMethod().ToString()