Posts by dhovden

    We are not using the SKIT but are building our own custom board. For touch, we use I2C1, pins 32 and 33 on J1.


    Is this how it should work; we specify I2C as device in the registry and we specify the irq and RST lines, with that fs_touch_edt.dll knows enough to talk to the FT%406 touch controller - correct?


    if so, a number of questions: should the ChangeIO and ResetIO be specified in hex or decimal?


    the i2C data goes low at reboot and stays ow, why is that?


    Even without reset, shouldn't we see CLK and DATA activity? Because we don't

    Thanks for the reply, useful (and gives hope) but a bit cryptic for me ...


    In the registry, at key Drivers\Builtin, I see three Touch entries:


    Touch_EDT
    Touch_MXT224
    Touch_SX865X


    By default, EDT and MXT224 are disabled (Flags=4) and SX8655 (which is a resistive controller) is enabled (flags=8)
    I don't know what the other two are but since it's an EDT screen I enabled the Touch_EDT entry by changing Flags to 8
    But still no touch so I tried the last one, the MXT224 but still no luck, no touch.


    Looking at the documentation for the ETM070001ADH6 screen, the touch controller is a FT5406, none of the three found in the registry.


    So, more questions:


    * Does it matter whether I use Window CE 6 or EC 2013?


    * Am I changing the correct registry keys (in Drivers\Builtin)? Which one should be enabled and what should Flags be set to?


    * The registry entries for the Touch modules mention I2C3 (for key I2CDevice) but what is that? On the port map for the A5 I only see two I2C entries, 32&33 and 30&31


    * Display uses default settings so none of the defined modes under Display\LCD in the registry. Do I need to define one and set things like I2CDevice and I2CDeviceAddress?



    What I also noticed is that EC 2013, which is almost impossible to use due to the minimal user interface, does not support my EDT resistive touch screen either, something Windows 6 CE does by default.

    I have a capacitive touch screen, EMT70001ADH6 which I have tested with two PicoComA5, one with Windows CE 6 and one with Windows EC 2013. On both, the screen works but, also on both, the touch interface does not work.


    I have the touch part of the screen connected according to documentation, assuming that I2C is used.
    But what else do I need to do to get the touch working? Are the things in the registry that need to be set? Is I2C on by default?


    Any help/info very welcome.

    In an application I'm working on, I'm using serial communication on COM2, 9600-N81. If I build my application (using VS2008) and copy the executable to the PicoCom and run it, communication works as expected. I have a timer running (interval around 100 millisec) and every time the timer triggers I have around 10 bytes to process. But if I close the program and then run it again, SerialPort.BytesToRead returns 2047 every time regardless of what I do. I can read bytes, discard the buffer, disconnect the hardware sending the data: I keep getting 2047 bytes. Looks like the UART or the Windows serial driver has gone a bit wild.


    Please note


    1) I close the port on program exit
    2) I discard any data in the input buffer when opening the port
    3) I need to use a timer and not the Windows CE event driven model (the latter doesn't work well)


    So, in short: comms work, I close program and run it again, comms doesn't work
    What could possibly be wrong?

    Code


    fSP = New SerialPort()
    fSP.BaudRate = 9600
    fSP.StopBits = StopBits.One
    fSP.Parity = Parity.None
    fSP.DataBits = 8
    fSP.PortName = "COM2"


    Private Sub bnSendOnCOM_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bnSendOnCOM.Click
    If cbUseRTS.Checked Then
    fSP.Handshake = Handshake.RequestToSend
    Else
    fSP.Handshake = Handshake.None
    End If


    fSP.Open()
    Dim i As Integer
    For i = 0 To 9
    fSP.WriteLine("abcdefghijklmnopqrstuvwxyz")
    Next i
    fSP.Close()
    End Sub


    When Handshake is None the function works but when Handshake is set to RequestToSend the program hangs and a reboot is needed.
    Why is that?

    I now have a v1.2 PicoComA5 with the latest Win6 kernel, dec 2013, but SerialPort.RtsEnable still doesn't work.
    I measure at pin 4 of J6 but nothing happens when I toggle RtsEnable. Any ideas as to why this doesn't work?

    Hello,


    I have a PicoComA5 with Windows CE 6. When connected to a PC (USB) running XP or Vista everything works perfectly: VS 2008, browsing the PicoCom, CE tools, etc.


    But if I swap that for a A5 board with CE2013 (i.e. CE8) nothing works, the board doesn't connect at all. I wouldn't mind moving to CE8 (although I'm not clear as to what the advantages would be) but not if it means spending hours figuring out why nothing works.


    If I take the same board and put a CE6 kernel on it everything works straight away. Isn't a strange then that a later version doesn't work at all?


    By the way, the same holds true for CE7, also no connect.


    Regards,
    DH

    I know I really should check the FindWindow return value but since the code has always worked it didn't seem important.
    And, with all respect, you are missing the point: the code has worked with earlier kernels but doesn't work anymore.


    If I look with the CE Spy tool, the class is HHTaskBar and the window name is empty.
    But how can I find a window with an empty name? Or should I now use HHTaksBar?


    Regards,
    DH

    Hello,


    This code has always worked


    Public Sub SetTaskBar(ByVal flag As Integer)
    Dim hwnd1 As Long
    hwnd1 = FindWindow("Shell_traywnd", "")
    If (flag = 0) Then
    Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
    Else
    Call SetWindowPos(hwnd1, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
    End If
    End Sub


    but after upgrading to kernel 131204 it doesn't. Any ideas why? Any solutions?


    Regards,
    Dag Hovden

    The TcpClient class seems ideal to use for TCP/IP communication but there's one problem I don't see how to work around:


    TcpClient.GetStream returns a NetworkStream for read/write but stream.Read hangs forever if no data is available (although the documentation says it shouldn't). Now, there are both tcpClient.ReceiveTimeout and NetworkStream.ReceiveTimeout properties but for both of these Microsoft has this to say:


    In .NET Compact Framework applications, the ReadTimeout property is supported, but reserved for future use. Using this property will raise an InvalidOperationException, until it is available in a future release of the .NET Compact Framework.


    Which means that there is no timeout functionality in Compact Framework. If that is really the case, it makes TcpClient almost useless and I find that hard to believe.


    Do you have any experience with this or know how work around it?


    Please note: property NetworkStream.DataAvailable always returns False (Microsoft says that it's not always supported)

    "ByRef InBuffer As IntPtr", I've tried that with pin=new IntPtr(APin) (in SetPin) but that's when it crashes ...
    Haven't checked GetLastError, a bit difficult since the program crashes ate the DeviceIoControl call :-)
    Maybe a try catch will work, will test

    VB and C# are not very different in general but when it comes to DLlImport they are. Anyway, WriteFile/ReadFile works so the registry settings are correct. Here is how I set them


    reg open \drivers\builtin\digitalio
    reg set val UseAsIO hex 00,00,00,00,00,C0,01
    reg set val DataDir hex 00,00,00,00,00,C0,01
    reg set val DataInit hex 00,00,00,00,00,00,01
    reg save


    I'm testing on pins 1, 2 and 13 on J10, all as output.


    The essential bits of the code are (please note that port has already been set by call to SetFilePointer):


    <DllImport("coredll.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
    Public Shared Function DeviceIoControl(ByVal hDevice As IntPtr, ByVal dwIoControlCode As UInteger, ByRef InBuffer As UInteger, _
    ByVal nInBufferSize As Integer, ByRef OutBuffer As UInteger, ByVal nOutBufferSize As Integer, ByRef pBytesReturned As UInteger, _
    ByVal lpOverlapped As IntPtr) As Boolean
    End Function


    Sub SetPin(ByVal APin As Integer)
    Dim cnt As UInteger
    Dim pin As UInteger
    pin = APin
    DeviceIoControl(hPort, IOCTL_DIO_SET_PIN, pin, 4, Nothing, 0, cnt, Nothing)
    End Sub


    Sub ClearPin(ByVal APin As Integer)
    Dim cnt As UInteger
    Dim pin As UInteger
    pin = APin
    DeviceIoControl(hPort, IOCTL_DIO_CLR_PIN, pin, 4, Nothing, 0, cnt, Nothing)
    End Sub


    where


    IOCTL_DIO_SET_PIN = CTL_CODE(FILE_DEVICE_DIO, IOCTL_SET_PIN, METHOD_BUFFERED, FILE_ANY_ACCESS)
    IOCTL_DIO_CLR_PIN = CTL_CODE(FILE_DEVICE_DIO, IOCTL_CLR_PIN, METHOD_BUFFERED, FILE_ANY_ACCESS)


    and


    Const IOCTL_SET_PIN As UInteger = 60
    Const IOCTL_CLR_PIN As UInteger = 62

    Well, the problem in detail, as already posted was this


    What I'm running into now is the declaration of DeviceIoControl in VB.Net. I have tried a number of IntPtr/UInteger variations but cannot get it to work: either the programs crashes or nothing happens.


    I'd be very grateful if you could show me how the DllImport should look like in VB.Net and how to call it to set or clear or pin.


    So not much point in looking at C# examples ... which I have done and have working as well but I need to get this working in VB as well. Normally, DllImport declarations are quite easy to figure out (or find) but as I said, I can't get this work. Whatever I try, my program either crashes or nithing happens when I call DeviceIoControl

    Thank you for the example code but I already have working WriteFile/ReadFile code. The advantage with DeviceIoControl is that it lets you individual pins whereas WriteFile always affects an entire port which is not always what you want.


    So, a code example using DeviceIoControl would be much appreciated ...

    Thank you, that works, one step further :-)


    What I'm running into now is the declaration of DeviceIoControl in VB.Net. I have tried a number of IntPtr/UInteger variations but cannot get it to work: either the programs crashes or nothing happens.


    I'd be very grateful if you could show me how the DllImport should look like in VB.Net and how to call it to set or clear or pin.

    In your programming examples and samples (mostly C and C#) for DeviceIoControl, the values IOCTL_DIO_SET_PIN, IOCTL_DIO_GET_PIN and IOCTL_DIO_CLR_PIN are used but I can't find how these are defined for use in VB.Net.


    Where can I find what the values for these 3 constants are?