The Determination Steps of Unknown Segment Liquid Crystal Truth Table

foreword

Made a segment LCD experiment board and used HT1621B to control segment LCD.
It's just in the research and development stage. I don't know what kind of custom segment LCD to use in the future, so I dismantled a segment LCD without documentation support from the reference design for experimentation. Because this LCD is ready to be used on other boards. Solder a single row of jacks on the breadboard and plug the LCD into it.

After the first PCB proofing, it was found that the package of the HT1621B was wrong. At that time, the 48th foot was almost 1 pad...
Use tweezers to break the pins and barely solder them on.
After the final program is written, various experiments, the segment LCD screen does not respond. In the end, it is suspected that the HT1621B was damaged due to the soldering of the pins, and the soldering time was long.

Correct the experimental board once (including correcting the HT1621B to be the authentic SSOP48 package). After the proofing comes back, the last program can light up the segment LCD. It seems that the pins of the IC cannot be broken. Where is the problem to be corrected? be bullied.

Generally on the xb, when the seller displays the segment LCD, they will give the truth table. Each valid segment and com corresponds to what is displayed on the segment LCD, and there are instructions.

I disassembled the LCD from the reference design, and the first question I faced is, what data should be written to which address (segment) in the HT1621B (com1/com2/com3/com4), in order to determine the one determined by the segment LCD to light up What about segment?

The segment LCD is equivalent to multiple diodes. The manufacturer encapsulates these diodes, and each diode has a corresponding segment and COM to control.
That is to say, the on/off of each segment is controlled by a certain segment and a COM.

The segment LCD I have has 17 segment pins and 4 COM pins.
That is, the truth table I'm going to make, a function that has 17 x 4 values, controls the on/off of all display elements on the screen.

The truth table is first related to the pins of the segment LCD connected to the HT1621B.
There are 4 COM pins on the HT1621B, which are dead.
There are 32 segment pins on the HT1621B, and my LCD has only 17 segment pins. That connection is different, the truth table is also different.

e.g. You can connect segment1 ~ segment17 of LCD to segment0 ~ segment16 of HT1621B, if so, it is the same as the truth table given by xb seller.

e.g. You can connect segment1 ~ segment17 of LCD to segment7 ~ segment23 of HT1621B. If so, the truth table written to HT1621B in your own program needs to be determined by experiment. Of course, if you believe in your own mental arithmetic, you can also count. My reaction is slow, and I usually speak experimentally.

The connections of my HT1621B and segment LCD are as follows:

Many students on the Internet have shared the initialization and writing routines of HT1621B, as long as there is no problem with the hardware (HT1621B is good, not scalded; segment LCD is good, you can re-plug the removed LCD to the reference design to verify) , the HT1621B routines shared by online students can be used directly (transplant LCD_CS, LCD_WR, LCD_DAT into their own boards).

To get a segment LCD without document support, the method to determine the truth table is to traverse.
Control only one segment and COM at a time, see the display on the LCD, and record the combination of the name displayed in this segment and the corresponding segment,com value. After the lamp has been traversed, the truth table of the LCD matching the experimental board is obtained.

For the LCD + HT1621B connection method on my experiment board, the segment value of the loop is from 1 to 17, and the com value is 1, 2, 4, 8. This way, a certain segment + com can be traversed each time.

After writing data containing only one bit of 1 to the corresponding segment + com, write 4-bit data with all zeros to this segment/com to clear the display. In this way, the next time you traverse, you can see the next determined segment/com value.

Depending on the custom segment LCD, some segment/com does not have any. This is normal, if you look at the LCD truth table displayed on the xb, some segment/com intersections do not correspond to the displayed content.

void LCD_segment_com_enum()
{
  int i_seg = 0;
  unsigned char uc_com1_to_com4 = 0;
  unsigned char uc_tmp = 0;
  
  for (i_seg = 1; i_seg <= 17; i_seg++) {
    
    // There are a total of 2^4 = 16 combinations of com1 ~ com4
    // for (uc_com1_to_com4 = 0; uc_com1_to_com4 <= 15; uc_com1_to_com4++) {
    
    // If you want to traverse the truth table, just look at each individual COM value + individual segment
    for (uc_com1_to_com4 = 0; uc_com1_to_com4 < 4; uc_com1_to_com4++) {
      
      
      // 6-bit address (seg) + 4-bit data (com)
      // seg1 ~ seg17, com1 ~ com4
      // seg0 on HT1621B is useless, it starts from seg1, so the address starts from 1
      uc_tmp = (1 << uc_com1_to_com4);
      uc_tmp = (uc_tmp << 4);
      Ht1621WrOneData(i_seg, uc_tmp); // Recording the i_seg and uc_tmp of each cycle is the truth table of this segment LCD
      
      uc_tmp = 0; // When debugging the LCD truth table, set a breakpoint here
      Ht1621WrOneData(i_seg, uc_tmp);
    }
  }
  
}

When the traversal is completed, I organize the "displayed LCD segment content/segment/com" at the breakpoint recorded on the note, and get the LCD truth table I want.

// Segment LCD Truth Table
typedef enum enum_segment_com_lcd_index {
  enum_segment_com_lcd_index_Heating = 0, //Heating 1 20
  enum_segment_com_lcd_index_NUM11_sig, //NUM1_SIG 1, 40
  enum_segment_com_lcd_index_Refrigeration, //Refrigeration 1, 80
  //
  enum_segment_com_lcd_index_offline, //Offline 2 10
  enum_segment_com_lcd_index_low_limit, //Lower limit 2 20
  enum_segment_com_lcd_index_high_limit, //Cap 2 40
  enum_segment_com_lcd_index_setting, //set 2 80
  //
  enum_segment_com_lcd_index_NUM21_D, //NUM21.D 3 10
  enum_segment_com_lcd_index_NUM21_E, //NUM21.E 3 20
  enum_segment_com_lcd_index_NUM21_G, //NUM21.G 3 40
  enum_segment_com_lcd_index_NUM21_F, //NUM21.F 3 80
  //
  enum_segment_com_lcd_index_NUM21_d, //NUM21.d x x
  enum_segment_com_lcd_index_NUM21_C, //NUM21.C 4 20
  enum_segment_com_lcd_index_NUM21_B, //NUM21.B 4 40
  enum_segment_com_lcd_index_NUM21_A, //NUM21.A 4 80
  //
  enum_segment_com_lcd_index_NUM22_D, //NUM22.D 5 10
  enum_segment_com_lcd_index_NUM22_E, //NUM22.E 5 20
  enum_segment_com_lcd_index_NUM22_G, //NUM22.G 5 40
  enum_segment_com_lcd_index_NUM22_F, //NUM22.F 5 80
  //
  enum_segment_com_lcd_index_NUM22_d, //NUM22.d 6 10
  enum_segment_com_lcd_index_NUM22_C, //NUM22.C 6 20
  enum_segment_com_lcd_index_NUM22_B, //NUM22.B 6 40
  enum_segment_com_lcd_index_NUM22_A, //NUM22.A 6 80
  //
  enum_segment_com_lcd_index_NUM23_D, //NUM23.D 7 10
  enum_segment_com_lcd_index_NUM23_E, //NUM23.E 7 20
  enum_segment_com_lcd_index_NUM23_G, //NUM23.G 7 40
  enum_segment_com_lcd_index_NUM23_F, //NUM23.F 7 80
  //
  enum_segment_com_lcd_index_NUM23_d, //NUM23.d x x
  enum_segment_com_lcd_index_NUM23_C, //NUM23.C 8 20
  enum_segment_com_lcd_index_NUM23_B, //NUM23.B 8 40
  enum_segment_com_lcd_index_NUM23_A, //NUM23.A 8 80
  //
  enum_segment_com_lcd_index_RH, //% + RH 11 10
  enum_segment_com_lcd_index_WARNING_TH, //alarm 11 20 // temperature alarm
  enum_segment_com_lcd_index_WARNING_RH,//Upper right corner alarm 11 40 // Humidity alarm
  enum_segment_com_lcd_index_TH, //Temperature 11 80
  //
  enum_segment_com_lcd_index_NUM13_D, //NUM13.D 13 10
  enum_segment_com_lcd_index_NUM13_E, //NUM13.E 13 20
  enum_segment_com_lcd_index_NUM13_G, //NUM13.G 13 40
  enum_segment_com_lcd_index_NUM13_F, //NUM13.F 13 80
  //
  enum_segment_com_lcd_index_NUM13_d, //NUM13.d x x
  enum_segment_com_lcd_index_NUM13_C, //NUM13.C 12 20
  enum_segment_com_lcd_index_NUM13_B, //NUM13.B 12 40
  enum_segment_com_lcd_index_NUM13_A, //NUM13.A 12 80
  //
  enum_segment_com_lcd_index_NUM12_D, //NUM12.D 15 10
  enum_segment_com_lcd_index_NUM12_E, //NUM12.E 15 20
  enum_segment_com_lcd_index_NUM12_G, //NUM12.G 15 40
  enum_segment_com_lcd_index_NUM12_F, //NUM12.F 15 80
  //
  enum_segment_com_lcd_index_NUM12_d, //NUM12.d 14 10
  enum_segment_com_lcd_index_NUM12_C, //NUM12.C 14 20
  enum_segment_com_lcd_index_NUM12_B, //NUM12.B 14 40
  enum_segment_com_lcd_index_NUM12_A, //NUM12.A 14 80
  //
  enum_segment_com_lcd_index_NUM11_D, //NUM11.D 17 10
  enum_segment_com_lcd_index_NUM11_E, //NUM11.E 17 20
  enum_segment_com_lcd_index_NUM11_G, //NUM11.G 17 40
  enum_segment_com_lcd_index_NUM11_F, //NUM11.F 17 80
  //
  enum_segment_com_lcd_index_NUM11_d, //NUM11.d x  x
  enum_segment_com_lcd_index_NUM11_C, //NUM11.C 16 20
  enum_segment_com_lcd_index_NUM11_B, //NUM11.B 16 40
  enum_segment_com_lcd_index_NUM11_A, //NUM11.A 16 80
  
}ENUM_SEGMENT_COM_LCD_INDEX;

typedef struct _tag_LCD_segment_com_TABLE {
  ENUM_SEGMENT_COM_LCD_INDEX index;
  int segment;
  unsigned char com;
}TAG_LCD_SEGMENT_COM_TABLE;

const TAG_LCD_SEGMENT_COM_TABLE g_LCD_segment_com_TABLE[] = {
//  enum_segment_com_lcd_index_Heating = 0, //Heating 1 20
  {enum_segment_com_lcd_index_Heating, 1, 0x20},
  
//  enum_segment_com_lcd_index_NUM11_sig, //NUM1_SIG 1, 40
  {enum_segment_com_lcd_index_NUM11_sig, 1, 0x40},
  
//  enum_segment_com_lcd_index_Refrigeration, //Refrigeration 1, 80
  {enum_segment_com_lcd_index_Refrigeration, 1, 0x80},
  
//  //
//  enum_segment_com_lcd_index_offline, //offline 2 10
  {enum_segment_com_lcd_index_offline, 2, 0x10},
  
//  enum_segment_com_lcd_index_low_limit, //lower limit 2 20
  {enum_segment_com_lcd_index_low_limit, 2, 0x20},
  
//  enum_segment_com_lcd_index_high_limit, //upper limit 2 40
  {enum_segment_com_lcd_index_high_limit, 2, 0x40},
  
//  enum_segment_com_lcd_index_setting, //setting 2 80
  {enum_segment_com_lcd_index_setting, 2, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM21_D, //NUM21.D 3 10
  {enum_segment_com_lcd_index_NUM21_D, 3, 0x10},
  
//  enum_segment_com_lcd_index_NUM21_E, //NUM21.E 3 20
  {enum_segment_com_lcd_index_NUM21_E, 3, 0x20},
  
//  enum_segment_com_lcd_index_NUM21_G, //NUM21.G 3 40
  {enum_segment_com_lcd_index_NUM21_G, 3, 0x40},
  
//  enum_segment_com_lcd_index_NUM21_F, //NUM21.F 3 80
  {enum_segment_com_lcd_index_NUM21_F, 3, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM21_d, //NUM21.d x x
  {enum_segment_com_lcd_index_NUM21_d, -1, 0xff},
  
//  enum_segment_com_lcd_index_NUM21_C, //NUM21.C 4 20
  {enum_segment_com_lcd_index_NUM21_C, 4, 0x20},
  
//  enum_segment_com_lcd_index_NUM21_B, //NUM21.B 4 40
  {enum_segment_com_lcd_index_NUM21_B, 4, 0x40},
  
//  enum_segment_com_lcd_index_NUM21_A, //NUM21.A 4 80
  {enum_segment_com_lcd_index_NUM21_A, 4, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM22_D, //NUM22.D 5 10
  {enum_segment_com_lcd_index_NUM22_D, 5, 0x10},
  
//  enum_segment_com_lcd_index_NUM22_E, //NUM22.E 5 20
  {enum_segment_com_lcd_index_NUM22_E, 5, 0x20},
  
//  enum_segment_com_lcd_index_NUM22_G, //NUM22.G 5 40
  {enum_segment_com_lcd_index_NUM22_G, 5, 0x40},
  
//  enum_segment_com_lcd_index_NUM22_F, //NUM22.F 5 80
  {enum_segment_com_lcd_index_NUM22_F, 5, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM22_d, //NUM22.d 6 10
  {enum_segment_com_lcd_index_NUM22_d, 6, 0x10},
  
//  enum_segment_com_lcd_index_NUM22_C, //NUM22.C 6 20
  {enum_segment_com_lcd_index_NUM22_C, 6, 0x20},
  
//  enum_segment_com_lcd_index_NUM22_B, //NUM22.B 6 40
  {enum_segment_com_lcd_index_NUM22_B, 6, 0x40},
  
//  enum_segment_com_lcd_index_NUM22_A, //NUM22.A 6 80
  {enum_segment_com_lcd_index_NUM22_A, 6, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM23_D, //NUM23.D 7 10
  {enum_segment_com_lcd_index_NUM23_D, 7, 0x10},
  
//  enum_segment_com_lcd_index_NUM23_E, //NUM23.E 7 20
  {enum_segment_com_lcd_index_NUM23_E, 7, 0x20},
  
//  enum_segment_com_lcd_index_NUM23_G, //NUM23.G 7 40
  {enum_segment_com_lcd_index_NUM23_G, 7, 0x40},
  
//  enum_segment_com_lcd_index_NUM23_F, //NUM23.F 7 80
  {enum_segment_com_lcd_index_NUM23_F, 7, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM23_d, //NUM23.d x x
  {enum_segment_com_lcd_index_NUM23_d, -1, 0xff},
  
//  enum_segment_com_lcd_index_NUM23_C, //NUM23.C 8 20
  {enum_segment_com_lcd_index_NUM23_C, 8, 0x20},
  
//  enum_segment_com_lcd_index_NUM23_B, //NUM23.B 8 40
  {enum_segment_com_lcd_index_NUM23_B, 8, 0x40},
  
//  enum_segment_com_lcd_index_NUM23_A, //NUM23.A 8 80
  {enum_segment_com_lcd_index_NUM23_A, 8, 0x80},
  
//  //
//  enum_segment_com_lcd_index_RH, //% + RH 11 10
  {enum_segment_com_lcd_index_RH, 11, 0x10},
  
//  enum_segment_com_lcd_index_WARNING_TH, //warning 11 20 //temperature warning
  {enum_segment_com_lcd_index_WARNING_TH, 11, 0x20},
  
//  enum_segment_com_lcd_index_WARNING_RH,//Alarm in the upper right corner 11 40 // Humidity alarm
  {enum_segment_com_lcd_index_WARNING_RH, 11, 0x40},
  
//  enum_segment_com_lcd_index_TH, //temperature 11 80
  {enum_segment_com_lcd_index_TH, 11, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM13_D, //NUM13.D 13 10
  {enum_segment_com_lcd_index_NUM13_D, 13, 0x10},
  
//  enum_segment_com_lcd_index_NUM13_E, //NUM13.E 13 20
  {enum_segment_com_lcd_index_NUM13_E, 13, 0x20},
  
//  enum_segment_com_lcd_index_NUM13_G, //NUM13.G 13 40
  {enum_segment_com_lcd_index_NUM13_G, 13, 0x40},
  
//  enum_segment_com_lcd_index_NUM13_F, //NUM13.F 13 80
  {enum_segment_com_lcd_index_NUM13_F, 13, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM13_d, //NUM13.d x x
  {enum_segment_com_lcd_index_NUM13_d, -1, 0xff},
  
//  enum_segment_com_lcd_index_NUM13_C, //NUM13.C 12 20
  {enum_segment_com_lcd_index_NUM13_C, 12, 0x20},
  
//  enum_segment_com_lcd_index_NUM13_B, //NUM13.B 12 40
  {enum_segment_com_lcd_index_NUM13_B, 12, 0x40},
  
//  enum_segment_com_lcd_index_NUM13_A, //NUM13.A 12 80
  {enum_segment_com_lcd_index_NUM13_A, 12, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM12_D, //NUM12.D 15 10
  {enum_segment_com_lcd_index_NUM12_D, 15, 0x10},
  
//  enum_segment_com_lcd_index_NUM12_E, //NUM12.E 15 20
  {enum_segment_com_lcd_index_NUM12_E, 15, 0x20},
  
//  enum_segment_com_lcd_index_NUM12_G, //NUM12.G 15 40
  {enum_segment_com_lcd_index_NUM12_G, 15, 0x40},
  
//  enum_segment_com_lcd_index_NUM12_F, //NUM12.F 15 80
  {enum_segment_com_lcd_index_NUM12_F, 15, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM12_d, //NUM12.d 14 10
  {enum_segment_com_lcd_index_NUM12_d, 14, 0x10},
  
//  enum_segment_com_lcd_index_NUM12_C, //NUM12.C 14 20
  {enum_segment_com_lcd_index_NUM12_C, 14, 0x20},
  
//  enum_segment_com_lcd_index_NUM12_B, //NUM12.B 14 40
  {enum_segment_com_lcd_index_NUM12_B, 14, 0x40},
  
//  enum_segment_com_lcd_index_NUM12_A, //NUM12.A 14 80
  {enum_segment_com_lcd_index_NUM12_A, 14, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM11_D, //NUM11.D 17 10
  {enum_segment_com_lcd_index_NUM11_D, 17, 0x10},
  
//  enum_segment_com_lcd_index_NUM11_E, //NUM11.E 17 20
  {enum_segment_com_lcd_index_NUM11_E, 17, 0x20},
  
//  enum_segment_com_lcd_index_NUM11_G, //NUM11.G 17 40
  {enum_segment_com_lcd_index_NUM11_G, 17, 0x40},
  
//  enum_segment_com_lcd_index_NUM11_F, //NUM11.F 17 80
  {enum_segment_com_lcd_index_NUM11_F, 17, 0x80},
  
//  //
//  enum_segment_com_lcd_index_NUM11_d, //NUM11.d x  x
  {enum_segment_com_lcd_index_NUM11_d, -1, 0xff},
  
//  enum_segment_com_lcd_index_NUM11_C, //NUM11.C 16 20
  {enum_segment_com_lcd_index_NUM11_C, 16, 0x20},
  
//  enum_segment_com_lcd_index_NUM11_B, //NUM11.B 16 40
  {enum_segment_com_lcd_index_NUM11_B, 16, 0x40},
  
//  enum_segment_com_lcd_index_NUM11_A, //NUM11.A 16 80
  {enum_segment_com_lcd_index_NUM11_A, 16, 0x80},
  

  {-1, -1 , 0xff}, // NOP, do nothing
};

Next, the work I have to do is purely logical.
Take the segment/com index ENUM_SEGMENT_COM_LCD_INDEX to be displayed, take the segment/com value to be written to the HT1621B from g_LCD_segment_com_TABLE[], and write it to the HT1621B.

g_LCD_segment_com_TABLE[] only stores a stroke, if you want to display a word. e.g. 6. You need to write it multiple times.
Spell the strokes related to enum_segment_com_lcd_index_NUM in g_LCD_segment_com_TABLE[] by yourself to form a word, write these stroke data into the HT1621B, and the word will be displayed.

For nixie tubes, there are 8 strokes as follows.

Digital tube pin definition
F A B
  G
E D C d

Tags: PCB

Posted by wiseass on Fri, 13 May 2022 17:19:03 +0300