⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 csu.inc

📁 VRTX 商用嵌入式实时操作系统
💻 INC
字号:

; Include 80386ex register and board definitions and register get/set macros

$include (i386ex.inc)

;; *********************************************************************************
;; ********************** EV386EX initialization code ******************************
;; *********************************************************************************

		;; Configure the operation of A20 address line
	in      al,92h      ; Clear Port 92 Reset
	and     al,0feh         ; Bit 0 Fast Reset 0=Disabled 1=Reset Triggered
	or      al,02h          ; Bit 1 Fast A20   0=A20 always 0(emulate 8086) 1=A20 active
	out     92H,al

			;; Enable access to peripheral register at expanded I/O addresses
	MOV     al, LOW 8000H
	mov     ah, HIGH 8000H
	OUT     REMAPCFGH, AL
	XCHG    AL, AH
	OUT     REMAPCFGL, AL
	OUT     REMAPCFGL, EAX

			;; Watch Dog Timer Status = Disabled
		%SetEXRegByte (WDTSTATUS, 01H)

			;Initialize the Refresh Control Unit for:
			;  Refresh address of 0000H.
			;  Refresh gate between rows is 15.6uSec
			;  Using a CLK2 frequency of 50 MHz (25Mhz CPU operation)
			;  The refresh control unit is Enabled.
			;  The refresh pin is not used.
		%SetEXRegWord (RFSCIR, 390)      ;Program refresh interval.
		%SetEXRegWord (RFSBAD, 00H)      ;Program base address.
		%SetEXRegWord (RFSADD, 00H)      ;Program address register.
		%SetEXRegWord (RFSCON, 8000H)    ;Program the enable bit.

			;Initialize the Clock and Power Management Unit for:
			;  Clock frequency of 50 MHz
			;  Prescaled clock output of  1.19318 MHz (Matches standard PC configuration)
			;  Normal Halt Instructions
	 %SetEXRegByte (PWRCON, 00H)
	 %SetEXRegWord (CLKPRS, 01f3H)

		;; **************** Initialize Pin configurations *******************
			;Initialize I/O Port 1 for:
			;  PIN 0 = 1, DCD0              ;; If using debugger SIO 0 is used for communications
			;  PIN 1 = 1, RTS0              ;; to the host.  If not using SIO 0 you can set Pins 0-4
			;  PIN 2 = 1, DTR0      ;; As port pins.  Use ApBUILDER to modify.
			;  PIN 3 = 1, DSR0
			;  PIN 4 = 1, RI0
			;  PIN 5 = 0, OutPort (FLASH Vpp Enable, 0=Enable  1=Disable)
			;  PIN 6 = 0, OutPort (P16_HOLD to EV386EX option header JP7 pin 5)
			;  PIN 7 = 0, OutPort (P17_HLDA to EV386EX option header JP7 pin 3)
	%SetEXRegByte (P1LTC, 0FFH)
	%SetEXRegByte (P1DIR, 00H)
	%SetEXRegByte (P1CFG, 01FH)

			;Initialize I/O Port 2 for:
			;  PIN 0 = 0, OutPort (P20_CS0# to EV386EX option header JP7 pin 11)
			;  PIN 1 = 0, OutPort (P21_CS1# to EV386EX option header JP7 pin 9)
			;  PIN 2 = 1, CS2# (SMRAM)      ;; If not using CS2 can be configured as I/O port 
			;  PIN 3 = 0, OutPort   (No Connect)
			;  PIN 4 = 1, CS4# (DRAM)
			;  PIN 5 = 1, RXD0  input       ;; See note for I/O port 1 pins 0-4
			;  PIN 6 = 1, TXD0  output
			;  PIN 7 = 1, CTS0# input
	%SetEXRegByte (P2LTC, 0FFH)
	%SetEXRegByte (P2DIR, 00H)
	%SetEXRegByte (P2CFG, 0F4H)

			;Initialize I/O Port 3 for:
			;  PIN 0 = 0, InPort JP1 pullup (Downloader: out,0=Bypass  in,1=Execute) (P31_TO0 to EV386EX option header J7 pin 25)
			;  PIN 1 = 0, OutPort  (P31_TO1 to EV386EX option header J7 pin 23)
			;  PIN 2 = 1, OutPort  (P32_I1 to EV386EX option header J7 pin 21)
			;  PIN 3 = 1, INT1  (P33_I5 to EV386EX option header J7 pin 19)
			;  PIN 4 = 1, INT2  (P34_I6 to EV386EX option header J7 pin 17)
			;  PIN 5 = 1, INT3  (P35_I7 to EV386EX option header J7 pin 15)
			;  PIN 6 = 0, InPort (Debugger Break P36_PWRD to EV386EX option header J7 pin 13)
			;  PIN 7 = 1, COMCLK input of 1.8432 Mhz OSC1 oscillator.
	    ;                                   ;; The debugger uses COMCLK as the clocking source for the serial port.
	%SetEXRegByte (P3LTC, 0FFH)
	%SetEXRegByte (P3DIR, 41H)
	%SetEXRegByte (P3CFG, 0B8H)

			; Initialize Peripheral Pin Configurations
			;  PIN 0 = 0, SSIOTX
			;  PIN 1 = 0, SRXCLK
			;  PIN 2 = 1, TXD1
			;  PIN 3 = 0, EOP#/TC
			;  PIN 4 = 0, DACK0#
			;  PIN 5 = 1, Timer2
			;  PIN 6 = 0, GCS6#
			;  PIN 7 = 0, Don't Care
	%SetEXRegByte (PINCFG, 024H)


			;Initialize the Asynchronous Serial Ports
			; Bit 7 = 1, Internal SIO1 modem signals
			; Bit 6 = 0, External SIO0 modem signals
			; Bit 2 = 0, PSCLK for SSIO clock
			; Bit 1 = 0, COMCLK for SIO1 clock
			; Bit 0 = 0, COMCLK for SIO0 clock
	%SetEXRegByte (SIOCFG, 080H)    ;Set clocking and modem control sources.

			;Initialize Timer 0 for:
			; Bit 7 = 0, Timer clocks enabled
			; Bit 5 = 0, Vcc to Gate2
			; Bit 4 = 0, PSCLK to CLK2
			; Bit 3 = 0, Vcc to Gate1
			; Bit 2 = 0, PSCLK to CLK1
			; Bit 1 = 0, Vcc to Gate0
			; Bit 0 = 0, PSCLK to CLK0
	%SetEXRegByte (TMRCFG, 00H)    ;Set input sources.

			;Initialize the DMACFG register for:
			; Bit 7 = 1, Disable DACK1#
			; Bits 6:4 = 100, TMROUT2 connected to DRQ1
			; Bit 3 = 0, Enable DACK0#
			; Bits 2:0 = 000, Pin is conneced to DRQ0
	%SetEXRegByte  (DMACFG, 0C0H)

			;Initialize the INTCFG register for:
			; Bit 7 = 0, Disable CAS lines
			; Bit 3 = 1, Pin is connected to IRQ7
			; Bit 2 = 1, Pin is connected to IRQ6
			; Bit 1 = 1, Pin is connected to IRQ5
			; Bit 0 = 1, Pin is connected to IRQ4
	%SetEXRegByte  (INTCFG, 0FH)

;;;;******** Finished Initializing EV386EX board ********

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -