Aplex Technology ACS-2645 User Manual
Page 52

ACS-2645 User Manual
52
Example x86 assembly code:
mov dx, 4Eh
mov al, 0AAh
out dx, al
Example C code:
outportb(0x4E, 0xAA);
Select logic device number
Example x86 assembly code:
mov dx, 4Eh
mov al, 007h ;LDN selection register
out dx, al
mov dx, 4Fh
mov al, 008h ;Select LDN=8, GPIO Port6
;or Select LDN9, GPIO Port2
out dx, al
Example C code:
outportb(0x4E, 0x07); //LDN selection register
outportb(0x4F, 0x08); //Select LDN=8, GPIO Port6
or
outportb(0x4E, 0x07); //LDN selection register
outportb(0x4F, 0x09); //Select LDN=9, GPIO Port2
Activate the logic device
Example x86 assembly code:
mov dx, 4Eh
mov al, 030h ;Logic device activation control reg.
out dx, al
mov dx, 4Fh
n al, dx
or al, 004h ;Set bit2 to enable GPIO Port6 if LDN=8
or al, 002h ;Set bit1 to enable GPIO Port2 if LDN=9
out dx, al
Example C code:
outportb(0x4E, 0x30); //Logic device activation control
outportb(0x4F, (inportb(0x4F)|0x2));
//Set bit[1] to enable GPIO Port2 if LDN=9
Or