It appears there’s something in the HD44780 PrintString() that is causing a corruption of the TinyBooter and/or firmware on my Cerberus. Before I remembered the SetCursur(), I attempted to use “\n\r” notation to get to a new line. What I discovered is that if you send either of these escaped characters to PrintString() then it will corrupt your firmware. I’ve tried just doing an erase from MFDeploy and MFDeploy no longer recognizes the Cerberus once this code has been executed. I can reproduce this 100% of the time.
@ ianlee74 - I cannot address the issue you are having, but since you mentioned SetCursor, I remembered that there is an issue with that routine. You can see more here http://www.tinyclr.com/forum/topic?id=9727
I just checked the latest code and the issue appears to still be there. Just thought I would give you a heads up.
I’ll try pulling just the problem code into a new project tonight just to verify that it’s not a combination of problems. But, last night I was able to step to the .PrintString() line and the device would then become unresponsive.
I tried creating a new project that only contains the following. I couldn’t reproduce the corrupt/locking Tinybooter that I can create in the other project. There must be some combination of other modules, threads, etc. I’ll try to narrow it down farther if I get any other ideas as to what it is.
However, this test did reveal something odd. If I run this code through Visual Studio debugger then I end up with junk on the display. If I disconnect and reset the device and let it run at full speed then I end up with “No bug.” as expected. Perhaps that means something to someone as to why I’m seeing the other problem in the other project.
void ProgramStarted()
{
Debug.Print("Program Started");
// display_HD44780 is connected to socket #4 of Cerberus.
display_HD44780.PrintString("Bug.");
var line = new string[2] {"Good morning!", ""};
display_HD44780.PrintString(line[0] + "\n" + line[1]);
display_HD44780.Clear();
display_HD44780.PrintString("No bug.");
}
EDIT:
@ taylorza - yea…I’ve run into the SetCursor() bug. It seems that running a custom version of the driver will be the only way to get something printed on the second line
However, looking at your code it appears that the row value is zero based and I was probably printing off screen somewhere. This has me wondering about my old test project… I’ll try that tonight.
@ James - Ah, I see why I might have caused some confusion. I did not realize that the HD44780 with screen is only 2 lines, the issue I am referring to will only present with a 4 line display. Sorry if I caused any confusion, but it would be good to get the driver fixed.
@ Aron Because I was never able to create a minimal project that would reproduce the problem, I sent you the entire project. It’s still not very big but there are a few modules connected and some combination of those is apparently what is causing the problem. Look in Program.cs UpdateDisplay() for some notes on the problem line. The Extender is simply being used to indicate a break in a wire between gnd & pin #9 or gnd & pin #8. I wasn’t sure of your email, so I sent it to Gus’ & ghielec addresses. Let me know if you need anything else.
I had an opportunity to test your code. The Cerberus does appear to lock up in the display.PrintString() function but only if you have anything that would seem to function as an escape sequence. If there are no escape sequences being concatenated between the string variables then the function executes and exits as normal and, as you reported, the firmware appears to lock-up when you have the escape sequences concatenated between the string variables. However, there is an interesting note that we are investigating. If you place the escape sequence within the string variable, the system does not lock up.
I would recommend using the lines of code that you indicate that they do work in your code until an answer to this issue can be found.
Cool. Yea, the lines are totally incorrect for operating the display but I posted this for your information since I believe even bad code should not be allowed to lock up the firmware Thanks for checking into it.
Any chance this could impact a Cobra II? I have two of them with this lcd and every couple days I have to reflash them because the firmware becomes corrupt. It seems random.
@ - user 12135 This thread is older than the current SDK ( see http://www.ghielectronics.com/support/.net-micro-framework ). We had some timing issues in the driver that were corrected. I would say it is unlikely that the LCD display driver is the problem with your application. Age old advice: attempt narrow down what, where, when fails in your code and then post the small example that we can examine.
Well, Taylorza… I’m for one is very glad you posted this. I was also experiencing the same problem on my 4x20 LCD. I’ve been meaning to try and find the fault myself, but this bug was so subtle I probably would not have found it myself.