The design demonstrates the effect: the upper half of the screen displays static Chinese characters (* * *I believe you will succeed!), and the lower half of the screen displays animation effects (a hammer hitting a nail, and a looping effect of the hammer falling and the nail being driven in). The complete program source code can be downloaded from here http://www.51hei.com/f/12864dh.rar. Note that this is a screen without a font library. The circuit is as shown in the figure above, and the program has been tested successfully.
#include#define uchar unsigned char #define uint unsigned int sbit lcdcs1=P3^7; sbit lcdcs2=P3^6; sbit rs=P3^5; sbit rw=P3^4; sbit lcden=P3^3; uint unm,mcu,unm1,unm2,unm3,uum; uchar code table[]={0x00,0x00,0x08,0x88,0x88,0x9E,0xE4,0x44,0x5C,0x47,0x44,0xC4,0x04,0x00,0x00,0x00, 0x00,0x00,0x00,0x10,0x90,0x50,0x30,0xFF,0x28,0x48,0x88,0x88,0x00,0x00,0x00,0x00, 0x00,0x80,0x40,0xF0,0x08,0x06,0x10,0x50,0x50,0xFF,0xA8,0xA8,0x88,0x80,0x00,0x00, 0x00,0x20,0x20,0xA0,0xFF,0x90,0x10,0x00,0xF0,0x48,0x48,0x48,0x08,0xF8,0x00,0x00, 0x00,0x00,0x00,0x3F,0x04,0x02,0x01,0x01,0x02,0x04,0x20,0x7F,0x00,0x00,0x00,0x00, 0x00,0x20,0x1A,0x01,0x08,0x10,0x00,0x03,0x08,0x10,0x00,0x09,0x11,0x31,0x00,0x00, 0x01,0x00,0x00,0x3F,0x00,0x01,0x01,0x01,0x01,0x7F,0x00,0x04,0x08,0x07,0x00,0x00, 0x08,0x04,0x03,0x00,0x7F,0x00,0x01,0x00,0x1F,0x09,0x09,0x09,0x30,0x1F,0x00,0x00, 0x80,0x40,0x20,0xF8,0x06,0x10,0x10,0x50,0x50,0x4A,0xAC,0xA8,0x08,0x08,0x08,0x00, 0x00,0x80,0x40,0xF0,0x0E,0x00,0x40,0x30,0x2E,0xA0,0x10,0x50,0x30,0x00,0x00,0x00, 0x00,0x80,0x40,0x20,0x50,0x4C,0x43,0x24,0x28,0x10,0x20,0x40,0xC0,0x80,0x80,0x00, 0x00,0x00,0x00,0xE0,0x20,0x20,0x27,0x78,0x90,0x10,0x12,0xC4,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x1D,0x15,0x15,0x12,0x1E,0x00,0x00,0x00,0x00, 0x01,0x00,0x00,0x3F,0x00,0x08,0x06,0x10,0x20,0x3F,0x00,0x02,0x04,0x0C,0x00,0x00, 0x01,0x00,0x02,0x32,0x2A,0x26,0x22,0x11,0x15,0x19,0x31,0x00,0x00,0x00,0x00,0x00, 0x20,0x10,0x0C,0x03,0x09,0x11,0x0F,0x10,0x09,0x06,0x09,0x10,0x20,0x40,0x78,0x00, 0x00,0x00,0x20,0x20,0xF0,0x10,0x10,0x40,0x40,0xC0,0x3E,0x20,0x20,0xE0,0x00,0x00, 0x00,0xC0,0x60,0x50,0x2C,0xE0,0x80,0x40,0xA0,0x38,0x26,0x10,0xF0,0x00,0x00,0x00, 0x00,0x00,0x00,0xFC,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x02,0x02,0x02,0x02,0x21,0x11,0x09,0x04,0x03,0x10,0x20,0x10,0x0E,0x01,0x00,0x00, 0x00,0x07,0x19,0x09,0x08,0x1F,0x00,0x00,0x00,0x03,0x10,0x20,0x1F,0x00,0x00,0x00, 0x00,0x00,0x00,0x19,0x19,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x08,0x1C,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xDC,0xC8,0xC0,0xC0, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0xF0,0xF0,0xF0,0xF0,0xE0, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x10,0x38,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3B,0x13,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x0F,0x0F,0x0F,0x0F,0x07, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x10,0x18,0x18,0x1C,0x1C,0xFE,0xFE,0xFE,0xFE,0xFE,0x1C,0x1C,0x18,0x18,0x10,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x0F,0x3F,0xFF,0x3F,0x0F,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x08,0x1C,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xFE,0xDC,0xC8,0xC0,0xC0, 0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xE0,0xF0,0xF0,0xF0,0xF0,0xE0, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x10,0x38,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3B,0x13,0x03,0x03, 0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x03,0x07,0x0F,0x0F,0x0F,0x0F,0x07, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0xE0,0xF8,0xFC,0xFE,0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0xFE,0xFC,0xF8,0xE0,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x03,0x0F,0x1F,0x3F,0x3F,0x7F,0x7F,0x7F,0x7F,0x7F,0x3F,0x3F,0x1F,0x0F,0x03,0x00, }; void delay(int z) { int x,y; for(x=z;x>0;x--) for(y=0;y>0;y--); } void writen_com(uchar com) { lcden=0; delay(1); rs=0; lcden=1; P0=com; delay(1); lcden=0; rs=1; } void writen_dat(uchar dat) { lcden=0; delay(1); rs=1; lcden=1; P0=dat; lcden=0; delay(1); rs=0; } void init() { mcu=0; lcden=1; rw=0; writen_com(0x3f); writen_com(0xc0); writen_com(0xb8); writen_com(0x40); lcdcs1=1; lcdcs2=0; } void main() { init(); for(unm1=0;unm1<3;unm1++) { for(unm=mcu;unm
Previous article:Mini operating system with semaphores and preemptive interrupt scheduling (based on 8051)
Next article:Waveform generator made by 51 single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 22:50
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- MotionDRV DC servo drive PID parameter tuning
- Which one is better among ceramic antenna, PCB antenna and IPEX antenna?
- EEWorld invites you to dismantle (fifth issue) - Gosund CP5 Pro smart power strip dismantling report
- Is the vibration direction and wave propagation direction similar to the rhythm of the Humen Bridge?
- How to get started with Renesas MCU?
- Watch the video to win a JD card | Taixiang's actual test of Shui Ge's secrets [Second issue]
- EEWORLD University Hall ---- 2019UDE on-site report: Appotronics leads laser display to a new peak
- SK Hynix only pays 17 months' salary as year-end bonus, sparking employee dissatisfaction
- Microcontroller Program Outsourcing: Urgently need help to write an MCU to control the RF chip to send and receive
- Apply for ADI smoke detection module for free, design smoke detectors more reasonably, and save lives more effectively.