
DC-1200 Series | User Manual
66
5.1.1.4 Sample Code in C Language
5.1.1.4.1
Control of GP70 to GP73 (DI1 ~ DI4)
(BTB_FH1)
#define AddrPort 0x4E
#define DataPort 0x4F
<Enter the Extended Function Mode>
WriteByte(AddrPort, 0x87)
WriteByte(AddrPort, 0x87)
// Must write twice to enter Extended mode
<Select Logic Device>
WriteByte(AddrPort, 0x07)
WriteByte(dataPort, 0x06)
// Select logic device 06h
<Output/Input Mode Selection>
// Set GP70 to GP73 input Mode
WriteByte(AddrPort, 0x80)
// Select configuration register 80h
WriteByte(DataPort, 0x0X)
// Set (bit 0~3) = 0 to select GP 70~73 as Input mode.
<Input Value>
WriteByte(AddrPort, 0x82)
// Select configuration register 82h
ReadByte(DataPort, Value)
// Read bit 0~3 (0xFx)= GP70 ~73 as High.
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)
5.1.1.4.2
Control of GP80 to GP83 (DO1 ~ DO4)
(BTB_FH1)
#define AddrPort 0x4E
#define DataPort 0x4F
<Enter the Extended Function Mode>
WriteByte(AddrPort, 0x87)
WriteByte(AddrPort, 0x87)
// Must write twice to enter Extended mode
<Select Logic Device>
WriteByte(AddrPort, 0x07)
WriteByte(DataPort, 0x06)
// Select logic device 06h
<Output/Input Mode Selection>
// Set GP80 to GP83 output Mode
WriteByte(AddrPort, 0x88)
// Select configuration register 88h
WriteByte(DataPort, 0xXF))
// Set (bit 0~3) = 1 to select GP 80 ~83 as Output mode.
<Output Value>
Содержание DC-1200 Series
Страница 11: ...DC 1200 Series User Manual 11 Chapter 1 Product Introductions ...
Страница 17: ...DC 1200 Series User Manual 17 1 7 Mechanical Dimension Unit mm ...
Страница 18: ...DC 1200 Series User Manual 18 Chapter 2 Switches Connectors ...
Страница 19: ...DC 1200 Series User Manual 19 2 1 Location of Switches and Connectors 2 1 1 Top View ...
Страница 20: ...DC 1200 Series User Manual 20 2 1 2 Bottom View ...
Страница 28: ...DC 1200 Series User Manual 28 Chapter 3 System Setup ...
Страница 43: ...DC 1200 Series User Manual 43 Chapter 4 BIOS Setup ...
Страница 61: ...DC 1200 Series User Manual 61 Chapter 5 Product Application For CMI DIO03 only ...
Страница 64: ...DC 1200 Series User Manual 64 ...
Страница 65: ...DC 1200 Series User Manual 65 ...
Страница 76: ...DC 1200 Series User Manual 76 Reference Input Circuit Reference Output Circuit ...
Страница 77: ...DC 1200 Series User Manual 77 Chapter 6 Optional Modules and Accessories Pin Definitions and Settings ...
Страница 90: ...DC 1200 Series User Manual 90 4 Fasten a screw to fix the CMI HD module 5 The installation is complete ...