All Forums
 Hardware
 General Hardware, ADSmartIO, Digital I/O and A/Ds
 ADSmartIO (VGX)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

Simonson

6 Posts

Posted - 18 May 2005 :  17:59:59  Show Profile  Email Poster
I wish to use J8.12 and J8.14 as ADSmartIO on VGX.
Is it possible to reconfigure an existing system? How?

Can .HWT or .REG be used to set the default state of any of the ADSmartIO or GPIO or CPLDIO?

I can successfully control GC_GPIO pins using stream functions on "IOA1:", etc. I am unable to use the same functions on "GPA4:" to control CPLDIO4. I have also failed at using DIO 1.0 to control the CPLDIOs. How can I access the CPLDIOs?

ctacke

877 Posts

Posted - 18 May 2005 :  18:12:50  Show Profile  Email Poster
The DIO driver is the way to access all GPIOs outside of the ADSmartIO. When you say it fails, in what manner? What VGX build number are you using?
Go to Top of Page

Simonson

6 Posts

Posted - 19 May 2005 :  09:31:37  Show Profile  Email Poster
The tag on the VGX board reads:
900116-2100 A
621116-2000 A3

The CE image is: VGX Windows CE Ver.(4.20.24.06 RAVEN BETA2 VGX_PRO_RVGX)

CPLD version 0x6


I executed the following code, but measured no activity at pin J14.34



#include "dioapp.h"
HANDLE hPort;
DWORD DIO_Dir;
DWORD dwBytesRead, dwBytesWritten;
DWORD settings;
hPort=CreateFile(TEXT("DIO1:"), //port name (UNICODE compatible)
GENERIC_READ | GENERIC_WRITE, //open for read-write
0, //com port cannot be shared
NULL, //always NULL for Windows CE
OPEN_EXISTING, //for communication resource
0, //non-overlapped operation only
NULL); //always NULL for Windows CE

if(hPort!=INVALID_HANDLE_VALUE)
{
DeviceIoControl(hPort,DIO_IOCTL_GET_DIRECTION,NULL,
0,&DIO_Dir,DIO_SIZE,&dwBytesRead,NULL);
DIO_Dir |= 0x0000C000;//set bits 14 and 15 high to enable
//CPLDIO3 and 4 as outputs
DeviceIoControl(hPort,DIO_IOCTL_SET_DIRECTION,&DIO_Dir,
DIO_SIZE,NULL,0,&dwBytesWritten,NULL);

ReadFile(hPort,&settings,4,&dwBytesRead, NULL);
while(1)
{
settings &= 0xFFFFEFFF;//set bit 15 low
WriteFile(hPort, &settings, 4, &dwBytesWritten, NULL);
settings |= 0x00008000;//set bit 15 high
WriteFile(hPort, &settings, 4, &dwBytesWritten, NULL);
}
CloseHandle(hPort);
}




Thanks Chris.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000