Menu

Driver for 6 digit, 7 segment LCD display type PDC-6X1 (HT1621 controller)

2024-12-24
2024-12-26
  • Manfred Mornhinweg

    Hi all,
    I bought some cheap 6 digit, 7-segment LCDs from AliExpress, and found that information and support for them is scarce. At least they use the well-documented HT1621 LCD driver chip. So I wrote a GCB driver for this display, that makes its use easy.

    This driver is mainly intended to display numbers from -99999 to 999999, with the ability to set a decimal point at any of the three locations this display allows, and also controlling its battery level indicator.

    If a value outside the acceptable range is sent, the driver will make the display show "Error".

    If anybody wants to use my driver to send other letters to the display, or write just one character at a time, it can be done, but is less convenient. If you want to do it, look into the driver source code to see how to do it.

    All variable names and subroutines used by the driver begin with "LCD7", to minimize chances of conflict with user programs.

    The driver, and a small demo program that shows how to use it, are attached. Maybe somebody out there might find this useful.

    My driver is certainly not highly optimized. A better programmer than I am can surely make a much more efficient driver - but this one works, at least!

    I tested it on a PIC16F1788, but it should run on most MCUs suppoted by GCB. It makes no use of specific MCU hardware.

    The PDC-6X1 display (at least the flavor I got) runs well on either 3.3 or 5V (or anything in between), but requires changing the LCD bias resistor accordingly. It comes with 20kΩ, which is optimal for roughly 4V. In my testing I found that optimal values are roughly 15kΩ for 3.3V, and 75kΩ for 5V. Installing a 100kΩ trimpot in place of the original 20kΩ resistor is the best solution.

    The power consumption of this display is very low. I measured 165µA on 3.3V, with the backlight off. On 5V it takes roughly 280µA.

     
  • Manfred Mornhinweg

    The driver didn't get attached... here it is!

     
  • Anobium

    Anobium - 2024-12-24

    Great piece of work.

    I if you make into a working demo then I would recommend we put a copy into the demos. Then, it will not be lost in this forum.

    A working demos would be based on your chip, with an header that looks like this.

    /*
      A demonstration program for GCBASIC.
      --------------------------------------------------------------------------------
      This program [add description here]
    
    
      @author    name   
      @license   GPL
      @version   version   
      @date      2024-12-24
      ********************************************************************************/
    

    This demo program would be placed in the Github repository and would be available online and within the Demonstrations published as part of GCBASIC.

    Thank you for contributing.

    Evan

     
  • Manfred Mornhinweg

    Hi Evan,

    well, the demo program I provided is pretty close to that, only the header format is a little different. If you want, I can change it and re-upload.

    Do you mean that, or do you mean that I should make a stand-alone demo program, that has the LCD driver subroutines in it?

    What I uploaded is a driver consisting of a set of subroutines and variable definitions, that can be included in the user's program, plus a short demo program that shows how to use it.

    Both the driver and the demo could be polished a lot! I don't know if what I uploaded can be considered good enough to be published with GCB...

    Manfred

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.