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

📄 vgastop.asm

📁 Scart To Tv 的源代码,作为接口转换是个很好的参考代码
💻 ASM
字号:
		title	"VGA/15khz RGB detector by Tim Worthington"
	; 15/7/04
	; pin 5 = Horizontal sync input
	; pin 6 = Logic output (high < 17KHz > low)
	; pin 7 = inverted logic output (low < 17KHz > high)
	; pin 2 = same as pin 7

		processor	12c509
		__config 0xfea
w		equ	0
f		equ	1
gpio		equ	0x06
tmr0		equ	0x01
cycount		equ	0x0c
status		equ	0x03

		org	0x000
		movlw	b'10101000'
		option
		movlw	b'00001100'
		tris	gpio
		clrf	gpio

start		clrf	tmr0
wait		btfss	tmr0, 1		;wait for a h-sync pulse
		goto	wait
		clrf	cycount
		clrf	tmr0
do		incf	cycount, f	;increase cycount every 4 uS
		btfss	tmr0, 3		;count 8 h-sync pulses
		goto 	do
		movlw	d'116'		;h-sync_cut_off(in uS) * h-sync_pulses_counted / cycount_time(in uS)
					;58(17.2khz) * 8 / 4
		subwf	cycount, w
		btfss	status, 0
		goto	block
		movlw	b'00000010'
		movwf	gpio		;pass
		goto 	start
block		movlw	b'00100001'
		movwf	gpio		;block
		goto	start
		end	

⌨️ 快捷键说明

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