EasyManua.ls Logo

Cinzone DA-1000 - 5.1.1.4.2 Control GP60 to GP63

Default Icon
84 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DA-1000 User’s Manual
81
Chapter 5: Product application
5.1.1.4 .2 Control of GP60 to GP63
#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 GP60 to GP63 output Mode
WriteByte(AddrPort, 0x90) // Select configuration register 90h
WriteByte(DataPort, (ReadByte(DataPort) & 0xXF))
// Set (bit 0~3) = 1 to select GP 60 ~63 as Output mode.
<Output Value>
WriteByte(AddrPort, 0x91) // Select configuration register 91h
WriteByte(DataPort, Value) // Set bit 0~3=(0/1) to output GP 60~63
as Low or High
<Leave the Extended Function Mode>
WriteByte(AddrPort, 0xAA)