HT1621 is a 128-dot memory-imaged and multi-function LCD driver. The software configuration feature of HT1621 makes it suitable for a variety of LCD applications, including LCD modules and display subsystems. There are only 4 or 5 pins for connecting the main controller and HT1621. HT1621 also has a power-saving command to reduce system power consumption. In this system made by Hufeng, HT1621 is used to drive a static LCD liquid crystal display. The liquid crystal display mode is divided into static display and dynamic display. The difference between static and dynamic is that static display is continuously powered, while dynamic display uses the visual retention effect of people to quickly scan the various segments of the digital tube, so that people visually feel that the digital tube is displayed simultaneously.
Good afternoon, everyone. I use STC12C5204 MCU to control 1621 to drive LCD.
I have been adjusting the program for several days but there is no progress. I don't know what mess is displayed. It seems that the command can't be written in at all. COM0 and com1 are less than 1V, com3 is 3.5V, and com4 sometimes has waveforms. The program I wrote is like this. Part of SEGMENT has waveforms, and the rest is just a level. I
called Hetai Technology and asked me to use their examples, so I modified it, but it's still the same. Please help me find out what the problem is. Thank you. The following is the example downloaded from Hetai. I modified it slightly. The
MCU source program is basically intact as follows:
Good afternoon, everyone. I use STC12C5204 microcontroller to control 1621 drive LCD
I have been debugging the program for a few days but there is no progress. I don't know what all the mess is displayed, as if the command can't be written in at all. COM0 and COM1 are at a level of less than 1V, COM3 is at a level of 3.5V, and COM4 sometimes has a waveform
This is how I flashed my own program. Part of the SEGMENT has a waveform, and the rest is just a level.
I called Hetai Technology and they asked me to use their sample, so I modified it, but it was still the same.
Please help me find out what the problem is, thank you.
The following is an example downloaded from Hetai.com. I modified it slightly, but it is basically the same as before.
//STC12C5204AD MCU controls HT1621B to drive LCD
#include #include #include #define BIAS 0X52 //1/3 bias, 4 back pole #define RC256K 0X30 //System clock selection is the on-chip RC oscillator #define WDTDIS1 0X0A //Disable WDT overflow flag output #define TIMERDIS 0X08 //Time base output disabled #define SYSEN 0X02 //Turn on the system clock #define SYSDIS 0X00 // Turn off the system clock and bias generator #define LCDON 0X06 //Turn on the LCD bias generator #define LCDOFF 0X04 // Turn off LCD bias generator #define TONEON 0X12 //Turn on audio output #define TONEOFF 0X10 //Turn off audio output #define CS P3_2 #define WR P3_4 #define DATA P3_5 #define uchar unsigned char #define uint unsigned int /***************************Delay sub-function******************************/ void delay(uchar i) //j=12 delay about 4.3us { while(i--) { flying j=0; while(j<8) j++; } } void SendBit_1621(uchar dat ,uchar cnt) { flying i; for(i =0; i if((dat&0x80)==0) DATA=0; else DATA=1; WR=0; delay(2); WR=1; that=that<<1; } } void SendDataBit_1621(float dat, float cnt) { flying i; for(i =0; i if((dat&0x01)==0) DATA=0; else DATA=1; WR=0; delay(2); WR=1; that=that>>1; } } void SendCmd(uchar command) { CS=0; _nop_(); _nop_(); SendBit_1621(0x80,4); SendBit_1621(command,8); CS=1; } void Write_1621(uchar addr,uchar dat) { CS=0; _nop_(); _nop_(); SendBit_1621(0xa0,3); SendBit_1621(addr,6); SendDataBit_1621(dat,4); CS=1; } void WriteAll_1621(fly addr,fly *p,fly cnt) { flying i; CS=0; _nop_(); _nop_(); SendBit_1621(0xa0,3); SendBit_1621(addr,6); for(i =0; i SendDataBit_1621(*p,8); } CS=1; } /*******************************Main function******************************/ main() { float a[10]; a[0]=0xFF;a[1]=0xFF;a[2]=0xFF;a[3]=0xFF;a[4]=0xFF; a[5]=0xFF;a[6]=0xFF;a[7]=0xFF;a[8]=0xFF;a[9]=0xFF; a[10]=0xFF;a[11]=0xFF;a[12]=0xFF;a[13]=0xFF;a[14]=0xFF; a[15]=0xFF; SendCmd(BIAS); SendCmd(SYSEN); SendCmd(LCDON); // SendCmd(RC256K); WriteAll_1621(0,a,16); // SendCmd(LCDOFF); } LCD Driver for HT1621 //============================================================================= #define Lcd_Delay _nop_();_nop_();_nop_();_nop_();_nop_();_nop_() void Lcd_Data(float Start, float cData) //Synchronize the bytes in the data with those on the LCD // Start -- To start with the same page address, each page has 4 valid bits, totaling 32X4 bytes // Length -- the number of pages to be synchronized { flying i; LCD_CS=0; Lcd_Delay; Lcd_Delay; Lcd_Delay; //Send ID 101B LCD_CLK=0; Lcd_Delay; LCD_IO=1; Lcd_Delay; LCD_CLK=1; Lcd_Delay; LCD_CLK=0; Lcd_Delay; LCD_IO=0; Lcd_Delay; LCD_CLK=1; Lcd_Delay; LCD_CLK=0; Lcd_Delay; LCD_IO=1; Lcd_Delay; LCD_CLK=1; Lcd_Delay; //Send Address 6bit Start=Start*2; for(i=0;i<6;i++) { if(Start&0x20) LCD_IO=1; else LCD_IO=0; Lcd_Delay; LCD_CLK=0; Lcd_Delay; Start=Start<<1; LCD_CLK=1; Lcd_Delay; } //Send data 8bit for(i=0;i<8;i++) { if(cData&0x01) LCD_IO=1; else LCD_IO=0; Lcd_Delay; LCD_CLK=0; Lcd_Delay; cData=cData>>1; LCD_CLK=1; Lcd_Delay; } LCD_CS=1; Lcd_Delay; } //============================================================================= void Lcd_Command(uchar Command) //Write a command to the specified LCD //Each command should start with 100 bits, the command length is 9 bits, and the actual effective bits are 8 bits, so add a 0 at the end // LcdSelect--LCD chip selection, value is 0,1,2 // Command----8-bit command to be written { flying i; LCD_CS=0; Lcd_Delay; Lcd_Delay; Lcd_Delay; //Send ID 100B LCD_CLK=0; Lcd_Delay; LCD_IO=1; Lcd_Delay; LCD_CLK=1; Lcd_Delay; LCD_CLK=0; Lcd_Delay; LCD_IO=0; Lcd_Delay; LCD_CLK=1; Lcd_Delay; LCD_CLK=0; Lcd_Delay; LCD_IO=0; Lcd_Delay; LCD_CLK=1; Lcd_Delay; for(i=0;i<8;i++) { LCD_CLK=0; Lcd_Delay; if(Command&0x80) LCD_IO=1; else LCD_IO=0; Command=Command<<1; Lcd_Delay; LCD_CLK=1; Lcd_Delay; } ///Fill in a 0 at the end LCD_CLK=0; Lcd_Delay; LCD_IO=0; Lcd_Delay; LCD_CLK=1; Lcd_Delay; LCD_CS=1; Lcd_Delay; } //============================================================================= void Lcd_Refresh(void) //Refresh the LCD screen { flying i; for(i=0;i ……………………
Previous article:HT1621 source code to drive LCD
Next article:STC89 MCU + TM1638 Super Stopwatch Program
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- Espressif ESP32-S2-Kaluga-1 Review Summary
- EEWORLD University Hall----Electromagnetic Compatibility Principles and Design
- MSP430 realizes access card function (RFID) through RC522
- Please recommend a DC-DC chip with 12V-3.3V wide voltage input and 3.3V2A output
- Several key performance characteristics of the MSP432P401R MCU 14-bit ADC
- 【BearPi-HM Micro】Development of smart street light module based on E53 interface
- Using Ultra-Wideband Technology to Display the Bible
- How is "u8 Dat2:7;" written in the structure? What does it mean?
- Modeling and Optimization Design of Finite State Machines
- Help! Can micropython do image processing or video processing?