Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - icagan

Pages: [1]
1
Character LCDs / Re: Controlling 1x16 character display NHD-0116GZ.
« on: May 21, 2014, 11:03:55 AM »
I still have to go the Basic example provided on this site.
Here is what the instruction write subroutine looks like:
.................................
Sub Writecom
P1 = A
Reset P3.0              'instruction
Set P3.4                 'E
Set P3.7                 'RW  <<<<<==================
Waitms 1
Reset P3.4              'E
Reset P3.7              'RW
End Sub
...................................

First, the code resets D/I, indicating this will be Instruction sent to LCD controller.
Then, Enable is set.
Then Read/Write is set, indicating this is READ instruction? Should not this be WRITE to LCD controller?
Then, Enable is reset, at this time the instruction is sent to LCD controller, as a READ.
We are not really reading from LCD controller, we are writing the instruction to it.
I would appreciate clarification of this.

2
Character LCDs / Re: Controlling 1x16 character display NHD-0116GZ.
« on: May 14, 2014, 01:38:20 PM »
Hello Michael,
thank you for your prompt and encouraging reply.
I did see the samples you mention, printed them a while ago.
I have been programming all of this, except for one thing:
I have the R/W pin grounded, since I don't need to read anything from the LCD.
I just use adequate delays so don't need to check busy flag.
I only write to it, so R/W=0.
It is not clear to me why I would need to set R/W, here is the segment:
.................................
Sub Writecom
P1 = A
Reset P3.0              'instruction
Set P3.4                 'E
Set P3.7                 'RW  <<<<<==================
Waitms 1
Reset P3.4              'E
Reset P3.7              'RW
End Sub
...................................

Is setting the R/W in the above subroutine really necessary? If it was that would actually be great as it would solve my problem.
By the way, Hitachi controller did not required it.
Regards,
Ike

3
Character LCDs / Controlling 1x16 character display NHD-0116GZ.
« on: May 13, 2014, 09:24:34 PM »
I had been programming and using 1x20 character LCD displays for some 30 years, never had ANY single problem. These were Optrex, Samsung and others, all based on Hitachi LCD controller.
Too bad they are no longer available, I have to use this dreadful Newhaven 1x16.
The specific problem is: I cannot display 2nd line of 8 characters. No matter what I do.
It seems there is some flaw with the Sitronics LCD controller.
All the sample programs that they show do not work. Meaning, I can't make them work. None explain how to start 2nd line, address hexC0.
No matter how I change the initialization, the second 8 characters are always blank.
I guess the sample programs were written by people who did not have to make them work. None of them show how to get the second 8 characters started.
I use two types of microprocessors, 65C02 and Microchip PIC.
I program PIC in MicroEngineering Labs PicBasic. It works perfectly.
I guess they went through the agony of finding the way through Sitronics bugs.
They always put in the starting line address hex80 and hexC0.
When I send this instruction in 65C02 assembly language, it gets ignored.
If I could get to assembler language output of PicBasic, then I would be able to convert it to 65C02 assembly code. Unfortunately, that is not possible.
Any suggestion would be appreciated.
Please, no C code, I don't know that.

Pages: [1]