51
PCI-1680U/1682U User Manual
Chapter 4
S
oftware
R
equirements
4.4.3
Command_par
When users directly use DeviceIOControl interface of Windows Native API to call
drivers, this structure is needed.
If DeviceIOControl's parameter dwIoControlCode is CAN_IOCTL_COMMAND
(0x222540), this means command operation. If dwIoControlCode is
CAN_IOCTL_CONFIG (0x222544), it means configuration operation. (Please refer to
MSDN for related information about DeviceIOControl).
struct Command_par {
int cmd;
int target;
ULONG val1;
ULONG val2;
int error;
ULONG retval;
};
Note
1.
The two modes of configuring Baud Rate are standard mode and custom mode.
Standard mode
The standard mode includes the recommended Baud Rate value. If the setting
value is 10, then the Baud Rate will be 10k.
Custom mode
If user need the baud rate is not in above table, user can use the custom mode
to set the custom baud rate.
The CAN port's baud rate is determine by CAN clock, BTR0 and BTR1 .
The Advantech CAN devices use 8MHZ clock and oscillator frequency is 16M,
The internal clock is divided by two from the oscillator frequency.
BTR0 and BTR1 Timing Registers are used for:
–
defining the bit-rate on the bus.
–
defining the sample point in a bit period (bit sample point).
–
defining the number of samples taken in a bit period.
we provide API function to set BTR0 and BTR1, The function will write the low 8
bits of setting value to BTR0 and high 8 bits of setting value to BTR1 of CAN
device register.
Target value
BTR0
BTR1 Setting
value
10K 0x31
0x1c
10
20K 0x18
0x1c
20
50K
0x09
0x1c
50
100K 0x04
0x1c
100
125K 0x03
0x1c
125
250K 0x01
0x1c
250
500K 0x00
0x1c
500
800K 0x00
0x16
800
1000K 0x00
0x14
1000
Содержание PCI-1680U
Страница 10: ...PCI 1680U 1682U User Manual 4 ...
Страница 16: ...PCI 1680U 1682U User Manual 10 5 Click Next as the following 6 Click Next as the following ...
Страница 22: ...PCI 1680U 1682U User Manual 16 ...
Страница 26: ...PCI 1680U 1682U User Manual 20 Figure 3 2 PCI 1682U Silk Screen ...
Страница 29: ...Chapter 4 4 Software Requirements This chapter has information on the software of PCI 1680U 1682U ...
Страница 85: ...79 PCI 1680U 1682U User Manual Chapter 4 Software Requirements WDM CE ...
Страница 89: ...83 PCI 1680U 1682U User Manual Chapter 4 Software Requirements CE 4 8 2 Flow Chart 4 8 2 1 Send flow chart ...
Страница 90: ...PCI 1680U 1682U User Manual 84 4 8 2 2 Receive flow chart ...
Страница 91: ...85 PCI 1680U 1682U User Manual Chapter 4 Software Requirements 4 8 2 3 Configure flow chart ...
Страница 92: ...PCI 1680U 1682U User Manual 86 4 8 2 4 Event flow chart Either flow chart of the two sub threads is as below ...
Страница 103: ...97 PCI 1680U 1682U User Manual Chapter 5 Pin Assignments and Wiring ...