The schematic diagram of the 16*16 dot matrix simulation of the single chip microcomputer is as follows
The dot matrix cannot be directly connected to the microcontroller due to the large current, so 74hc595 is used to drive the serial-to-parallel chip, which can also be controlled with very few IO ports.
The microcontroller source program is as follows:
#include "reg51.h"
#define uchar unsigned char
#define uint unsigned int
#define Lie P1
sbit SHCP = P2^0;
sbit DS = P2^1;
sbit STCP = P2^2;
uchar code led[ ] ={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x40,0x08,0x40,0x0A,0x48,0xEA,0x4B,0xAA,0x4A,0xAA,0x4A,0xAA,0x4A,0xFE,0x7F,
0xAA,0x4A,0xAA,0x4A,0xA9,0x4A,0xF9,0x4B,0x29,0x48,0x0C,0x60,0x08,0x40,0x00,0x00, // 重
0x00,0x40,0x00,0x20,0xFC,0x9F,0x44,0x80,0x44,0x40,0x44,0x20,0x44,0x18,0x45,0x06,
0xFE,0x01,0x44,0x06,0x44,0x18,0x44,0x20,0x66,0x40,0x44,0xC0,0x00,0x40,0x00,0x00, //Celebration
0x80,0x80,0x80,0x40,0xFC,0x3F,0x96,0x02,0xA5,0x44,0x84,0x80,0xFC,0x7F,0x08,0x80,
0x08,0x40,0xC9,0x3F,0x4A,0x00,0x4E,0x00,0xE8,0x3F,0x4C,0x40,0x08,0x70,0x00,0x00, //航
0x40,0x80,0x42,0x80,0x42,0x40,0x42,0x20,0x42,0x10,0x42,0x0C,0x42,0x03,0xFE,0x00,
0x42,0x03,0x42,0x0C,0x42,0x10,0x42,0x20,0x43,0x40,0x62,0xC0,0x40,0x40,0x00,0x00, //day
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
};
//uchar led[]={}
void shift16bit(uchar dat1,uchar dat2) //595 outputs 16-bit data
{
flying i;
STCP=0;
for(i=0;i<8;i++)
{
SHCP=0;
if(dat1 &0x80) DS=1;
else DS=0;
dat1<<=1;
SHCP=1;
}
for(i=0;i<8;i++)
{
SHCP=0;
if(dat2 &0x80) DS=1;
else DS=0;
dat2<<=1;
SHCP=1;
}
STCP=1;
}
void delay(uint x)
{
uint i;
for(i=0;i void main() { fly i,x=0; uint n; while(1) { for(n=0;n<10;n++) for(i=0;i<16;i++) { Lie=i; shift16bit(led[2*i+1+2*x],led[2*i+2*x]); delay(100); } x++; if(x==64) x=0; /* for(n=0;n<100;n++) ……………………
Previous article:Course Design of Serial Communication between Single Chip Microcomputer and PC
Next article:51 MCU + ULN2003 drive 5V deceleration stepper motor program
Recommended ReadingLatest update time:2024-11-15 14:39
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- 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
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- 【DWIN Serial Port Screen】Practical Application
- [National Technology N32G457 Review] RT-Thread drives SSD1306
- F28335 ADC module trigger EPWM setting error
- ADI Live Review on April 21: What to listen to in traffic jams? New generation of in-car audio systems and software-defined cars
- IIC communication problem between MSP430 and SHT11
- MSP430.dll initialization error occurs in the MSP430 download program
- A Problem with TTL Inverter Circuit
- EEWORLD University Hall ---- Sensor Technology and Applications Fan Shangchun, Beijing University of Aeronautics and Astronautics
- 【Case Study】 Rigol spectrum analyzer base station signal test and Bluetooth frequency hopping signal test
- Analog Discovery 2 Review (6) Waveform Generator