All Forums
 Hardware
 Ethernet, IR, Serial, CAN and high speed data
 Hardware address of GCX CAN controller
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

Jim Najpauer

9 Posts

Posted - 27 Jun 2007 :  10:53:59  Show Profile  Email Poster
What is the hardware address of the SJA1000 on the GCX?

akidder

1519 Posts

Posted - 27 Jun 2007 :  11:13:44  Show Profile  Email Poster
Thanks for your note. I hate to say it, but you probably don't want to know the answer to that question. CE 6 doesn't allow you to access hardware registers directly. Any code you write accessing the CAN controller's hardware address will not work under CE 6.

If you can let us know what features of the CAN controller you need that the Windows CE driver doesn't currently support, we'll be glad to help you figure out how to get what you need.
Go to Top of Page

Jim Najpauer

9 Posts

Posted - 27 Jun 2007 :  11:21:39  Show Profile  Email Poster
We are using CE.NET 4.2.
What is the address?
Go to Top of Page

akidder

1519 Posts

Posted - 27 Jun 2007 :  11:30:01  Show Profile  Email Poster
Thanks, Jim. If you'd rather not discuss your needs on the forums, please contact us directly.

The address itself isn't a big deal, but its use suggests that you are asking for something outside of our business model and best practices, so requires further discussion.
Go to Top of Page

Jim Najpauer

9 Posts

Posted - 27 Jun 2007 :  11:57:46  Show Profile  Email Poster
We are in the process of connecting the GCX to our DSP via CAN.

The following function and output shows what we are getting.

The output differs from the information provided in your documentation specifically page 10:

4.2 Default Settings
The CAN driver starts up with the following default settings:
Baud rate: 0 kbps
Sample point: 75%

int canExample(void){
//
// Ref: ADS Windows CE CAN Driver for the SJA1000T CAN Controller
// Specification Version 1.5, ADS document # 110025-10036
//
DWORD b=0; // bytes
HANDLE h=0; // handle
DWORD v=0; // value
TCHAR vn[2]; // version number

// Open CAN Driver ref: page 12
if(NULL == (h=CreateFile(_T("CAN1:"),0,0,NULL,0,0,NULL))) return(-1);

// Get Driver Version ref: page 22
if(DeviceIoControl(h,0xA0, NULL,0, &vn,sizeof(vn), &b,NULL))
RETAILMSG(1, (T("\r\n Driver version: '%s' (bytes: %d)"), vn, b));

// Reset chip ref: page 19
if(DeviceIoControl(h,0x05, NULL,0, NULL,0, &b,NULL))
RETAILMSG(1, (T("\r\n Reset chip (bytes: %d)"), b));

// Get Sample Point ref: page 20
if(DeviceIoControl(h,0x0A, NULL,0, &v,sizeof(v), &b,NULL))
RETAILMSG(1, (T("\r\n Get Sample Point: %d (bytes: %d)"), v, b));

// Set Sample Point ref: page 21
v = 75;
if(DeviceIoControl(h,0x0B, &v,sizeof(v), NULL,0, &b,NULL))
RETAILMSG(1, (T("\r\n Set Sample Point: %d (bytes: %d)"), v, b));

// Get Sample Point ref: page 20
if(DeviceIoControl(h,0x0A, NULL,0, &v,sizeof(v), &b,NULL))
RETAILMSG(1, (T("\r\n Get Sample Point: %d (bytes: %d)"), v, b));

// Get Baud Rate ref: page 19
if(DeviceIoControl(h,0x04, NULL,0, &v,sizeof(v), &b,NULL))
RETAILMSG(1, (T("\r\n Get Baud Rate: %d (bytes: %d)"), v, b));

// Set Baud Rate ref: page 18
v = 1000;
if(DeviceIoControl(h,0x03, &v,sizeof(v), NULL,0, &b,NULL))
RETAILMSG(1, (T("\r\n Set Baud Rate: %d (bytes: %d)"), v, b));

// Get Baud Rate ref: page 19
if(DeviceIoControl(h,0x04, NULL,0, &v,sizeof(v), &b,NULL))
RETAILMSG(1, (T("\r\n Get Baud Rate: %d (bytes: %d)"), v, b));

// Close CAN Driver ref: page 13
CloseHandle(h);
return(0);
}

Output:

CAN: Driver version: '1.5' (bytes: 0)
CAN: Reset chip (bytes: 0)
CAN: Get Sample Point: 80 (bytes: 0)
CAN: Set Sample Point: 75 (bytes: 0)
CAN: Get Sample Point: 80 (bytes: 0)
CAN: Get Baud Rate: 1333 (bytes: 0)
CAN: Set Baud Rate: 1000 (bytes: 0)
CAN: Get Baud Rate: 1333 (bytes: 0)

If the example function is in-correct please let us know.

If your documentation was not kept up to date please let us know
and please provide any and all updated information.

We simply wanted the address to confirm the bus timing registers at this time.

Sorry we didn’t provide all of the above when we initially asked for the address.

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.03 seconds. Snitz Forums 2000