通通

【RA】Based on Renesas MCU spectrum lamp +1051772A

 
Overview

Introduction

This is a music spectrum light based on the Renesas R7FA2L1AB2DFL microcontroller. The screen uses a P4 full-color unit board. Friends who like to play with dot matrix screens will definitely like this "super large dot matrix screen". Due to the rush of time, At present, we only have the spectrum function. We will change the PCB later and add the functions of automatic brightness adjustment, temperature measurement, and clock display (because this time the board does not have photoresistor, temperature sensor, and button battery)

 

Hardware description

Main control: R7FA2L1AB2DFL

Audio input: microphone/headphone port

Op amp: NE5532DR

Screen: P4 full-color unit board (256mmx128mm, 16 scans)

Serial port: Program download 1

ADC0 channel 0: capture audio

ADC0 channel 1: Collect ambient brightness

Buttons: Four buttons are reserved, among which BOOT and RST are used to download programs, and KEY1 and KEY2 are used to switch modes, colors, brightness, etc.

The audio collection part on the PCB is not laid with copper in order to reduce interference.

Later expansion: A photoresistor will be added to automatically adjust the brightness, a DS18B20 will be added to detect the ambient temperature, a DS3231 clock module will be added (optional), and a button battery will be added to power the clock when the power is lost.

 

Software description

screen driver

Timer 0 scans the screen at a frequency of 100X16HZ, with the highest interrupt priority (otherwise the screen will flicker). Why should the screen refresh speed be set to such a high rate? This is related to my driving method. My screen is scanned 16 times, scanning 2 lines at a time. A total of 32 lines are scanned in 16 times. Timer 0 generates an update interrupt. In the interrupt callback function, I only scan once, that is Only 2 lines are scanned, so 16 interrupts are required to refresh the entire screen. It can be seen that the actual refresh rate of the screen is 100X16HZ/16=100HZ, which is a very normal refresh rate. There is another scanning method as follows;

You can set the timer 0 update interrupt to 100HZ, and then scan 16 times at a time in the interrupt callback function. This can also achieve a 100HZ refresh rate and is easier to understand, but this will increase the number of steps in the interrupt callback function. Time, according to actual measurements, will affect the while(1) loop on this microcontroller, and will have little impact on microcontrollers with higher main frequencies.

 

ADC acquisition

Timer 1 is used to trigger channel 0 of ADC0 to collect audio. The common audio sampling frequency is 44100HZ. People are more sensitive to high-frequency sounds above 10KHz. Although this part carries small energy and the amplitude on the screen is small, But it doesn’t matter. I specially reserved a potentiometer for adjusting the amplitude. This potentiometer can adjust the amplification factor of the audio signal, thereby adjusting the amplitude of the spectrum display (valid in actual measurement). According to the Nyquist theorem, a 10KHz signal is collected. The sampling frequency should not be lower than 20KHz, so here the sampling frequency is set to 20KHz, timer 1 is used to trigger ADC0 channel 0 adoption, and the adoption result is transmitted to the designated memory through DTC (the DTC function is similar to DMA)

Note: The ADC, TIM, and DTC here are not connected using the ELC event connector (cannot configure it (face covering.jpg)), but the effect will be better if the ELC is used.

 

Fast Fourier Transform

The original plan was to use 256 sampling points, but the actual calculation was too slow, so I had to use 128 points to barely use it (I suspect that my e2 Studio configuration was wrong, causing the microcontroller to run at an absurdly low speed). The fft calculation was done by Jiang Ke University. fft.c source code written by Chemical Association UP.

 

Physical picture

The back of the real thing is as follows

 

Attached below is a brief explanation on the back:

 

 

As shown in the figure below, the PCB circuit board communicates with the screen through the interface in the red circle. The M3 hole in the blue circle can fix the PCB on the back of the screen. The yellow circle is the power supply interface of the screen.

 

 

Attached below are the surface measurement pictures

 

 

Effect picture

Due to a lot of things recently, I haven’t cut the video and posted it to Bilibili. This will be made up in two days. You can take a look at the pictures first (I used 32 before and posted it to Bilibili. You can go and take a look > https://b23.tv /lyYAUzc?share_medium=android&share_source=qq&bbid=XY190221153CD515F9E44E2D2280C56F73120&ts=1652075244985
) If the link cannot be opened, you can watch the video below


 

16x16 Chinese character display effect

 

 

32x32 Chinese character display effect

 

 

I personally think the clock effect is very nice, and the switching between numbers is very artistic. This version does not have a clock because there is no button battery. It will be added in the next version. The clock switching effect is in the 32 video. If you are interested, you can move it. Go watch it ( >https://b23.tv/lyYAUzc?share_medium=android&share_source=qq&bbid=XY190221153CD515F9E44E2D2280C56F73120&ts=1652075244985 ) If the link cannot be opened, you can watch the video at the bottom

 

Detailed explanation of full-color unit board driver

 

Wiring instructions

All full-color unit boards have this HUB75 interface

R1, G1, and B1 are the color control lines of the upper 16 rows, R1, G2, and B2 are the color control lines of the lower 16 rows; A, B, C, and D are address lines, a total of 32 rows and 16 addresses; CLK is the clock signal line; LAT is the data storage line; OE is the display enable line;

 

Control timing description

First, select two rows through the four address lines A, B, C, and D. For example, A=0, B=0, C=0, D=0. Select row 0 and row 16, A=1, B=0. , C=0, D=0, select row 1 and row 17, A=0, B=1, C=0, D=0, select row 2 and row 8...

After the address is selected, the color data begins to be transmitted. Here, take A=1, B=0, C=0, D=0, and select rows 1 and 17. Now rows 1 and 17 are selected, and then I let R1=1,G1=0,B1=0, so the first point in row 1 is red (because only R is 1, G and B are both 0), and R2=0,G2=1,B2=0 , so that the first point on line 17 is green (because only G is 1, R, and B are all 0), then pull CLK high, and then release CLK to start transmitting to the second point on line 1 and line 17. Color data, loop like this 64 times, the 64 points on rows 1 and 17 have all written the color data we want, and then we pull LAT high and release it to start transmitting data to the next address. , loop like this 16 times, and the 16 addresses and 32 lines of the screen will be filled with the color data we want, thus completing a screen refresh;

 

The above is my personal understanding of the full-color unit board driver. If there are any inaccuracies, please comment and point out. What I said above can only achieve 7 colors of display. Once you truly understand it, you will understand that the full-color display screen needs to be refreshed at one time. It needs to be scanned many times, which requires very high performance of the microcontroller. However, there are ways to bypass this so that ordinary microcontrollers can also achieve full-color display. This is what I found out after the explanation of the stack pointer, the UP master. Attached here Stack Pointer UP Master’s original words, I really admire him for being able to explain complex things so simply and clearly.

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-24 05:46:48
  • LED battery power supply circuit solution
  • AVR studio interrupts
  • How to load JPEG image files under EVC?
  • Common problems in Sch schematic design
  • Power Issues
  • Could you please tell me which manufacturers produce magnetic resistance switches? I only found one.

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号