Saturday, February 28, 2015

PDC1211: a 7 segments LCD




Abstract
The PDC1211 is a 7-segments display LCD. In this post we provide a library for dealing with this display. The library is strongly inspired by the classical LiquidCrystal library.

Main Characteristics
Module size (WxH):
95.6 x 32.6 mm
Active area (W x H):
77.4 x 16.8 mm
Viewing angle:
6:00
Driving voltage:
5V
Driving IC:
HT1621
Operating temp.:
-2O°C to 60°C
Storage temp.:
-30°C to 70°C
Manifacturer:
Nanjing Guoxian Electronics Corp

Figure 1. PDC1211: special symbols and pinout.


Introduction
The PDC1211 is a 7 segments LCD which is (was?) used mainly for telephony purposes. It has 12 7-segments digits and 7 special symbols. Figure 1 provides an overall view of the display and the position of the special symbols (numbered 1 to 7 in red). Indeed, more than symbols these seems to be sentences written in Chinese. Since I don't know Chinese, I have no idea of their meaning. Except for the 4th one which I got translated from a Chineese girl that I met in the train: "Local phone (number)". I would be grateful to any of you that could provide a translation for the remaining symbols/sentences.

Encoding a character
Concerning the representation of the digits, the PDC1211 follows the requirements of the HT1211 chip. Figure 2 shows the wiring of the backpane and Figure 3 the wiring of the frontpane. These are useful to compute the code values for the printable characters.


Figure 2. Wiring of the backpane.
Figure 3. Wiring of the frontpne.

Segment 0 of the memory mapping of the HT1621 corresponds to the leftmost digit. As illustrated in Figure 3, two memory segment adresses are used to encode a single character. Segments named a, b, c, d are the least significant bits and e, f, g, h. So to encode a 0 for example, one would set segments b, c, d in the first address and e, f, h in the other. Hence we obtain 0xE (or 0B1110) for the first segment and 0xB for the second. However, it is not recommended to write directly these values to the HT1621 but pass either through the write function or through the standard Print interface (see the dedicated section).

Configuration
Libraries. In order to work this library needs the following libraries installed: both of them can be downloaded from this website.
Pinout. The pins on the module are numbered 1 (leftmost) to 5 (rightmost) and are associated as in Figure 1 where SS is pin 1 and Vcc is the number 5. In our examples, pin 1 is connected to Arduino pin 2, pin 2 to Arduino pin 3 and pin 3 to Arduino pin 4.

Installing the library
As all Arduino's additional libraries, PDC1211 has to be installed in your local Arduino's library directory (look into Preference pane of your Arduino IDE to discover the path) in a directory called PDC1211/src. The documentation can be installed into PDC1211/doc.

Communication protocol
The communication between Arduino and the PDC1211 follows the same protocol as for the HT1621 but here Read/Write signals are on the same pin (RW) (see the documentation here for more details).

The print interface
This library implements the method of the Print interface of LiquidCrystal with all its advantages and all of its drawbacks. Moreover, remark that the type of the value to print is important, for example the following instructions all have the same effect of printing a '0' symbol on the LCD

lcd.print((char)0xBE);
lcd.print('0');
lcd.print("0");

while the following

lcd.print(0xBE);

will print a three character string "190" ie. the integer value of 0xBE.
Finally, since this is a 7 segments display and hence not all characters can be displayed. The set of displayable characters is reduced to: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, b, C, c, d, E, F, H, h, L, N, n, o, P, r, t, U, u, -, . and space.

The examples
The following snippet shows the typical usage of the library

// mandatory include files
#include "HT1621.h"
#include "LiquidCrystal7S.h"
#include "PDC1211.h"
// Pin connections 
#define SS 2
#define RW 3
#define DATA 4
// LCD class instantiation
PDC1211 lcd(SS,RW,DATA);

void setup() { ... lcd.begin(); ... }

void loop() { ... lcd.print("HELLO"); // print something ... }

All the examples shipped with LiquidCrystal library run as well exception made, of course, for those implying unsupported methods (see section next section).

Supported LiquidCrystal methods
Since PDC1211 is a child class of the LiquidCrystal7S class, it supports all of the methods of this class. However, they are a subset of those implemented by the LiquidCrystal library since they are impossible to implement in the context of a 7 segments display. Here is the full list of the unsupported methods:
  • cursor()
  • noCursor()
  • blink()
  • noBlink()
  • createChar()
  • blink()
  • noBlink()
  • createChar()

Downloads
The library consists in only one header and an implementation files:
And here it is the documentation both in pdf and html (zipped) formats:

Enjoy!

No comments :

Post a Comment