A simple full-color LED dot matrix screen program with clock, temperature, music spectrum, bad apple, full-color animation, text display and other functions
Hardware schematic
https://oshwhub.com/code504/led-quan-cai-dian-zhen-ping_copy_copy
Software source code
https://gitee.com/dma/full-color-led-screen
Video demonstration
https://www.bilibili.com/video/BV1t541127oo/
Size: 256mm * 128mm
Resolution: 64 * 32
Interface: HUB75
Specifications: P4, full color, 16 scan
Clock chip: PCF8563
Temperature and humidity chip: SHT30
Microphone: MAX9814
Storage: Any model SPI NOR Flash
VS1838B or compatible infrared receiving tubes are reserved for remote control operation.
Two commonly used packages of ESP8266 are reserved, which can be connected to the network to achieve richer functions.
Three power supply modes of USB, DC and binding posts
are reserved. 1 PWM is reserved. Can be connected to buzzer, etc.
Due to the epidemic, the LED diffuser I bought did not arrive, so I used an ordinary transparent plastic plate and a frosted plastic bag to make a temporary diffuser.
If the diameter of the LED is relatively large, buy a thicker diffuser. The specific effect needs to be adjusted by yourself.
As we all know, the price of the STM32F103 series of microcontrollers has skyrocketed since 2021, and now it is simply unaffordable. I made it with the inventory on hand. Here are two alternatives:
Serial port 1 debugging interface
Serial port 2 reserves ESP8266
ADC0 photoresistor to realize automatic brightness
ADC1 audio input
Timer 1 interrupts at 24kHz frequency, responsible for ADC audio sampling
Timer 3 interrupts at 100Hz frequency, responsible for key scanning and screen refresh
Prerequisite: Know basic command line operations
.ffmpeg.exe -i video.mp4 -vf scale=48:32 -frames 400 %04d.bmp
-i video.mp4
The file name to be converted -vf scale=48:32
is the video scaling size. My screen is 64x32. Suppose I want to convert a 4:3 The video will fill the screen without stretching. Simply calculate the length and width after scaling, which is 48x32. -frames 400
N frames before conversion. %04d.bmp
Output file name. See ffmpeg.exe -help full
yourself.
erase_spi()
erase the chip, wait for the erasure to complete, write_spi()
, and then use the send file function of the serial port tool to send the bin file generated in the previous step.The fonts are all PCtoLCD2002
generated using , and the configuration is: negative code, reverse (low-end first), column-row type, and the character table is sorted according to GB2312 or GBK encoding.
If you don’t use many characters, you can just generate the necessary Chinese characters like this project. Write the characters directly into the microcontroller.
If you want to display a large number of characters, it is recommended to generate a complete GB2312 or GBK font library, put it in an external flash, and implement the search function of the font library yourself.
Test conditions:
MCU frequency: 72MHz
Screen color: pure white
Color mode: RGB565
Turn off all interrupts, cycle and refresh the screen 1000 times, time-consuming
brightness | time consuming |
---|---|
1 | 4889ms |
2 | 4930ms |
3 | 4972ms |
4 | 5013ms |
5 | 5054ms |
6 | 5096ms |
7 | 5147ms |
8 | 5179ms |
9 | 5220ms |
10 | 5261ms |
15 | 5468ms |
20 | 5675ms |
30 | 6088ms |
40 | 6520ms |
50 | 6915ms |
For indoor use, a screen brightness between 1 and 10 is sufficient. Higher brightness requires greater current, and the LED heats up more seriously.
This project code is compatible with or without MicroLIB. If there are no special applications, it is recommended to use MicroLIB. Without MicroLIB, the code size will be larger after compilation. The specific size depends on how many standard library functions are used.
The most common problem of not using MicroLIB: Error: L6200E: Symbol __stdout multiply defined (by retarget.o and stdio.o).
For solutions, see:
https://developer.arm.com/documentation/ka003082/latest and the chapter
in this article
https://developer.arm.com/documentation/ka003082/latestRESOLUTION FOR SEMIHOSTING ISSUE
Different LEDs have different specifications, and there will definitely be color differences compared with the monitor. If you want to get a better picture display effect, you need to manually adjust the brightness, chroma, gamma, etc. of the picture on the computer, and then put the adjusted image on the dot matrix screen. displayed, repeat this process until you are satisfied. If you have the ability, you can develop the function of adjusting the image on the microcontroller yourself.
When the refresh rate of the actual test dot matrix screen is lower than 50Hz, the flicker is obvious and uncomfortable for the eyes. You can make a simple estimate based on the refresh rate test results above. For example, assuming that STM32F1 is used to drive an 80x40 dot matrix screen, it takes approximately (80 * 40) / (64 * 32) * 4.889 = 7.76 ms to refresh one screen when the brightness is 1. If you want to drive a higher-resolution dot matrix screen, you need to optimize the code and replace it with a newer and more powerful microcontroller.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet