ht1621 lcd display module free sample
The STM8S processor is a small, simple, low power and cheap processor. Especially the small footprint package variants such as STM8S103F3P6 are great because they do not require external components to run (well, one capacitor), they are easily programmed, and much free software exists for development such as SDCC. They are well suited for simple measurement applications where one sensor must be interfaced to serial communication or a display.
Although character or even graphic LCD displays that are simple to connect to microprocessors, for low power applications they are overkill. They may require high bias voltage (5V for the ubiquitous HD44780 2x16 modules for example), or may require much current to operate. In many cases, if one variable will be displayed, a simple 7 segment display is sufficient. One such display controller is the HT1621, and many LCD displays can be found for it from China. In this project, I used this one, from DX.com.
DX does supply a library for HT1621, written for Arduino. I first modified the library heavily for ARM STM32F103. I added extra features such as blanking (removing left hand zeros), and preparing the LCD variables in a structure to make them more convenient. Later, I ported the library again, this time for STM8S, and here I share it with you. This version is for Linux, but straightforward to port to Windows etc.
The sample code is in the file HT1621Demo.c. The file sets up the processor and peripherals, and initializes the LCD module. Then it makes an ADC measurement once every 128ms, displays the result, and sleeps until the next measurement. Sample commented out code shows how you can display different values, negative numbers, and also manipulate the included battery level meter. You can modify it easily for your requirements. You could also hook up several displays and manipulate each differently (with a few modifications of the pin manipulation functions)
To run it, make the connections (shown in HT1621.h file), connect the ST-Link V2 SWIM interfce pins, modify the paths defined in the two Makefiles (one is in the directory libs, and execute the command
I’m still very much a beginner with the code side of things. The code seems to work, the decimal point displays after a minute, I’m just having trouble figuring out how to make the ultrasonic sensor display. I usually hack together different sketches until I have something that works, or read the // next to the example to see what I need to change around to make work, but I think it’s in chinese or something.
That code changes what displays on the display (once I took away the comment //). So if I change any of the numbers, it changes the display. So now I need to figure out how to make it display the “distance” value that’s uploading the the serial monitor.
AOur production quality follow ISO9000 standard system, stable design team,22 years experience of QC team and strictly quality control system guarantee the production quality. accept third part inspection,we have mechanical checking,display checking,high&low temperature storage&operating test during high humidity condition,EMC test(optional) for every design .
A Our production quality follow ISO9000 standard system, stable design team22 years experience of QC team and strictly quality control system guarantee the production quality. accept third part inspection,we have mechanical checking,display checking,high&low temperature storage&operating test during high humidity condition,EMC test(optional) for every design.
A Our production quality follow ISO9000 standard system, stable design team22 years experience of QC team and strictly quality control system guarantee the production quality. accept third part inspection,we have mechanical checking,display checking,high&low temperature storage&operating test during high humidity condition,EMC test(optional) for every design.
Another illustration how to wire the HT621 driven 6 Digit 7 Segment LCD Display on Microcontroller. This module is widely used in multi-meter, voltage monitor, solar power monitor, clock, thermometer, electronic measuring device, automotive, etc. this module is compatible in your favorite Microcontroller using 3 wire SPI communication and it has a backlight suitable in dark environment. This module runs on 4.7~5.2V DC 0.4mA without back-light and 4mA with back-light.
Arduino Microcontroller, ESP8266 12, 12E, ESP8266 NodeMCU, ESPDuino, WeMos, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, ATMEGA250 16 MHz, ATSAM3x8E, ATSAM21D, ATTINY85 16/8 MHz (Note: The Diagram below is using NANO. If your using other MCU please refer to the respective pin-outs6 Digit 7 Segment 2.4 Inch LCD Display ModuleJumper Wires / DuPont Wire