Hello Garth,
we have exchanged emails in past.
My 6502 code works flawlessly with Hitachi HD44780 LCD controller.
The problem is that Newhaven display is using a new Sitronics ST7066U LCD controller.
They are supposed to be equivalent, since the new Sitronics chip copied the Hitachi specs to the letter, passing the specs as their own. I think this is the problem, these chips are not equivalent.
The problem I have with using my 6502 program to operate Sitronics LCD controller is that I can't get the second 8 characters of 1*16 display show in second half of the display. They will always show in first half, overwriting what should be there. Second half of the display will be blank, no matter what.
To pinpoint the problem, I cannot direct the starting line of second half of display to location #$C0.
In MicroEngineering Labs PicBasic, this is no problem at all. Apparently, they have figured a way to do is somehow, in spite of bed Sitronics specs.
PicBasic code to control mu LCD is very simple, here are pertinent parts:
DEFINE LCD_DREG PORTB ' data = portB
DEFINE LCD_RSREG PORTA ' Register Select = portA
DEFINE LCD_RSBIT 1 ' RS
DEFINE LCD_EREG PORTA ' Enable
DEFINE LCD_EBIT 2 ' Enable
DEFINE LCD_BITS 8 ' 8-bit bus
DEFINE LCD_LINES 2 ' 2 line display
DEFINE LCD_COMMANDUS 10000 '
DEFINE LCD_DATAUS 100 '
.
.
.
Lcdout $FE,1
' PAUSE 250 ' don't need the pause
Lcdout $FE,128, disbuf, disbuf5, disbuf6, disbuf7, disbuf8, disbuf9, disbuf10, disbuf11
Lcdout $FE,192, disbuf12, disbuf13, disbuf14, disbuf15, disbuf16, disbuf17, disbuf18, disbuf19
By the way, I have R/W pin grounded, since I do not read the busy flag, I have enough delays there.
If I had Microchip version of this in assembler, I would easily convert it to 6502 assembler.
You mention you could send me PIC 16 assembler version, that would be a great help!
Here is the email:
ic@automatedsonix.comI need to make it work since I have no plans to replace 6502 with PIC microcontroller for my bigger, existing products. 6502 work works very well in industrial applications, since I have started using old Rockwell NMOS '02 and '22. They are practically indestructible. I have bought a lots of these old chips. CMOS chips are too sensitive to electric spikes, that are commonplace it heavy industry. I don't use WDC chips any longer.
Regards,
Ike Cagan