1. Dot matrix principle
There are many types of dot matrix on the market, but the most commonly used is this 8x8 dot matrix
The internal structure is as follows
It can be found that the dot matrix is composed of LEDs, and one row is the anode, another row is the cathode, one row is the control row, and another row is the control column.
Open proteus and search for MATRIX. You will see various types of dot matrices. Select 8 by 8.
Choose a dot matrix of any color, and we find that the pins are not marked. By default, the upper row is cathode, control column; the lower row is anode, control row.
(Be sure to test it yourself, the direction of the dot matrix arranged by Proteus simulation may change every time)
What does it mean? It corresponds to the following figure, but the pin position has changed.
2. 4 "2x2" dot matrices are combined into a "4x4" dot matrix
Let's start with a simple understanding. First, draw four "2 by 2" dot matrixes.
Then connect the cathode control columns in the upper and lower directions
Connect the left and right anode control lines
It forms a 4*4 dot matrix
2. 4 "8 x 8" dot matrices form a "16 x 16" dot matrix
Note: The dot matrix of Proteus is really difficult to use. You can't find the direction and have to measure it yourself.
Measure two things: control column or control row, cathode or anode
3. Simulation: Display "turned into dust" in sequence, with an interval of 1 second
74hc138 and 74hc595 are used here. If you don't understand the principle, you can search it by yourself. I won't explain it here.
Corresponding code:
/*
HC595 and HC138 control 8*8 dot matrix
When I first wrote this program, the program took up more than 128 bytes of storage space.
mistake:
Dot matrix (IV) 16 times 16.C(98): error C249: 'DATA': SEGMENT TOO LARGE
The program cannot run because the array takes up a lot of memory.
Later, I added code before the array name to solve this problem.
This means that the array is stored in the program memory area (4 KB) instead of the data area (128 KB).
*/
#include sbit SH_CP = P3^0; sbit DS = P3^1; sbit ST_CP = P3^2; //The array that does not need to be changed is saved to the code program storage area unsigned char code b[3][32] = { /*-- Text: --*/ /*-- Songti 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/ 0x10,0x01,0x10,0x01,0x10,0x21,0x08,0x11,0x08,0x09,0x0C,0x05,0x0C,0x03,0x0A,0x01, 0x89,0x01,0x48,0x01,0x28,0x01,0x08,0x41,0x08,0x41,0x08,0x41,0x08,0x7E,0x08,0x00, /*-- Text: --*/ /*-- Songti 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/ 0x90,0x00,0x90,0x00,0x90,0x00,0x88,0x7F,0x48,0x01,0x4C,0x01,0x2C,0x01,0x0A,0x1F, 0x09,0x01,0x08,0x01,0x08,0x01,0x08,0x3F,0x08,0x01,0x08,0x01,0x08,0x01,0x08,0x01, /*-- Text: Dust --*/ /*-- Songti 12; The corresponding dot matrix under this font is: width x height = 16x16 --*/ 0x80,0x00,0x80,0x00,0x90,0x04,0x90,0x08,0x88,0x10,0x84,0x20,0x82,0x20,0x00,0x00, 0x80,0x00,0x80,0x00,0xFC,0x1F,0x80,0x00,0x80,0x00,0x80,0x00,0xFF,0x7F,0x00,0x00, }; void delayms(unsigned int m) { int i,j; for(i=0; i } void hc_595(unsigned int temp,unsigned int temp1) //595 segment code program { char t; bit val; for(t=0; t<8; t++) { val = temp & 0x80; //The first data is transmitted to the first 595 output DS = val; SH_CP = 0;; SH_CP = 1; temp = temp<<1; } for(t=0; t<8; t++) { val = temp1 & 0x80; //The second data is transferred to the second 595 output DS = val; SH_CP = 0;; SH_CP = 1; temp1 = temp1<<1; } ST_CP = 0;; ST_CP = 1; } void hc_138() { unsigned int n,t,i; for(i=0; i<3; i++) //Display 3 Chinese characters { for(t=0; t<30; t++) // used to delay for 1 second { for(n=0; n<16; ++n) //Display one Chinese character at a time { if(n<8) //The first high level of 138 moves down { P3_6 = 1; //The first 138 is enabled, the second 138 is not working P2 = n; } else //The second high level of 138 moves down { P3_6 = 0; //The second 138 is enabled, the first 138 does not work P2 = n-8; } hc_595(b[i][2*n],b[i][2*n+1]); //Send segment code delayms(2); } } } } void main(void) { while(1) { hc_138(); } }
Previous article:C51 tutorial second 51 program: Marquee and running lights
Next article:51 single chip microcomputer project design: ultrasonic ranging, smart car (keil+proteus)
Recommended posts
- After the holiday, I will give you a review~~
- Hello~Helloeveryone~Themanagerisheretosendinformationagain~~Comeandtakealookatthelatestsituation~~ Newactivitiesonline: 1.AnxinkeBluetoothDevelopmentBoardPB-02-Kit Activitiesintheapplicationperiod: 2.MirMYD-Y
- okhxyyo Special Edition for Assessment Centres
- What should I do if the RTC clock occasionally delays or times out?
- Troubleshootingandanalysis1.TheindustrialcontrolboardusesNXP'sPCF8563RTCchipsolution,whichisanexternal32.768kHzquartzcrystalandcapacitor.TheoutputaccuracyoftheRTCchipdependsonwhethertheclockfrequencyoutputb
- Aguilera Microcontroller MCU
- Wearable network design solutions based on Bluetooth and ZigBee technologies
- Wearablecomputersrequirethehosttobelightandsmallduetotheirwearability.ThehostchipusestheLinuxembeddedoperatingsystem,onwhichtheBluetoothprotocolstackisintegrated.Duetothecontradictionbetweenthemultimediastream
- Jacktang Wireless Connectivity
- Matters needing attention in the production of high-frequency microwave boards
- 1.Introduction Withthecontinuousdevelopmentofscienceandtechnology,especiallyinformationtechnology,theprocesstechnologyofprintedcircuitboardproductionhasbeenimprovedaccordinglytomeettheneedsofdifferentusers.Inrecen
- Jacktang Wireless Connectivity
- 《Rust in Action》vscode plugin installation
- 1、rust-analyzer 2、CodeLLDB 3.CatppuccinNoctisTheme 4、crates 5、ErroLens 6.EvenBetterTOMLSupportcompletefeaturesof.tomlfiles Rustylittlecrabhahaha Thankyouforyourattention,Rustisexcellent,butthereis
- lugl4313820 Programming Basics
- Analog Filter and Circuit Design Handbook
- Averypracticalreferencebookonanalogfiltersandcircuitdesign. Thismanualisdividedinto19chapters,whichanalyzeanddiscussthedesignofvariousactiveandpassivefilters,computer-aideddesignoffilters,mathematicalcharacteris
- arui1999 Download Centre
- 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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- 【BearPi-HM Micro】Part 4: Familiar with the Openharmomy compilation framework and serial port interactive output
- 50 ways to use TI CC6678 digital signal processor (DSP)
- Share: How to reduce EMI and shrink power supply size with integrated active EMI filters
- Calculation and setting of baud rate of msp430 microcontroller
- What is this device and what does it do?
- NeoPixel NanoRing
- How to optimize the area of FPGA design
- LED screen blanking technology
- Integer division problem
- MSP430F5529LP (I) HELLOWRLD of IIC and OLED