Hi,
If your code works in ISIS & not in actual circuit, most probably your LCD has different timings than what you set in Proteus. Your PBP translated code works, indicates the same thing.
I've gone through your asm code quickly(havn't run it), here are my suggesitions,
1) Make sure on power-up LCD has atleast 30mSec before it's initialization is started.
2) Make sure there is enough delay between two successive data/command bytes.
To be on the safer side use more delays than what datasheet specifies.
Since you can see the pixel-blocks, there is nothing wrong with contrast settings. Such errors mostly happen due incorrect initializations/timings.
Also if you are using 16x4 LCD in place of 16x2, you'll simply miss the 3rd & 4th line display, but in that case also you should see everything on 1st & 2nd line.
Hope that helps. If you still having problems I'll post a example with C which you can easily convert to ASM.
reagrds,
sam_des
Hi spurs21 ,
The contrast is fine when you see some thing on the LCD. The problem is the delay. When you initial the LCD, you need to delay long enough so the CMD you write to the LCD get stored.
By look at the LCD initial sub, it call the "retardo". The "retardo" loops through the loop and return. You can change the delay timming by increase one (or all three) variable. Take a look at the "retardo".
retardo
movlw 0x01 ; Put 01 in to W reg
movwf CONTA0 ; move to CONTA0
ret2
movlw 0x64 ; Put 64 in to W reg (TRY TO CHANGE 0X64 TO 0XB0 TO SEE)
movwf CONTA1 ; move to CONTA1 (may be too long)
ret1
movlw 0x64 ; Put 64 in to W reg
movwf CONTA2 ; move to CONTA2
ret0
decfsz CONTA2,F ; This loop will decrease CONTA2 to zero
goto ret0
decfsz CONTA1,F ; This loop will decrease CONTA1 to zero
goto ret1
decfsz CONTA0,F ; This loop will decrease CONTA0 to zero
goto ret2
return
; Note: Try to increase CONTA1 to larger number (<255) to increase delay time. Or you can increase
; CONTA0. Play with those Vars to get delay long enough.
;///////////////////////////////////////////
Remember, Proteus can never subtitude for real hardware, it can be use to test your design in the early stage. However, only real hardware can solve the problem.
The "Ini_LCD" sub look Ok with the CMD. I suggest you to play with the delay until you see some characters.
Tom