Hi
wp100 thanks a lot
but I wanna instruction set to gLCD_init in assembly!
for example you send 0x30 to LCD for 8bit lcd! or send 0x01 to clear display! but what instruction must be send to glcd?
thanks
What you need to do is to write a routine that converts an 8 bit number (ie 65 - A) to its decimal equivalent and then send the correct ascii code for each digit of the conversion to the display.Hi
oh! another question!
you now the ascii of 'A' is 65! I wanna show 65 on LCD not 'a'! but I don't know how to do it!
thanks
frist we send 0...3 bits on register f to port B!right?
ok! but 4...7 bits on register f are 0 so RB0...RB3 will be 0 and this is my problem!because I wanna use RB2,RB3 for other instructions!
you now the ascii of 'A' is 65! I wanna show 65 on LCD not 'a'! but I don't know how to do it!
Hundreds equ 0x20
Tens equ 0x21
units equ 0x22
working equ 0x23
numtocon equ 0x24
count equ 0x25
ORG 0x0000 ;reset vector
goto start
Start
clrf Hundreds
clrf Tens
clrf Units
movlw d'159' ;load w with the number to covert
movwf numtocon ;save the number in variable
movlw d'8'
movwf count
ShiftLoop
;test lowerbcd
movfw units
andlw b'1111'
movwf working
movlw d'5'
subwf working,0
SKPC
Goto TestUpperNibble
movlw d'3'
addwf units
TestUpperNibble
movfw units
andlw b'11110000'
movwf working
movlw H'50'
subwf working,0
SKPC
goto Shiftbit
movlw H'30'
addwf units
shiftbit
rlf units,1
rlf hundreds,1
SKPNC
bsf hundreds,0
rlf numtocon,1
SKPNC
bsf Units,0
decfsz count
goto ShiftLoop
movfw Units
Movwf Tens
swapf Tens,1
movlw b'1111'
andwf Units,1
andwf Tens,1
movlw d'48'
addwf Hundreds
addwf Tens
addwf Units
;your code here to display variables on LCD
loop
goto loop
end
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?