Shopping Cart


Your Cart is currently empty.

Home The Insider Blogs To Display Or Not...
To Display Or Not...

... to display, that's the question that kept your Insider off the blogs lately. Well, and a healthy dose of summer holidays I have to admit, but that's beside the point. So what's been going on lately, you ask.

Well, the specs of the MODRC extension board state that it comes with an optional alphanumeric LCD display. There is a de-facto standard interface to control these puppies, also known as the Hitachi hd44780 interface. Millions of these displays use that interface (originally this was the name of Hitachi's controller chip for these displays) and you are quite likely to find one or more of them somewhere around you right now. Your truly implemented a number of projects with these type of displays, the first one as early as 1991 when the term "embedded software" wasn't even invented yet. It has never been a problem to get these displays to work, because they are so well-known, and there are many source code examples around to spy on if you do have a problem. But this time it took a lot of effort to get the display to work. Or rather to make it work consistently, because it would spit out characters, sometimes even the characters we actually sent out to it and in rare occasions even in the right positions. But ever so often, the display would have a mind of its own and show different characters, including characters we didn't know before. So why was it so different to get that thing to work this time around, what had changed to the wonderful world of alphanumeric displays?

Timing is of the essence

Well, the actual displays became a lot better with better contrast ratios and viewing angles. But that shouldn't make a difference, should it? Another observation was that these days the controller behind that display (the piece of electronics we are actually talking to from our Digit-LS) is rarely a Hitachi unit anymore. Many different manufacterers stepped in and brought their individual clones to the market. But looking at the specs, they are remarkably similar to the original. And then again, the last succesful LCD project I did a couple of years ago, also used a unit with a non-Hitachi controller on it. So what's going on here?

Well, it turned out to be the microcontroller. Just where you least expected it. And for a rather easy reason once you put your finger on it. See, the hd44780 interface has some specs on the timing of the signals you put into it. So after you set up certain conrol signals, you have to wait for some minimum time before you set up another specific signal. And the transfer of one byte (character) takes a number of these control signals to be set up. Then it all has to be up for yet another minimum length of time before the unit has been able to succesfully clock it in and start displaying it. Now most of these requirements are in the microseconds area. With the old microcontrollers running somewhere in the 4MHz area or so, the time between two instructions was usually enough to cover for these requirements, so you never really had to worry about it. But the Digit-LS controller is of a brand new generation of microcontrollers and it runs on 48 MHz. That's warp speed compared to the previous generations I have been using. And yes, that means that a Digit-LS can easily outrun the signal specs of an LCD controller. And here's the nasty bit: sometimes you get away with it, sometimes you don't. So maybe one character got displayed correctly, maybe the next one got misunderstood and displayed as something Chinese, maybe another one got "eaten" alltogether. And sooner or later, the character sent got misinterpreted as a control signal, moving the cursor or switching the display into a completely different mode of operation. After that, getting any readable information on your display is pure luck!

Results

So I spend a lot of time calculating the proper delays and implementing those in the firmware bits that handle the LCD communication. And there were some other issues as well, some a bit minor, others interesting enough for another blog, so maybe I will get back to this subject. But the good news is: we got it to work the way we wanted it. And boy, it looks GOOD! Just have a look at it:

That is so cool, isn't it? Well, and that also wraps up the work on the functionality of the MODRC board. From here it is just finishing up the Digit-LS and process test results so that we can make this stuff available to you as soon as possible.

The Insider

 

 

Last Updated on Saturday, 24 October 2009 14:25
 
Copyright Sofrides IO