please dont rip this site

VGA Monitor tester with SX chip.

By Alberto Geraci.

This simple software makes a color bar or cross-hatch pattern on PC VGA or SVGA monitor. Its very simple just look at the circuit for all pin definitions.

The pins ra.0 to ra.2 are the respective outs for blue, red and green signals, and rb.0 and rb.1 the sync H and V. The rb.3 pin is used to change the mode, from bars, to cross-hatch.

Really, there is not too much that I can say about the project; the SX software generates all the signals, keeping count of the clock cycles. Look at the code and you'll have a better idea of how it works.

I'm using it to test many monitors, and it gives me a good result. I have found that in some cheap Samsung or Goldstar monitors there is a difference in the V size.

You can put it all together in a little box to bring it with you in your pocket.

Good Luck !

;*****************************************************************************************
; 
; Filename:	VGA Monitor tester.src
;
; Author:	Alberto Geraci
;		BTX Sistemas	
;		Argentina.
;		
; Revision:	1.01
;
; Freq:		50MHz
;
; Compiled using: SX-Key.
;
; Date Written	: January 16, 2002
;
; Last Revised	: January 25, 2002
;
; Program Description:
;
;		Super Simple !! VGA Monitor tester
;		Simple project to demostrate the SX power running at 50Mhz
;		It generates color bars and white lines in 640x480 mode.
;
; Interface Pins:
;		
;	 azul = ra0 = pin 1
;	 rojo = ra1 = pin 3
;	 verde= ra2 = pin 2
;
;	 H sync = rb0 = pin 13
;	 V sync = rb1 = pin 14
;*****************************************************************************************
;
		DEVICE	SX18L,OSCHS3,TURBO,stackx_optionx,protect
		RESET	Start
		FREQ 	50_000_000
counter		equ	$08
repeat		equ	$09
times		equ	$0A
lazo		equ	$0B

Start		mov	ra, #%00000000
		mov	!ra,#%11110000
		mov	rb, #%00000011
 		mov	!rb,#%00001000
		mov	w,#$0E
		mov	M,w
 		mov	!rb,#%11110111
		mov	w,#$0F
		mov	M,w
org 20
;
; MACROS
; 
;*** MACRO VSYNC ****************************************************************************************
vsync	MACRO		;3180  cycles	; 63.6 uSeg    ;; 28 + 3.8 + 28 + 3.8 ;;1400+190+1399+191
	;********** PULSO DE SINCRO V *******************************************************************
		clrb	rb.1		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#174	; 2 cycles
	:pupV1	nop
		nop			; 1 cycle
		nop			; 1 cycle
		decsz	counter	; 1 cycle	;
		jmp	@:pupV1
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupH2	decsz	counter	; 1 cycle	;
		jmp	@:pupH2		; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		mov	counter,#175	; 2 cycles
	:pupV2	nop
		nop			; 1 cycle
		nop			; 1 cycle
		decsz	counter	; 1 cycle	;
		jmp	@:pupV2		; 4 cycles
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupH3	decsz	counter	; 1 cycle	;
		jmp	@:pupH3		; 4 cycles	; 
	;************************************************************************************************
		mov	rb,#%00000011	; 2 cycles
	;************************************************************************************************
	ENDM
;********************************************************************************************************
;********************************************************************************************************
Barras
	; ******  ahora tengo que hacer portico delantero vertical **************************************
	mov	times,#2
jtama	call @linea_vac2
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@jtama			
	; ***********************************************************************************************
	; ******  ahora tengo que hacer sincro  vertical ************************************************
	vsync
	; ***********************************************************************************************
	; ******  ahora tengo que hacer 33 lineas de portico superior y comienzo *************************
	mov	times,#19
	jmp	@jcc
jcc	nop
	nop
jtama2	call @linea_vac
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@jtama2
	; ***********************************************************************************************
	; ******  ahora tengo que hacer 240 lineas de video *********************************************
	mov	times,#254
	nop
jtama3	call @linea
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@jtama3
	; ***********************************************************************************************
	; ******  ahora tengo que hacer 8 lineas de parte inferior de pantalla **************************
	mov	times,#8
	nop
jtama5	call @linea_vac
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@jtama5
	; ***********************************************************************************************
	sb	$06.3
	jmp	@Barras
;********************************************************************************************************
;********************************************************************************************************
Cross_hatch
	; ******  ahora tengo que hacer portico delantero vertical **************************************
	mov	times,#2
otama	call @linea_vac2
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@otama			
	; ***********************************************************************************************
	; ******  ahora tengo que hacer sincro  vertical ************************************************
	vsync
	; ***********************************************************************************************
	; ******  ahora tengo que hacer 19 lineas de portico uperior y comienzo *************************
	mov	times,#21
	jmp	@cc
cc	nop
	nop
otama2	call @linea_vac
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@otama2
	; ***********************************************************************************************
	; ******  ahora tengo que hacer 254 lineas de video *********************************************
	mov	times,#1
	nop
ftama20	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama20

	mov	times,#30
	nop
ftama1	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama1
	mov	times,#1
	nop
ftama2	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama2

	mov	times,#30
	nop
ftama3	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama3

	mov	times,#1
	nop
ftama4	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama4

	mov	times,#30
	nop
ftama5	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama5
	mov	times,#1
	nop
ftama6	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama6

	mov	times,#30
	nop
ftama7	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama7
	mov	times,#1
	nop
ftama8	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama8

	mov	times,#30
	nop
ftama9	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama9
	mov	times,#1
	nop
ftama10	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama10

	mov	times,#30
	nop
ftama11	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama11
	mov	times,#1
	nop
ftama12	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama12

	mov	times,#30
	nop
ftama13	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama13
	mov	times,#1
	nop
ftama14	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama14

	mov	times,#30
	nop
ftama15	call @crossh
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama15
	mov	times,#1
	nop
ftama16	call @crossv
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@ftama16

	; ***********************************************************************************************
	; ******  ahora tengo que hacer 8 lineas de parte inferior de pantalla **************************
	mov	times,#11
	nop
otama5	call @linea_vac
	decsz	times	; cuando termino salgo perdiendo 5 cycles del decsz y del ret
	jmp	@otama5
	; ***********************************************************************************************
	snb	$06.3
	jmp	@Cross_hatch
	jmp	@Barras
;
;
org	600
;********************************************************************************************************
;********************************************************************************************************
;**** FUNCION CROSSH *************************************************************************************
; 1400 cycles  ;28 uSeg + 3.8 del sincro ; 
; tambien lleva el sicro H esta. Y las barras de color
; 90 portico delantero ; 1284 de video ; 26 portico trasero
	;************************************************************************************************
crossh	mov	counter,#15		; 2 cycles      ; delantero
	:clupit	decsz	counter	; 1 cycle	;
		jmp	@:clupit 	; 4 cycles	; 
		jmp	@:provi3
	;************************************************************************************************
	; Aca me quedan 1284 cycles para dibujar las barras 160 cycles cada una +2+2 ********************
	:provi3	nop			; 1 cycle
		nop			; 1 cycle
		mov	repeat,#9
	:zir	mov	ra,#%11110111	; 2 cycles
		jmp	@:cirix
	:cirix	mov	ra,#%11110000	; 2 cycles
	mov	counter,#26		; 2 cycles      ; delantero
	:cir2	decsz	counter	; 1 cycle	;
		jmp	@:cir2 		; 4 cycles	; 
		decsz	repeat		; 1 cycle	;
		jmp	@:zir 		; 4 cycles	; 
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 
	;************************************************************************************************
	;************************************************************************************************
	mov	counter,#5		; 2 cycles      ; delantero
	:clupi2	decsz	counter	; 1 cycle	;
		jmp	@:clupi2 	; 4 cycles	; 
		nop			; 1 cycle
		nop			; 1 cycle
	;************************************************************************************************
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupH1	decsz	counter	; 1 cycle	;
		jmp	@:pupH1		; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		ret
;********************************************************************************************************
;
;
;********************************************************************************************************
;**** FUNCION CROSSV *************************************************************************************
; 1400 cycles  ;28 uSeg + 3.8 del sincro ; 
; tambien lleva el sicro H esta. Y las barras de color
; 90 portico delantero ; 1284 de video ; 26 portico trasero
	;************************************************************************************************
crossv	mov	counter,#15		; 2 cycles      ; delantero
	:cvupit	decsz	counter	; 1 cycle	;
		jmp	@:cvupit 	; 4 cycles	; 
		jmp	@:provi
	:provi	jmp	@:provi2
	;************************************************************************************************
	; Aca me quedan 1284 cycles para dibujar las barras 160 cycles cada una +2+2 ********************

	:provi2	mov	ra,#%11110111	; 2 cycles
	mov	counter,#160		; 2 cycles      ; delantero
	:cxr2	nop
		nop
		nop
		decsz	counter	; 1 cycle	;
		jmp	@:cxr2 		; 4 cycles	; 
		mov	ra,#%11110000	; 2 cycles
		nop			; 1 cycle
		nop			; 
	;************************************************************************************************
	;************************************************************************************************
	mov	counter,#5		; 2 cycles      ; delantero
	:cvupi2	decsz	counter	; 1 cycle	;
		jmp	@:cvupi2 	; 4 cycles	; 
		nop			; 1 cycle
		nop			; 1 cycle
	;************************************************************************************************
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:vupH1	decsz	counter	; 1 cycle	;
		jmp	@:vupH1		; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		ret
;********************************************************************************************************
; 
; 
org 700
;********************************************************************************************************
;********************************************************************************************************
;**** FUNCION LINEA_VAC ***************************************************************************************
		; 1400 cycles  ;28 uSeg + 3.8 del sincro ; 
; tambien lleva el sicro H esta.
	;************************************************************************************************
linea_vac	mov	counter,#174	; 2 cycles      ; iba 173 pero con 174 anda mejor (revisar)
	:dlupL4	nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
		decsz	counter	; 1 cycle	;
		jmp	@:dlupL4	; 4 cycles	; 
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle	; 
		nop			; 1 cycle
	;************************************************************************************************
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupH1	decsz	counter	; 1 cycle	;
		jmp	@:pupH1		; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		ret
;********************************************************************************************************
;
;
;**** FUNCION LINEA_VAC2 ***************************************************************************************
; 1400 cycles  ;28 uSeg + 3.8 del sincro ;  
; volver de la ultima sub de linea_vac  ( es decir esta se usa para hacer el jmp al main )
; tambien lleva el sicro H esta.
	;************************************************************************************************
linea_vac2	mov	counter,#174	; 2 cycles
	:dlupv4	nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
		decsz	counter	; 1 cycle	;
		jmp	@:dlupv4	; 4 cycles	; 
		nop			; 1 cycle
	;************************************************************************************************
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupvH1	decsz	counter	; 1 cycle	;
		jmp	@:pupvH1	; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		ret
;********************************************************************************************************
;
;
;**** FUNCION LINEA *************************************************************************************
; 1400 cycles  ;28 uSeg + 3.8 del sincro ; 
; tambien lleva el sicro H esta. Y las barras de color
; 90 portico delantero ; 1284 de video ; 26 portico trasero
	;************************************************************************************************
linea	mov	counter,#15		; 2 cycles      ; delantero
	:lupit	decsz	counter	; 1 cycle	;
		jmp	@:lupit 	; 4 cycles	; 
		nop			; 1 cycle	; 
		nop			; 1 cycle
		nop			; 1 cycle
		nop			; 1 cycle
	;************************************************************************************************
	; Aca me quedan 1284 cycles para dibujar las barras 160 cycles cada una +2+2 ********************
		nop			; 1 cycle
		nop			; 1 cycle
		; ** BARRA *****************************************************************
		mov	ra,#%11110000	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar1		; 4 cycles
	:bar1	decsz	counter	; 1 cycle	;
		jmp	@:bar1 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110001	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar2		; 4 cycles
	:bar2	decsz	counter	; 1 cycle	;
		jmp	@:bar2 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110010	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar3		; 4 cycles
	:bar3	decsz	counter	; 1 cycle	;
		jmp	@:bar3 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110011	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar4		; 4 cycles
	:bar4	decsz	counter	; 1 cycle	;
		jmp	@:bar4 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110100	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar5		; 4 cycles
	:bar5	decsz	counter	; 1 cycle	;
		jmp	@:bar5 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110101	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar6		; 4 cycles
	:bar6	decsz	counter	; 1 cycle	;
		jmp	@:bar6 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110110	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar7		; 4 cycles
	:bar7	decsz	counter	; 1 cycle	;
		jmp	@:bar7 		; 4 cycles	; 
		; ** BARRA *****************************************************************
		mov	ra,#%11110111	; 2 cycles
	mov	counter,#31		; 2 cycles      ; delantero
		jmp	@:bar8		; 4 cycles
	:bar8	decsz	counter	; 1 cycle	;
		jmp	@:bar8 		; 4 cycles	; 
		mov	ra,#%11110000	; 2 cycles
	;************************************************************************************************
	;************************************************************************************************
	mov	counter,#5		; 2 cycles      ; delantero
	:lupi2	decsz	counter	; 1 cycle	;
		jmp	@:lupi2 	; 4 cycles	; 
		nop			; 1 cycle
		nop			; 1 cycle
	;************************************************************************************************
	;********** PULSO DE SINCRO H *******************************************************************
		clrb	rb.0		; 1 cycle	; bajo el bit 6 ( comienza el pulso de sync )
		mov	counter,#38	; 2 cycles
	:pupH1	decsz	counter	; 1 cycle	;
		jmp	@:pupH1		; 4 cycles	; 
		setb	rb.0		; 1 cycle	; subo el bit 6 ( termina el pulso de sync )
	;************************************************************************************************
		ret
;********************************************************************************************************
;********************************************************************************************************


file: /Techref/scenix/sxvgatst/index.htm, 20KB, , updated: 2005/6/19 09:13, local time: 2024/11/26 01:28,
TOP NEW HELP FIND: 
3.131.13.24:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://ecomorder.com/techref/scenix/sxvgatst/index.htm"> VGA Monitor tester with SX chip. </A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to ecomorder.com!

 

Welcome to ecomorder.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .