HD44780 modules and Cerberus

… does it works ? With last beta and previous beta 4.2 I can’t use. With Hydra it is working fine.
Any suggestion ?

Yes it does work…or it should :slight_smile:

There was some reports of corrupted characters on teh didplay. I think crberus handles GPIO very fast that is causing problems for the display.

  1. did you use our display or this is your own display?
  2. can you try to take the driver from codepleax and add some delays in it, or step through the driver (stepping is making the code run slow)? This should help http://wiki.tinyclr.com/index.php?title=Gadgeteer_Driver_Modification

Let us know how it goes

Thank you Gus. I suspected what you say. I will look in the driver., that i’ve just modified for 4 row display.I have 3 different LCD but same problem on all of them.

It seems that it’s too fast the Enable signal.
The modification to the driver down here solves the problem.


        private void SendCmd(byte c)
        {
            LCD_RS.Write(false); //set LCD to data mode

            LCD_D7.Write((c & 0x80) != 0);
            LCD_D6.Write((c & 0x40) != 0);
            LCD_D5.Write((c & 0x20) != 0);
            LCD_D4.Write((c & 0x10) != 0);
            LCD_E.Write(true); 
            Thread.Sleep(1); 
            LCD_E.Write(false); //Toggle the Enable Pin

            LCD_D7.Write((c & 0x08) != 0);
            LCD_D6.Write((c & 0x04) != 0);
            LCD_D5.Write((c & 0x02) != 0);
            LCD_D4.Write((c & 0x01) != 0);
            LCD_E.Write(true); 
            Thread.Sleep(1); 
            LCD_E.Write(false); //Toggle the Enable Pin
            LCD_RS.Write(true); //set LCD to data mode
        }

..
        public void Putc(byte c)
        {
            LCD_D7.Write((c & 0x80) != 0);
            LCD_D6.Write((c & 0x40) != 0);
            LCD_D5.Write((c & 0x20) != 0);
            LCD_D4.Write((c & 0x10) != 0);
            LCD_E.Write(true);
            Thread.Sleep(1);
            LCD_E.Write(false); //Toggle the Enable Pin

            LCD_D7.Write((c & 0x08) != 0);
            LCD_D6.Write((c & 0x04) != 0);
            LCD_D5.Write((c & 0x02) != 0);
            LCD_D4.Write((c & 0x01) != 0);
            LCD_E.Write(true);
            Thread.Sleep(1);
            LCD_E.Write(false); //Toggle the Enable Pin
        }

But it’s a shame that each character need 2ms to be written … this need a better delay manager.

Does a thread.sleep(0) help?

Why not? I’ll give it a try. The uS needed can be enough.

@ Brett - Thread.Sleep(0) seems to be good enough. But need about 20ms delay in the Clear() function.


...
        public void Clear()
        {
            SendCmd(CLR_DISP);
            Thread.Sleep(20);
        }


Someone ought to put a logic analyzer on this, because it’s my understanding that a 1ms delay isn’t theoretically possible… the thread quanta for NETMF is 20ms, or am I way off?

You can find more info here:
http://blogs.msdn.com/b/netmfteam/archive/2011/01/17/threads-and-thread-priorities-in-netmf.aspx

But Colin is concerning about threads time slice. In the 20ms fraction of the thread you can sleep 1ms.