Search This Blog

Sunday, 13 February 2011

Watterott S65-Shield with FEZ Domino

I was looking a while back at Arduino LCD shields, and came across the Watterott S65-Shield. A quote from their website describes the shield as;
The S65-Shield is a plug-on module with color TFT-Display (176x132), microSD socket and rotary encoder for Arduino Uno, Duemilanove, Diecimila and Mega Boards
They chose to use a LCD module from a Siemens S65 mobile phone. This LCD module can be found with three different display controllers. The S65-Shield I got from Watterott contains the LS020 controller.

A recent check of the Watterott website shows that this shield is no longer available. They have upgraded their Arduino LCD shield to use a Multi-Inno MI0283QT-2 TFT-Display and a TI ADS7846 Touch-Controller .

Fortunately, a variety of people have already worked on reverse engineering the LS020 LCD module. In particular -
Stephan Watterott and Juraś supply Arduino library and code samples to get this shield up and running. So it felt challenging to try this shield out on the FEZ Domino.

The last time I dealt with writing low-level driver code for single pixel addressable LCD controllers was many years ago. Lots of fond memories and tricks came flooding back. Porting other peoples work to a new language and embedded environment is the easy part. Hopefully others can take further advances thanks to the port and the reverse engineering by many others that forms the basis of this port.

I started first by porting Watterott's library code. Configuring the SPI bus and LS020 controller was quite straightforward to set up. The first expected challenge came from managed code loops within the clear screen (or area) function. Writing single pixels out over the SPI bus using a double for-loop is slow. To reduce delays throwing pixel data over to the LS020, I adopted a line buffer write approach. I did some performance profiling a while ago and recall getting a full clear screen down to around 33 microseconds. Not great, but showed the type of optimisation work required to speed up the ported Watterott Arduino library code. I managed to speed up quite a few library functions, but then got distracted by Juraś work on driving the LS020.

One of the examples Juraś has on his forum does a nice job of showing off the other display addressing modes that the LS020 supports. Two eight bit modes and a 16 bit mode. Watterott's code relies on 16 bit display addressing, whereas Juraś opted for an 8 bit mode. With an unoptimised port of the forum example code, it's plain to see that an 8 bit mode has more potential when coupled with managed code.

A future challenge coupled with optimising the low level LS020 driver code, is adding higher level functionality. The usual tricks involving dirty rectangle tracking and handling, bit blitting bitmaps that have been converted to tie in with the pixel addressing mode, etc.

C# library and example code for this port can be found here and here. It's also over on Fezzer.com here.

With the arrival of a second Protoshield this week, I'm now moving on to look at the IMU side of Burt.

3 comments:

Wim said...

Can you please post the connections from the FEZ_Domino to the MI0283Q-T2 adapter? his would complete a propper tutor.

Richard Crowder said...

Hi Wim. I don't have the MI0283Q-T2 based Watterott shield, so I have no Domino related code for it.

Steinberg Lin said...

Here are the 3.5 QVGA 4.3 WQVGA 5.7 QVGA 7 WVGA TFT LCD modules, and always trying to stay in LCD technology in the forefront of our current technology products, including COG, COF, TAB, SMT. Believe that through our cooperation, the displayed a better world.color lcd display module . click here