Maker Pro
Maker Pro

Chinese math?

J

Jan Panteltje

Jan 1, 1970
0
I ordered a graphics and receiveda a 4 line text LCD.
Decided to keep the 4 line text, got it for half the price,
and now also have the graphics.
Hooked up the 4 line text LCD, could not figure out how to address line 3.
So made a slow loop that printed the RAM address while filling up RAM.

So just observed where it started:

#define LINE_1 D'128'
#define LINE_2 D'168'
#define LINE_3 D'148'
#define LINE_4 D'212'

Logic?
 
S

Spehro Pefhany

Jan 1, 1970
0
I ordered a graphics and receiveda a 4 line text LCD.
Decided to keep the 4 line text, got it for half the price,
and now also have the graphics.
Hooked up the 4 line text LCD, could not figure out how to address line 3.
So made a slow loop that printed the RAM address while filling up RAM.

So just observed where it started:

#define LINE_1 D'128'
#define LINE_2 D'168'
#define LINE_3 D'148'
#define LINE_4 D'212'

Logic?

Is it a 40x4 display?


Best regards,
Spehro Pefhany
 
J

John O'Flaherty

Jan 1, 1970
0
I ordered a graphics and receiveda a 4 line text LCD.
Decided to keep the 4 line text, got it for half the price,
and now also have the graphics.
Hooked up the 4 line text LCD, could not figure out how to address line 3.
So made a slow loop that printed the RAM address while filling up RAM.

So just observed where it started:

#define LINE_1 D'128'
#define LINE_2 D'168'
#define LINE_3 D'148'
#define LINE_4 D'212'

Logic?

Were you printing the address to the display in question?
 
J

Jan Panteltje

Jan 1, 1970
0
Is it a 40x4 display?

No, 20 x 4 :)
You need to subtract 128 (bit 7), as that is the RAM address flag,
that leaves the 7 lower bits as the actuall RAM address:
line1 0
line2 40
line3 20
line4 84

The display is the HC200401C-VA.pdf
and the controller, of which I think there are 2, S6A0069.pdf
http://panteltje.com/panteltje/pic/swr_pic/LCD_4x20_2.jpg

I can understand they interleaved the lines from both chips,
but I cannot think of a way to come up with 84, that should have been 60?
 
J

John O'Flaherty

Jan 1, 1970
0
No, 20 x 4 :)
You need to subtract 128 (bit 7), as that is the RAM address flag,
that leaves the 7 lower bits as the actuall RAM address:
line1 0
line2 40
line3 20
line4 84

The display is the HC200401C-VA.pdf
and the controller, of which I think there are 2, S6A0069.pdf
http://panteltje.com/panteltje/pic/swr_pic/LCD_4x20_2.jpg

I can understand they interleaved the lines from both chips,
but I cannot think of a way to come up with 84, that should have been 60?

An interesting thing is that if it were absolute sequential
addressing, the third line should overwrite half of the second. It
must be magic; that's the only logical explanation.
 
S

Spehro Pefhany

Jan 1, 1970
0
No, 20 x 4 :)
You need to subtract 128 (bit 7), as that is the RAM address flag,
that leaves the 7 lower bits as the actuall RAM address:
line1 0
line2 40
line3 20
line4 84

Usually 0x00, 0x40, 0x20, 0x60

Probably if you looked more closely at the HD44780-based chipset and
physical constraints it would make more sense.
The display is the HC200401C-VA.pdf
and the controller, of which I think there are 2, S6A0069.pdf
http://panteltje.com/panteltje/pic/swr_pic/LCD_4x20_2.jpg

I can understand they interleaved the lines from both chips,
but I cannot think of a way to come up with 84, that should have been 60?


Best regards,
Spehro Pefhany
 
J

Jan Panteltje

Jan 1, 1970
0
An interesting thing is that if it were absolute sequential
addressing, the third line should overwrite half of the second. It
must be magic; that's the only logical explanation.

No, it is 20 chars / line, so the third line starts at 20, and ends at 39.
 
P

petrus bitbyter

Jan 1, 1970
0
Jan Panteltje said:
On a sunny day (Sun, 03 Feb 2008 20:38:06 -0500) it happened Spehro
Pefhany


No, 20 x 4 :)
You need to subtract 128 (bit 7), as that is the RAM address flag,
that leaves the 7 lower bits as the actuall RAM address:
line1 0
line2 40
line3 20
line4 84

The display is the HC200401C-VA.pdf
and the controller, of which I think there are 2, S6A0069.pdf
http://panteltje.com/panteltje/pic/swr_pic/LCD_4x20_2.jpg

I can understand they interleaved the lines from both chips,
but I cannot think of a way to come up with 84, that should have been 60?

I see no logic in this sequence. An explanation may be that some
hardware/chip designer was messing up the address lines. Or he used another
"logic" for line four. The first three ones are continous but for line four
only an extra address line is used with respect to line three. Which leaves
a hole that is not uncommon in I/O addressing, though not in RAM adressing.
BTW do you have RAM in the addresses 60-83? And beyond 104?

petrus bitbyter
 
J

Jan Panteltje

Jan 1, 1970
0
I see no logic in this sequence. An explanation may be that some
hardware/chip designer was messing up the address lines. Or he used another
"logic" for line four. The first three ones are continous but for line four
only an extra address line is used with respect to line three. Which leaves
a hole that is not uncommon in I/O addressing, though not in RAM adressing.
BTW do you have RAM in the addresses 60-83? And beyond 104?

If you go beyond 104, 128+104 = 232, so 232 to 255 is the only space left that
can be used, as the MSB must always be one, as the screen was already filled
by then with 'P's I could not say if new 'P's were overwriting the old.

There is nothing going to the display IIRC between line 2 and 3 for 59 to 84,

I did set up a loop 0-127 but was only watching for line3 and line4 start.
The PIC has now been programmed with the real stuff, so I cannot check again
in a simple way.
 
M

Martin Brown

Jan 1, 1970
0
Spehro Pefhany said:
Usually 0x00, 0x40, 0x20, 0x60

Probably if you looked more closely at the HD44780-based chipset and
physical constraints it would make more sense.

There may be an option to support 6 line LCD displays of 20 char. In
which case the full set of 6 magic constants don't look quite so crazy.

0x00, 0 +00, +20, +40
0x00, 64 +00, +20, +40

3 from one bank and 1 from the other still looks odd to me though.
Maybe it shaves $0.01 off the manufacturing cost to do it this way.

Regards,
 
S

Spehro Pefhany

Jan 1, 1970
0
There may be an option to support 6 line LCD displays of 20 char. In
which case the full set of 6 magic constants don't look quite so crazy.

0x00, 0 +00, +20, +40
0x00, 64 +00, +20, +40

3 from one bank and 1 from the other still looks odd to me though.
Maybe it shaves $0.01 off the manufacturing cost to do it this way.

Regards,

At some point, AFIUI, you go to two independent HD44780 controllers,
at which point all reason goes out the window.
 
S

Spehro Pefhany

Jan 1, 1970
0
No, it is 20 chars / line, so the third line starts at 20, and ends at 39.

No. It is 0x13 chars/line so the third line starts at 0x20 and ends at
0x33
 
J

Jan Panteltje

Jan 1, 1970
0
No. It is 0x13 chars/line so the third line starts at 0x20 and ends at
0x33

Sorry, all values I specided ARE IN HUMAN DECIMAL FORM.
line 3 starts at 20 dec, so line 3 holds:
20 'A'
21 'r'
22 'e'
23 ' '
24 'Y'
25 'o'
26 'u'
27 ' '
28 'K'
29 'i'
30 'd'
31 'd'
32 'i'
33 'n'
34 'g'
35 ''
36 'M'
37 'e'
38 '?'
39 '?'
start line 2:
40
 
M

Martin Riddle

Jan 1, 1970
0
Yes that looks correct, First and Third lines are sequential, then second and fourth.

Don't ask why....

Cheers
 
J

John O'Flaherty

Jan 1, 1970
0
Yes that looks correct, First and Third lines are sequential, then second and fourth.

Don't ask why....

But the second and fourth aren't sequential.
 
M

Martin Riddle

Jan 1, 1970
0
John O'Flaherty said:
But the second and fourth aren't sequential.

Your right, some snippets form a 4 line display commonly available:
 
M

Martin Riddle

Jan 1, 1970
0
John O'Flaherty said:
But the second and fourth aren't sequential.

Your right, here is my old code for a 4 line jobber:

/* Display line addresses */

#define LINE1 0x00

#define LINE2 0X40

#define LINE3 0x14

#define LINE4 0x54



Cheers
 
J

Jan Panteltje

Jan 1, 1970
0
Your right, here is my old code for a 4 line jobber:

/* Display line addresses */

#define LINE1 0x00

#define LINE2 0X40

#define LINE3 0x14

#define LINE4 0x54



Cheers

Thank you, confirms I do not have a bad one, they are all like that.
 
S

Spehro Pefhany

Jan 1, 1970
0
Thank you, confirms I do not have a bad one, they are all like that.

All the examples I've seen so far have been symmetrical. If the 4th
line on yours started at 0x50 = 80 it would be more consistent.


Best regards,
Spehro Pefhany
 
Top