Reverse engineering the Nokia N95 8Gb QVGA LCD
In this, the latest instalment of my Nokia QVGA TFT reverse engineering series, I will take on the 2.8 inch 24-bit TFT that is designed to work with the Nokia N95 8Gb mobile phone. Read on to see how it worked out.
In the first of my reverse engineering articles I tackled the Nokia 2730 display. I successfully discovered enough of the command set to write a driver for the Arduino and the STM32.
Flush with that success I moved on to tackle the Nokia 6300 and the Nokia N82. I was lucky in that these two shared the same pinout and command set as the 2730 so I could produce a development board with little difficulty.
The N95 8Gb
The Nokia N95 8Gb handset
Whilst on one of my ebay fishing expeditions I noticed that the N95 8Gb display was widely available and very cheap at about £4.50 for a clone panel from one of the multitude of HK-based sellers.
Furthermore, it shared the same JST connector as my previous reverse-engineering efforts and a little googling yielded the repair manuals that contained the schematic.
The phone connector schematic from RM320/321
Pretty quickly it became obvious that this was not an identical pinout to the 6300/N82. For a start, where’s the LED backlight in and out connection? It’s just not there. The other pins are familiar though, so I’ll get started and see if I can work out the differences as I go along.
Note that the N95 and the N95 8Gb are different phones with different LCD connectors. The N95 has a flat FPC connection that I have not yet been able to identify. The 8Gb model has the familiar JST 24R-JANK-GSAN-TF 24-pin board-to-board connector.
The two N95 variants as shown in ebay ads
Here’s a close-up of the connector fitted to the screen that I bought. The manufacturer has helpfully labelled the pin numbers on the FPC. In this case the numbering is correct but it’s never safe to rely on that and you should always find the correct pin numbering by locating the GND pins that connect directly into the FPC ground pour.
A close up of the JST connector
At 2.8 inches across the diagonal the N95 8Gb is the largest of the three sizes that I’ve reverse-engineered so far. The N82 was 2.4 inches and the 6300 the smallest at only 2.0 inches.
The 6300, N82 and N95 8Gb screens
All of the screens share the same 320×240 QVGA resolution. The pixel size and density are the variables that change along with the physical dimensions of the panel.
To get started I hooked it up to an STM32 development board as-per the schematic and tried it using the MC2PA8201 driver that I developed for the Nokia 6300 and N82.
It didn’t work.
It wasn’t a total failure though. I did notice some interesting behaviour.
- When power was applied, and before RESET was asserted, the backlight came on for the briefest of instants. This could only mean that the backlight LED driving circuit is internal to the panel. This is good news as it will save me a number of components on a development board.
- A panel with no backlight is so dark that it looks like it is off. By shining a bright light at the panel I could see that it was on and displaying some graphics although they were garbled and not showing correctly. More good news, the post-reset initialisation sequence must be more or less correct.
The next step was to run my test program that issues each of the possible 255 register-write operations and then reads some values back in the hope that the register I just wrote was a command to the panel to give me back some information.
Most of the commands gave only zeros but some of them yielded values. Here’s what I got.
04 : 29 29 91 5B 29 29 91 5B 29 29 09 : 06 06 61 00 00 06 06 61 00 00 0A : 08 08 08 08 08 08 08 08 08 08 0B : 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C 0C : 66 66 66 66 66 66 66 66 66 66 0F : F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 20 : 20 20 20 20 20 20 20 20 20 20 2E : 00 A0 0C A0 A0 58 48 B0 80 40 D0 : 40 40 01 40 40 01 40 40 01 40 D1 : 41 41 01 41 41 01 41 41 01 41 D2 : 40 40 01 40 40 01 40 40 01 40 D3 : 41 41 01 41 41 41 01 41 41 41 DA : 29 29 29 29 29 29 29 29 29 29 DB : 91 91 91 91 91 91 91 91 91 91 DC : 5B 5B 5B 5B 5B 5B 5B 5B 5B 5B DD : 00 29 91 5B 29 29 91 5B 29 29 FC : 09 09 00 09 09 00 09 09 00 09
Most of those mean nothing to me, but registers 0x04 and 0xDA to 0xDD are interesting. They match the behaviour of the device code readout from the MC2PA8201 used in the Nokia 6300 and N82.
Now I know that I’m looking for a controller that has a similar register set to the MC2PA8201 but has additional support for a firmware controlled backlight.
It’s an LDS285
I found a few controllers from Ilitek and one from Himax that supported firmware backlight control. None of their registers worked. Finally I tried the LDS285. This one worked. I was able to switch on the backlight and control its brightness via the registers.
I have no way of telling whether the controller is a genuine LDS285 or whether it’s a similar one that has a compatible command set, but I do know that enough of the commands work for me to be able to create a complete software driver.
You can download the 2.8Mb LDS285 datasheet as a PDF file from here.
The LDS285 brightness block diagram
Now I knew the identity of the compatible controller it was a simple matter to create a driver to support the LDS285. All features are working and I’m pleased to report that the screen I got from ebay supports 16M, 262K and 64K colour modes. The 64K mode only requires 2 transfers per pixel and so it is up to 33% faster than the 18 and 24-bit modes.
An Arduino development board
The same NXP 74ALVC164245 level converter will be used to convert between the 5V arduino signal levels and the 3.3V signals required by the panel. There are many ways to convert levels and I prefer the NXP IC because it has a very fast 2.9ns propagation time that is guaranteed equal across all 16 of its ports, something that’s very important when you’re dealing with a data bus.
The schematic is simplified by the elimination of the NCP5007 backlight driver circuit that we used in the 6300 and N82 designs. I have chosen to enhance the stability a little by including a 22pF decoupling capacitor on the RESET line, just as Nokia have done in their schematic.
The CAD layout was easier than the other boards because the backlight driver circuit and the EN pin header have been eliminated. Working within the 50mm x 50mm constraints means that the panel will be longer than the board by about 20mm on the long side.
Bill of materials
Here’s a complete list of parts used in this project.
|NOKIA12x2||B2B connector||24R-JANK-GSAN-TF||0.4mm x 24|
Building the PCB
Once the CAD designs were completed I exported the Gerber CAM files and sent them off to ITead Studio for production.
Three weeks pass by…
Ordering prototypes from China is great value but you do need to have patience! I used the time to write the Arduino LDS285 driver software that I’d need to use to test the new design. In fact I had so much time I also ported the driver software across to stm32plus in preparation for the next release of that library.
Finally they arrived and I’m happy to say that they appear to be flawless.
The front of the PCB
There’s more space on the component-side of the board because we don’t need the LED backlight driving circuit that we have on the N82 and 6300 boards.
The back of the PCB, which will actually be the front when the LCD is mounted on it
Assembling the components on to the board is a procedure that I’m now well-practised at.
Firstly the two fine-pitch components, the 0.5mm pitch level converter and the 0.4mm pitch socket, are reflowed into place using a hot-plate and touched up afterwards under a binocular microscope.
Secondly the remaining passive components, the capacitors and the resistor, are mounted using my Aoyue 852A hot-air gun. The final step is to hand-solder the pin headers into position with a normal soldering iron.
When it’s all done I wash the boards with soapy water and a toothbrush to remove the flux residues and then I leave them to dry in the airing cupboard overnight.
All built and ready to accept a screen
The next day when the board had dried out I attached the LCD. My measurements of where the socket would need to be positioned on the PCB were correct and the LCD sat just where I had envisioned it.
The screen is somewhat larger than the PCB
The screen is fixed to the PCB with an array of double-sided sticky pads that serve both to lift the metal back away from the PCB as well as to hold it fast to the board. Still, the significant overhang necessitates careful handling to ensure that the board is inserted and removed while gripping the PCB edges and not the screen.
Fire it up and run the demos
The software suite that I wrote for the N82 and 6300 is designed to be modular and so it was a trivial matter to write a driver for the LDS285 that would necessitate only a one-line change in the example programs to work with this new display. You will require at least version 2.3.0 of the driver.
Raining again? It must be summer in England.
To use the new driver we simply replace the include file that makes the driver definitions available to us:
//#include "Nokia6300.h" #include "NokiaN95_8Gb.h"
And we change the typedef that gives us access to the panel driver:
//typedef Nokia6300_Landscape_262K TftPanel; typedef NokiaN95_8Gb_Landscape_262K TftPanel;
I’m happy to say that all the driver functionality is available and the panels that I’ve tested so far all support 64K, 262K and 16M colour modes in landscape and portrait orientations.
Watch the videos
I’ve put together a quick YouTube video that shows the graphics library in action on the N95 8Gb. That should give you a sense of the size of this panel relative to the other ones I’ve reverse engineered.
This first video shows the panel attached to a 128K Arduino Mega:
This second video shows the panel attached to an STM32F4 Discovery board using the LDS285 driver found in my stm32plus library. When attached to the 3.3V STM32F4 device the level converter IC is just a pass-through with 3.3V on each side.
So that’s it, another Nokia QVGA panel gives up its secrets to the hobby engineering community. I hope that the information I’ve published here will be of some use to you and your projects.
Update: 1st December 2012
I’m not at all surprised to announce that, just like with the Nokia 6300 display, there is more than one variant of the display out there. This second variant that I’ve seen flips the column and row ‘cursor’ position commands in portrait mode. Other than that, it’s just the same.
I’ll be calling this variant ‘Type B’ and it will be supported in version 2.3.1 of my Arduino drivers that I hope to release tomorrow, the 2nd of December. Usage is just the same pattern as the 6300, all that is required is the suffix _TypeB on the driver name. e.g:
typedef NokiaN95_8Gb_Portrait_262K_TypeB TftPanel; TftPanel *tft; tft=new TftPanel;
Schematics, CAD and gerbers available
I have open-sourced my PCB design and CAD files so if you’re interested in building your own boards then head on over to my downloads page and grab yourself a copy.