![FabiaTech Low Power FB2652 Скачать руководство пользователя страница 60](http://html1.mh-extra.com/html/fabiatech/low-power-fb2652/low-power-fb2652_user-manual_3126367060.webp)
FabiaTech Corporation
54
J5 TTL I/O -Software programming example
The following example is written in Intel 8086 assembly language. It assumes that the
IO port address is located at 2Eh and data port is located at 2Fh. The following is an
Assemble program, which demonstrates how to read/write the TTL IO port
;------------------------------------------------------------------------------------------
; Enter the extended function mode, interruptible double-write
;------------------------------------------------------------------------------------------
Mov
dx,2eh
Mov
al,87h
Out dx,al
Out dx,al
;------------------------------------------------------------------------------------------------------
; Logical device 7, configuration register CRF1 Bit 0,1(J5-Pin1, 2/GPO1, 2)
;------------------------------------------------------------------------------------------------------
Mov dx,2eh
Mov al,07h
Out
dx,al
;point to Logical Device Number Reg.
Mov dx,2fh
Mov al,07h
Out
dx,al
; select logical device 7
Mov dx,2eh
Mov al,0f1H
Out
dx,al
; select CRF1
Mov dx,2fh
Mov
al,cfh
; Bit o,1 with value 1. (Write GPO1, GPO2 is active to high.)
; Mov
al,0cch
; Bit o, 1 with value 0. (Write GPO1, GPO2 is active to low.)
Out
dx,al
; update CRF1 with value CFH
;------------------------------------------------------------------------------------------------------
; Logical device 8, configuration register CRF1 Bit 0,1(J5-Pin3, 4/GPI 1,2)
;------------------------------------------------------------------------------------------------------
Mov dx,2eh
Mov al,07h
Out
dx,al
; point to Logical Device Number Reg.
Mov dx,2fh
Mov al,08h
Out
dx,al
; select logical device 8
Mov dx,2eh
Mov al,0f1h
Out
dx,al
; select CRF1
Mov dx,2fh
In
al,dx
; Bit o, 1 with state value. (Read GPI1, GPI2 state.)
; Read CRF1 with value 0XH
;------------------------------------------
; Exit extended function mode
;------------------------------------------
Mov dx,2eh
Mov al,0aah
Out dx,al
Содержание Low Power FB2652
Страница 5: ...v DMA Controller 2 63 Serial Ports 64 Parallel Ports 68 Appendix 71 Dimension 71...
Страница 6: ...vi...
Страница 12: ...FabiaTech Corporation 6...
Страница 26: ...FabiaTech Corporation 20...
Страница 52: ...FabiaTech Corporation 46...
Страница 77: ...FabiaTech Corporation 71 Appendix Dimension 43 1 51 8 24 9 19 6 22 9 5 1 5 1 203 2 146 1 8 1 8 1 20 4 20 6 O3 5...