Page 13 of 13

Re: First thought on an interface (to use Paleolithic DROM)

Posted: Sun Jul 20, 2025 7:37 pm
by BigDumbDinosaur
barnacle wrote:
I gloat!

Success has crowned my very efforts!

(bonus points if you can identify the source of those quotes without recourse to a search engine :) )

I vaguely remember seeing that phrase on a site associated with (or perhaps fixated with) Nixie tubes.  No idea, though, as to who posted it.

Re: First thought on an interface (to use Paleolithic DROM)

Posted: Sun Jul 20, 2025 7:50 pm
by barnacle
If nixie, it's quite likely it was posted by me :D And probably the other one, too.

It's from Gilbert and Sullivan's Iolanthe.

Neil

Re: First thought on an interface (to use Paleolithic DROM)

Posted: Mon Jul 21, 2025 2:33 pm
by barnacle
Running code on the board, entered using the keypad. A simple timer (runs slightly fast but it's just loop counting). It turns out that the code takes ~914us for each refresh cycle, so it counts 1094 ticks between each second update. This is just a simple 'something you can enter' code; a later version will use the 6522 to talk to the IRQ both to provide a constant LED/keypad update and provide a regular system tick, but I can't do that until I've soldered some diodes on Paleolithic as otherwise it trashes the LED patterns.
IMG_20250721_161904.jpg

Code: Select all

                        ; routines and addresses from vbios
ffd2 =                  convert		equ	$ffd2
9800 =                  led_addr	equ $9800
00f6 =                  leds		equ $f6
                        
0446 =                  maxtick		equ 1094	; time measured with oscilloscope!
                        
                        	bss
0000 =                  	org $0
0000 =                  ticks		ds 2
0002 =                  secs		ds 1
0003 =                  mins		ds 1
0004 =                  hours		ds 1
                        
                        
                        	code
0200 =                  	org $200
                        	; initialise the processor
0200 : f8               	sed					; we want decimal mode
0201 : a2ff             	ldx #$ff
0203 : 9a               	txs
                        	; clear the blank LEDs
0204 : 64f8             	stz leds+2
0206 : 64fb             	stz leds+5
0208 : 6402             	stz secs
020a : 6403             	stz mins
020c : 6404             	stz hours
020e :                  reset:
020e : a946             	lda # lo maxtick
0210 : 8500             	sta ticks
0212 : a904             	lda # hi maxtick
0214 : 8501             	sta ticks+1
0216 :                  main:
0216 : a007             	ldy #7				; the counter
0218 :                  loop:	
0218 : b9f600           	lda leds,y			; read the current LED pattern
021b : 990098           	sta led_addr,y		; put it in the current LED
021e : a200             	ldx #0				; now starting on the left
0220 : a504             	lda hours
0222 : 20d2ff           	jsr convert			; place the hours
0225 : e8               	inx					; skip the space
0226 : a503             	lda mins
0228 : 20d2ff           	jsr convert			; place the minutes
022b : e8               	inx					; skip the space
022c : a502             	lda secs
022e : 20d2ff           	jsr convert			; and place the seconds
0231 : 88               	dey
0232 : 10e4             	bpl loop			; until all LEDs drawn
                        	
                        	; now count the ticks
0234 : c600             	dec ticks
0236 : d0de             	bne main
0238 : c601             	dec ticks+1
023a : 10da             	bpl main			; we haven't got to a second yet
023c : 18               	clc					; but now we have
023d : a502             	lda secs
023f : 6901             	adc #1
0241 : 8502             	sta secs
0243 : c960             	cmp #$60			; we're adding in decimal mode!
0245 : d0c7             	bne reset			; not 60, then back
                        	
0247 : a900             	lda #0		
0249 : 8502             	sta secs			; else reset the seconds
024b : 18               	clc
024c : a503             	lda mins
024e : 6901             	adc #1
0250 : 8503             	sta mins
0252 : c960             	cmp #$60			; and the same for minutes
0254 : d0b8             	bne reset
                        	
0256 : a900             	lda #0
0258 : 8503             	sta mins
025a : 18               	clc
025b : a504             	lda hours
025d : 6901             	adc #1
025f : 8504             	sta hours
0261 : c924             	cmp #$24			; and hours
0263 : d0a9             	bne reset
                        	
0265 : a900             	lda #0				; else finally reset hours
0267 : 8504             	sta hours
0269 : 80a3             	bra reset
Neil

edit: corrected loop timing