;//////////////////////////////////////////////////////////////////////// ;/ ;/ LCD controlling code ;/ ;/ lcd_control - write to both display control chips ;/ lcd_set_column - set the start address for the display ;/ lcd_set_cursor - position the text cursor ;/ lcd_write - write to the display based on 'column' ;/ lcd_init - reset the display and clear it ;/ lcd_cls - clear the display ;/ lcd_scroll - move the cursor to the next line ;/ lcd_char - write a character to the display ;/ lcd_string - write a zero-terminated string to the display ;/ ;/////////////////////////////////////////////////////////////////////// ;this version is for the built-in elcd backlight driver ;pinout for the display: ; ;1 Vss (ground) ;2 Vdd (+5v logic) ;3-10 D0-7 ;11 R/~W ;12 E1 (enable for ic1) ;13 A0 ;14 E2 (enable for ic2) ;15 ELCNT (high to enable backlight) ;16 EL+ (backlight power 5v) .def arg0 = r16 ;general registers when not used by mult/div .def arg1 = r17 ; .def arg2 = r18 ; .def arg3 = r19 ; ;*************************************************************************** ;* Port Pin Assignments ;*************************************************************************** ; pc0-7 d0-7 ; pa7 elcnt (backlight control) ; pa6 e2 ; pa5 a0 ; pa4 e1 ; pa3 r/~w .equ rw = pa3 .equ e1 = pa4 .equ a0 = pa5 .equ e2 = pa6 .equ elcnt = pa7 ;/ lcd_control - write commands to both LCD controllers ;/ - generally, we want both controllers in the same mode ;/ - arg0 destroyed lcd_control: push arg1 ldi arg1,0xff out ddrc,arg1 ;port c all op ldi arg1,1<