[Lcdproc] Re: M. Dupois' MX212 display problems

Peter Marschall peter@adpm.de
Sat Dec 2 23:57:02 2006


Hi Michelle,

please don't "hijack" threads with other otpics as this may make
people not read your posting when they are not interested in the
thread.

On Thursday, 30. November 2006 04:48, Michelle Dupuis wrote:
> Is there anyone at Matrix Orbital who can help out with programming on
> LCDproc?  The MX212 (2-line) driver malfunctions - making a mess of the
> display (starting with the attempt to show graphics characters).

Matrix Orbital kindly provided me with a sample of their products:
a graphical as well as a character display.

The display they sent to me is a LK202-25 with a 3.0 firmware with a 
serial connector.

The display worked flawlessly with the MtxOrb driver shipped with LCDproc 
0.5.1. The driver also works for Ethan Dicks display (I don't remember the 
type) which helped me in debugging the driver.

Although the driver worked without a problem I did not like the way the 
driver's flush() function and so I optimized it to only do one write per row
instead of one write per changed character.
In addition to that I also changed the handling of brightness and contrast
to the way it is done in the CFontzPacket driver. This has the nice side 
effect that you can now change brightness and contrast using the display's
keys at run time.

Today I browsed through the specs of the display you mentioned in you post
and compared it to the implementation of the driver (there were no changes
in these parts of the drivr after 0.5.1).
The driver tries to implement the specification as faithfully as possible:
In order to define a custom character it writes "\xFENyabcdefgh",
where y is the character position (0 - 7) and a - h are the bits indicating 
the pixel rows [see function MtxOrb_set_char()], and then simply
writes y to the LCD to make it appear on the display [see functions
MtxOrb_chr(), MtxOrb_string() and MtxOrb_flush()].

As I stated earlier in this mail, the MtxOrb work flawlessly on at least two 
(E. Dicks and mine) displays that support this command set.

Where do you exactly experience problems ?
Only in the display of graphical characters [i.e. icons, hbars, vbars] ?

Would you mind to try the new code in CVS. Maybe the old "write 1 
char at a time" scheme in flush() overran your display.

If I read the manual correctly, the MX212 is a USB display, isn't it ?
I only have a serial one, so the difference is the connection type:
USB vs. serial. It may be that the setup code in MtxOrb_init() is not
optimal for USB displays. But I can only guess here.

To check, please replace the code between
	tcgetattr(p->fd, &portset);
and
	/* Set port speed */
	
with this code:

	portset.c_iflag &= ~( IGNBRK | BRKINT | PARMRK | ISTRIP
                                        | INLCR | IGNCR | ICRNL | IXON );
	portset.c_oflag &= ~OPOST;
	portset.c_lflag &= ~( ECHO | ECHONL | ICANON | ISIG | IEXTEN );
	portset.c_cflag &= ~( CSIZE | PARENB | CRTSCTS );
	portset.c_cflag |= CS8 | CREAD | CLOCAL;
	portset.c_cc[VMIN] = 0;
	portset.c_cc[VTIME] = 0;

and rebuild LCDd.

Please report your findings

Peter

-- 
Peter Marschall
peter@adpm.de