; testlcd.asm ; hardware: TWO LINE MINI-TERMINAL board ; ;EQUATES portb equ $1004 portc equ $1003 ddrc equ $1007 bprot equ $1035 option equ $1039 init equ $103D org $F800 ; initlcd: fcb $38,$38,$38,$01,$02,$06,$0C,$10,$80 ;Bitmap associated to new characters pattern: fcb $00,$0c,$06,$03,$06,$0c,$00,$00 ; fast forward fcb $00,$06,$0c,$18,$0c,$06,$00,$00 ; rewind fcb $00,$1b,$1b,$1b,$1b,$1b,$00,$00 ; pause fcb $00,$08,$0c,$0e,$0c,$08,$00,$00 ; play fcb $00,$00,$1f,$0e,$04,$00,$00,$00 ; down fcb $00,$00,$04,$0e,$1f,$00,$00,$00 ; up fcb $00,$12,$16,$1e,$16,$12,$00,$00 ; begin fcb $00,$09,$0d,$0F,$0d,$09,$00,$00 ; end line1: fcc "* LCD Test... *"; prompt line 1 line2: fcb $00,$01,$02,$03,$04,$05,$06,$07 ;prompt line 2 reset: ldaa #$01 staa init ldaa #$33 staa option ldaa #$1f staa bprot ldaa #$ff staa ddrc nop jsr lcdini bra * wait: ldy #$1800 psha ldaa #$55 staa $103a ldaa #$aa staa $103a pula wait1: dey bne wait1 rts lcdini: ldx #initlcd again: ldaa $00,X jsr lcdctrl ; send the init table in the LCD jsr wait ; CONTROL register inx cpx #pattern bne again ldaa #$40 ; send $40 to control register jsr lcdctrl ; ($40 =start address ACGRAM) jsr wait again2: ldaa $00,X ; init characters jsr lcdchar jsr wait ; send the table in data register inx ; of the LCD cpx #line1 bne again2 ldaa #$80 ; send $80 to LCD control Register jsr lcdctrl ; ($80 = start address ADDRAM) jsr wait again3: ldaa $00,X ; Welcome message jsr lcdchar jsr wait ; send line1 welcome message into inx ; data LCD register cpx #line2 bne again3 ldaa #$c0 ; Change to the 2nd line jsr lcdctrl jsr wait again4: ldaa $00,X jsr lcdchar jsr wait ; send line1 welcome message into inx ; data register of the LCD cpx #reset bne again4 rts lcdchar: psha ; Send A to the LCD ldaa portc ; oraa #$04 ; data -> ALCD=1 bra lcdctrl1 lcdctrl: psha ;control -> ALCD=0 ldaa portc anda #$fb lcdctrl1: staa portc pula staa portb ; Port B ldaa portc ; oraa #$08 ; ELCD = 1 staa portc anda #$f7 ; ELCD = 0 staa portc rts noirq: rti org $FFD6 fdb noirq *SCI fdb noirq *SPI fdb noirq *Pulse A IN fdb noirq *Pulse A Overflow fdb noirq *Timer Overflow fdb noirq *Timer IC4/OC5 fdb noirq *Timer OC4 fdb noirq *Timer OC3 fdb noirq *Timer OC2 fdb noirq *Timer OC1 fdb noirq *Timer IC3 fdb noirq *Timer IC2 fdb noirq *Timer IC1 fdb noirq *Real-time Int fdb noirq *IRQ Pin/handshake fdb noirq *XIRQ Pin fdb noirq *SWI fdb reset *Illegal Opcode fdb reset *COP Failure RST fdb reset *CLOCK Fail RST fdb reset *RESET