Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I/O plus Encoder card compatible with windows ce

69 views
Skip to first unread message

Teoman

unread,
Nov 1, 2007, 11:45:05 AM11/1/07
to
Does any one know of any IO cards that are compatible with windows ce. When I
mean compatible I dont mean if you try hard enough you may be able to write a
driver for it. I mean the manufacturer supports ce and provides you with the
drivers etc.

What I am after is this. I have a x86 system that I have up and running on a
advantech AIMB-762 motherboard and P4 processor. Basically a desktop
computer. That I have running with windows CE.

The modules that I need to add are:
12 encoder inputs
24 digital inputs
12 analog outputs.
12 digital outputs.

All these can be evidently on several io cards.

We purchased some HUMUSOFT MF624 cards for this but the damn things are
refusing to function.

Any help would be vastly appreciated.

Thank you in advance
Teoman

Paul G. Tobey [eMVP]

unread,
Nov 1, 2007, 12:20:39 PM11/1/07
to
So, you have to have PCI-based cards with that set of I/O and with Windows
CE x86 drivers. What exactly is going wrong? It's probably the fault of
your BSP, not of the driver, although you can't rule anything out. I think
that the best chance is that you'll tell us something about what's going on
and we'll spot what your BSP might be doing wrong.

We have some devices that modularly add encoder and digital inputs and
outputs to a base unit that runs Windows CE, but none of it is PCI, so, if
you're attached to your processor, our stuff won't help you...

Paul T.

"Teoman" <Teo...@discussions.microsoft.com> wrote in message
news:CDE04B02-A549-47D3...@microsoft.com...

Teoman

unread,
Nov 1, 2007, 12:51:00 PM11/1/07
to
Thank you Paul,

The real problme is that I havent been able to write the driver yet. The
cards that came did not have driversi only for WinXP and open source linux
drivers. Writing the is proving to be too time consuming as I can not yet see
the light at the end of the tunnel. So it might wiser to just buy something
off the shelf that works.

The reason I bought the cards was that we previously had the ISA versions
and then decided to purchase PCI ones. I was able to access the ISA ones with
ease. However the PCI ones are not so easy. The ISA version functions well
and I have the code written for it.

I might be able to write a driver if some one can provide a sample PCI io
dirver. The WAV driver is a bit too complicated to begin with.


So... As time is running out I am looking for alternatives.

Thank you.
Teoman

Paul G. Tobey [eMVP]

unread,
Nov 1, 2007, 1:09:14 PM11/1/07
to
Ah! Now I follow you. When you're a PCI device, you have to spend a lot
more effort to interface with the bus driver for PCI. With ISA devices,
well, you just kind of set their base address and interrupt to whatever and
just act from the driver as though there's no bus there at all.

You might look at pcicfg.cpp in the ATAPI driver in
common\oak\drivers\block. Of course, you have the source for the PCI bus
driver, too, so you can look in on that.

As far as finding suitable hardware/drivers, I think that your best chance
is a Web search with "windows ce" in the strings.

Paul T.

"Teoman" <Teo...@discussions.microsoft.com> wrote in message

news:2FB1C7B8-1C52-4F0C...@microsoft.com...

Silver

unread,
Nov 1, 2007, 1:20:51 PM11/1/07
to
There are plenty of companies that can help you with your driver if time is
an issue.
<shameless plug>Try http://www.trygtech.com for instance. </shameless plug>


humusoft cz@discussions.microsoft.com fojtik (at) humusoft (dot) cz

unread,
Nov 3, 2007, 6:28:01 PM11/3/07
to
Dear "Teoman" wrote:

> All these can be evidently on several io cards.
>
> We purchased some HUMUSOFT MF624 cards for this but the damn things are
> refusing to function.

There are available so called generic device drivers. These drivers could
prolongate memory mapping into userspace. As far as I know they are not free
of charge.

Both Windows and Linux drivers are userspace drivers and a kernel part only
handles PCI mapping stuff. I know it quite well because I have programmed
both of them.

Buy generic driver for WinCE and link source codes from free Linux driver
against it. It don't look, but several pieces of code are compilable under
windows. It must work.

And don't expect more support with this unsupported OS.

Jara

Teoman

unread,
Nov 5, 2007, 9:21:01 AM11/5/07
to
Dear Jara,

I am not expecting any more support from you thank you, you have already
stated that you have no dealings with "windows ce" and will not be providing
drivers for windows ce any time in the future. You were kind enough to give
me the linux drivers and I appreciate that. And once I get the iospace mapped
writing the driver will not be a problem.

I am asking for support to write "windows ce" drivers that is why I am
writing to this forum and not you. I fail to see your reasonning why should I
not expect any support from these kind people!?

Teoman

Paul G. Tobey [eMVP]

unread,
Nov 5, 2007, 10:52:18 AM11/5/07
to
In order to see something about "writing Windows CE drivers", download the
Windows CE/Platform Builder evaluation edition from Microsoft
(www.microsoft.com/downloads). There are, it should be obvious, many driver
'examples' in there for all sorts of things. It may be that the general
scheme from your Linux drivers will be relatively portable to a Windows CE
stream driver for a PCI device. That's the starting point, if you're going
to stick with this hardware...

Paul T.

"Teoman" <Teo...@discussions.microsoft.com> wrote in message

news:005C4D1E-FAA2-4FD0...@microsoft.com...

Teoman

unread,
Nov 5, 2007, 12:45:01 PM11/5/07
to
By platform builder you mean the VS2005 plugin. I already have the full
version.

I am no randomly checking the driver files if there is a simpler driver file
that I might be able to relate to.

I can consider dicontinuing with the current hardware however I have to find
an alternative but I havent been able to find it. So the alternative is using
linux.

Teoman

"Paul G. Tobey [eMVP]" wrote:

Paul G. Tobey [eMVP]

unread,
Nov 5, 2007, 1:08:33 PM11/5/07
to
Yes, in CE6, Platform Builder is a VS2005 plugin. In earlier versions, it's
a separate IDE to itself.

We don't know what sort of driver model your existing driver is built on or
how it communicates with PCI in Linux. Different drivers can have different
formats in Windows CE, unlike Unix where they usually are really stream-type
drivers, in my experience, at least. Some of the stream drivers that you'd
find in Windows CE would be serial port drivers, parallel port drivers, etc.
Most drivers in Windows CE are found in
$(_WINCEROOT)\public\common\oak\drivers.

Starting your first Windows CE project with porting of a driver is probably
not the best choice. If you feel like you're more familiar with Linux, go
at it. The goal is to get it done, with a high-quality result, as quickly
as practical. If the only thing stopping you from doing Windows CE is the
difficulty of porting this one single driver, hire someone to do it! You've
already spent enough of your time to pay for a substantial fraction of the
cost, I'd guess, and you'll surely spend a lot more porting Linux and
changing over all of your software development to different tools, or
learning enough about drivers to do something useful, then porting the
driver, than you would just hiring someone who is an expert with Windows CE.

Paul T.

"Teoman" <Teo...@discussions.microsoft.com> wrote in message

news:58439FC4-C497-4C15...@microsoft.com...

Teoman

unread,
Nov 6, 2007, 5:34:03 PM11/6/07
to
I already have the system working with an ISA verison of a previous version
of the card. So I am familiar on what to do once I get the card working under
CE (It works nicely under XP) But under XP I just havent been able to get the
base address. I have been content with CE so far. It has been easier to
develop than linux and I think that I will continue to work with it. But I
might need to change the IO cards If I fail to write the driver.

So maby someone can help me, here is what I have done:

I have setup a WinCe OS (6.0) Using the platform builder. And I have it
running from a Hard disk on my x86.

After I added a sub project. A dll project that exprots some functions.

THen I started looking at the WAV driver. And I included the following files
to the sub-project.

cregkey.h and cregkey.cpp that can be found in:
C:\WINCE600\PUBLIC\COMMON\OAK\DRIVERS\WAVEDEV\UNIFIED\ENSONIQ

Then I copy paste cut my driver code. It does nothing. What I am trying to
achieve initially is to display something on the printer port (address
0x378). I have LED's attached. (Code at bottom of post)

Then I added the following code right after the #defines in the
"platform.reg" file
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\PCI\Template\HumusoftCE]
"Dll"="HumusoftCE.dll"
"VendorID"=multi_sz:"186C"
"DeviceID"=multi_sz:"624"
"Prefix"="HMS"

Then I added the following after the MODULES tag of the "platform.bib" file

HumusoftCE.dll $(_FLATRELEASEDIR)\HumusoftCE.dll NK

The Code for my driver: It is almost the same as es1371 except that I
removed some intermediate functions. And then added output to the printer
port.

I expect the leds to change indicating that the driver has been loaded when
the computer starts up.

// HumusoftCE.cpp : Defines the entry point for the DLL application.

#include "stdafx.h"
#include "HumusoftCE.h"
#include <wtypes.h>
#include <nkintr.h>
#include <ceddk.h>
#include <devload.h>
#include <Ddkreg.h>
#include <ddkreg.h>
#include "cregkey.h"

BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}


HumusoftCE_API HMS_Init(PCTSTR pszActiveKey){
CRegKey regkey(pszActiveKey);

CRegKey * pRegKey = &regkey;

PHYSICAL_ADDRESS MappedAddress;
DDKWINDOWINFO wini;
DDKISRINFO isri;
DDKPCIINFO pcii;
DWORD dwStatus;

DEBUGMSG(ZONE_ERROR, (_T("Drivera girdi")));
WRITE_PORT_UCHAR((PUCHAR)0x378,5);

// read window information
wini.cbSize = sizeof(wini);
dwStatus = DDKReg_GetWindowInfo(pRegKey->Key(), &wini);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetWindowInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}
// m_dwBusNumber = wini.dwBusNumber;
// m_dwInterfaceType = wini.dwInterfaceType;

// sanity check return values
if(wini.dwNumIoWindows != 1) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: invalid window parameters read from
registry\r\n")));
return FALSE;
}

// read ISR information
isri.cbSize = sizeof(isri);
dwStatus = DDKReg_GetIsrInfo(pRegKey->Key(), &isri);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetIsrInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}

// sanity check return values
if(isri.dwSysintr == SYSINTR_NOP) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: no sysintr specified in registry\r\n")));
return FALSE;
}
if(isri.szIsrDll[0] != 0) {
if(isri.szIsrHandler[0] == 0 || isri.dwIrq == IRQ_UNSPECIFIED) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: invalid installable ISR information in
registry\r\n")));
return FALSE;
}
}

// read PCI id
pcii.cbSize = sizeof(pcii);
dwStatus = DDKReg_GetPciInfo(pRegKey->Key(), &pcii);
if(dwStatus != ERROR_SUCCESS) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: DDKReg_GetPciInfo() failed %d\r\n"),
dwStatus));
return FALSE;
}

// sanity check return values
if((pcii.dwWhichIds & (PCIIDM_DEVICEID | PCIIDM_REVISIONID)) !=
(PCIIDM_DEVICEID | PCIIDM_REVISIONID)) {
DEBUGMSG(ZONE_ERROR, (_T("Ensoniq: insufficient device ID information in
registry\r\n")));
return FALSE;
}

//m_IntrAudio = isri.dwSysintr;
//m_dwPciLength = wini.ioWindows[0].dwLen;
//m_dwDeviceID = pcii.idVals[PCIID_DEVICEID];
//m_dwRevisionID = pcii.idVals[PCIID_REVISIONID];

PHYSICAL_ADDRESS PortAddress = {wini.ioWindows[0].dwBase, 0};


// Install ISR handler if there is one
/*
if (isri.szIsrDll[0] != 0) {
// Install ISR handler
m_hIsrHandler = LoadIntChainHandler(isri.szIsrDll,
isri.szIsrHandler, (BYTE) isri.dwIrq);
if (m_hIsrHandler == NULL) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Couldn't install ISR
handler\r\n")));
} else {
GIISR_INFO Info;
PVOID dwPhysAddr;
DWORD inIoSpace = 1; // io space

if (!TransBusAddrToStatic(PCIBus, 0, PortAddress, m_dwPciLength,
&inIoSpace, &dwPhysAddr)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Failed
TransBusAddrToStatic\r\n")));
return FALSE;
}

DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: Installed ISR handler, Dll
= '%s', Handler = '%s', Irq = %d, PhysAddr = 0x%x\r\n"),
isri.szIsrDll, isri.szIsrHandler, isri.dwIrq, dwPhysAddr));

// Set up ISR handler
Info.SysIntr = m_IntrAudio;
Info.CheckPort = TRUE;
Info.PortIsIO = TRUE;
Info.UseMaskReg = FALSE;
Info.PortAddr = (DWORD)dwPhysAddr + ES1371_dSTATUS_OFF;
Info.PortSize = sizeof(DWORD);
Info.Mask = ES1371_INTSTAT_PENDING;

if (!KernelLibIoControl(m_hIsrHandler, IOCTL_GIISR_INFO, &Info,
sizeof(Info), NULL, 0, NULL)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: KernelLibIoControl call
failed.\r\n")));
return FALSE;
}
}
}
*/

//
// Translate IO address
//
ULONG fInIoSpace = TRUE; // io space
if ( ! HalTranslateBusAddress( PCIBus, 0, PortAddress, &fInIoSpace,
&MappedAddress)) {
DEBUGMSG(ZONE_ERROR, (TEXT("Ensoniq: HalTranslateBusAddress
failed\r\n")));
return FALSE;
}

BOOL m_fIsMapped;


if ( fInIoSpace ) {
m_pPciAddr = (PUCHAR) MappedAddress.LowPart;
m_fIsMapped = FALSE;
}
else {
m_pPciAddr = (PUCHAR) MmMapIoSpace(MappedAddress, m_dwPciLength,
FALSE);
m_fIsMapped = TRUE;
}

DEBUGMSG(ZONE_INFO, (TEXT("ENSONIQ1371: IO PORT [%X]\r\n"),m_pPciAddr));

//
// Configure Interupt
//

//
// Map IO and Interupt to System spaces
//
/*
m_hISTInterruptEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (m_hISTInterruptEvent == NULL) {
DEBUGMSG(ZONE_ERROR, (TEXT("ES1371 - unable to create IST event\r\n")));
return FALSE;
}

if (!InterruptInitialize(m_IntrAudio, m_hISTInterruptEvent, NULL, NULL) ) {
DEBUGMSG(ZONE_ERROR, (TEXT("ES1371 - InterruptInitialize(%d,%08x)
Failed\r\n"), m_IntrAudio, m_hISTInterruptEvent));
return FALSE;
}
*/

//
// We'll try and reserve physical memory since it is more likely to succeed
// on driver load
// If this fails, we'll try again at run-time
/*
for (int i = 0; i < NUM_DMACHANNELS; i++) {
DMA_ADAPTER_OBJECT AdapterObject;
PHYSICAL_ADDRESS LogicalAddress;

AdapterObject.ObjectSize = sizeof(DMA_ADAPTER_OBJECT);
AdapterObject.InterfaceType = (INTERFACE_TYPE) m_dwInterfaceType;
AdapterObject.BusNumber = m_dwBusNumber;

if ((m_dmachannel[i].pvBufferVirtAddr =
HalAllocateCommonBuffer(&AdapterObject, m_dmachannel[i].ulInitialSize,
&LogicalAddress, FALSE)) != NULL)
{
m_dmachannel[i].ulBufferPhysAddr = LogicalAddress.LowPart;
m_dmachannel[i].ulAllocatedSize = m_dmachannel[i].ulInitialSize;
}
else
{
m_dmachannel[i].ulAllocatedSize = 0;
DEBUGMSG(ZONE_WARNING,(TEXT("ES1371: unable to reserve %d bytes
for DMA channel %d\r\n"),
m_dmachannel[i].ulInitialSize, i ));
}
}
*/
// record the Device ID and Revision ID for posterity.

//call our initialization functions
// InitHardware();

//
// Turn on card
//
// SetPowerState(1); // Turn off to set register arrays
// SetPowerState(0);

DEBUGMSG(ZONE_INFO, (TEXT("ES1371: PCI Init Done\r\n")));
return TRUE;

Paul G. Tobey [eMVP]

unread,
Nov 6, 2007, 6:36:16 PM11/6/07
to
Your driver is almost certainly going to need to be in the kernel. Add a K
to the BIB file line after a space or tab after NK.

You've got debug messages in your driver. Is the driver getting loaded at
all? Have you set breakpoints in it, if so, and traced where things are
going wrong?

Paul T.

"Teoman" <Teo...@discussions.microsoft.com> wrote in message

news:02320ED0-E5AC-4EFF...@microsoft.com...

fojtik

unread,
Nov 8, 2007, 6:58:24 PM11/8/07
to
Dear Teoman,

>me the linux drivers and I appreciate that. And once I get the iospace mapped
>writing the driver will not be a problem.

Ignore IO space. Memory space is sufficient enough for MF624. Win64 platform
also don't allow to map I/O space to user space so full MF624 device handling
could be done without I/O space.

>I am asking for support to write "windows ce" drivers that is why I am
>writing to this forum and not you. I fail to see your reasonning why should I
>not expect any support from these kind people!?

I have meant that Humusoft has never think about WindowsCE, has no schedule
to do anythink with this OS. Its all.

I have never boot this OS and I have never used any Windows CE SDK.

Jara

Teoman

unread,
Nov 16, 2007, 1:53:02 PM11/16/07
to
If anyone is interested I have put this project on auction at
www.rendtacoder.com with project ID 802834
0 new messages