Although digital photo frames have been around for several years, they are still a new concept for many people. Digital photo frames display digital photos through LCD screens, can obtain digital photo information from SD cards through card reader interfaces, and can be set to display in a loop. They are more flexible and versatile than ordinary photo frames, and also provide a new display space for the increasing number of digital photos. This article introduces an embedded simple digital photo frame based on the mini2440 ARM9 development system. Its hardware including keyboard, IO port, display software including LINUX operating system are all resources of mini2440, which will not be described in detail here.
1. Main functions
After booting up, the boot picture will be displayed. Click the icon on the touch screen to enter the setting interface or on-demand interface. In the setting interface, you can adjust the volume of the background music and set the switching time when playing the slide show. Click the play interface to enter the playback of pictures in the USB.
2. Development environment and hardware circuit
1. Host environment
In the virtual machine, Fedora9 is used to enable the smaba service.
Use Source Insight to edit and view the code under Windows, and compile under Linux environment.
2. Development board environment
The Linux system uses the 2.6.26 kernel. The kernel contains key underlying drivers, such as LCD, sound card, network card, etc. Designers should have some basic knowledge of the Linux operating system.
3. Hardware
The mini2440 is a low-cost and practical ARM9 development board, which is a very cost-effective learning board. It uses Samsung S3C2440 as the microprocessor, and uses professional and stable CPU core power chip and reset chip to ensure the stability of system operation. The development board provides support for sound card, network card, USB, etc., which is very convenient for the production of digital photo frame.
Its main technical parameters are as follows:
(1) CPU processor: Samsung S3C2440A, main frequency 400MHz, maximum 533Mhz;
(2) SDRAM memory: 64M SDRAM on board; 32-bit data bus; SDRAM clock frequency up to 100MHz;
(3) FLASH storage: on-board 64M Nand Flash;
(4) Main interfaces and resources:
- 1 100M Ethernet RJ-45 interface (using DM9000 network chip);
- 3 serial ports; - 1 USB Host;
- 1 USB Slave Type B port;
- 1 SD card storage interface;
- 1 stereo audio output interface, 1 microphone interface;
(5) LCD display: 320×240 32-bit color LCD with touch screen; the board integrates a 4-wire resistive touch screen interface, which can be directly connected to a 4-wire resistive touch screen; supports black and white, 4-level grayscale, 16-level grayscale, 256-color, 4096-color STN LCD screens, with sizes ranging from 3.5 inches to 12.1 inches, and the screen resolution can reach 1024×768 pixels;
(6) With audio output, used to play music. [page]
3. Development and production process
1. Port QT (version is qt-embeddedfree-3.3.7)
QT is a cross-platform C++ graphical user interface library, which is an application framework and window system for providing graphical user interfaces for small devices. It provides a rich set of widgets, supports the customization of widgets, and can provide users with beautiful graphical interfaces. QT is an open source graphical interface software and one of the most popular graphical interfaces. The specific transplantation steps are as follows:
(1) Download the QT source code qt-embedded-free-3.3.7.tar.gz and qt-x11-free-3.3.7.tar.gz from ftp://ftp.trolltech.com/qt/source/.
(2) Compile qt-x11-free-3.3.7
① tar zxvf qt-x11-free-3.3.7
② cd qt-x11-free-3.3.7
③ ./configure
④ /usr/bin/gmake
(3) Cross-compile: compile qt-embedded-free-3.3.7
① tar zxvf qt-embedded-free-3.3.7
② c p q t - x 1 1 - f r e e - 3 . 3 . 7 / b i n / u i c q t -embedded-free-3.3.7/bin
③ c p q t - x 1 1 - f r e e - 3 . 3 . 7 / b i n / m o c q t -embedded-free-3.3.7/bin
④ cd qt-embedded-free-3.3.7
⑤ . / c o n f i g u r e - s h a r e d - t h r e a d-embedded arm -qvfb -freetype -depths4 , 8 , 1 6 , 2 4 , 3 2 - q t - g i f - q t - l i b p n g - q t -libmng -qt-libjpeg -qtopia-sqlite -no-qvfb/usr/bin/gmake
(4) 运行qt-embedded-free-3.3.7/example/hello/hello :
#cd qt-embedded-free-3.3.7/example/hello./hello –qws
If the screen displays hello, it means the transplant is successful.
[page]
2. Porting the audio player
The player used is Madplay. Madplay is an open source player and is easy to use.
Main program for managing Madplay, including play, pause, resume, and stop.
system("madplay north.mp3 &");
// Use the system function to call the madplay player to play *.mp3 music
system("madplay north.mp3 -r &"); //Loop playback: parameter -r
system("killall -9 madplay");
// Use the system function to call the killall command to terminate madplay
system("killall -STOP madplay &");
// Use the system function to call the killall command to pause madplay
system("killall -CONT madplay &");
// Use the system function to call the killall command to resume madplay playback
The specific steps are:
(1) Madplay's official website is http://www .
underbit.com/products/mad/. According to the introduction on the website, it also requires two libraries, libmad and libid3tag. The download link can be found from the website: http://sourceforge.net/project/showfiles.php ?
group_id=12349, you will get the three files needed to port Madplay: madplay-0.15.2b.tar.gz, libmad-0.15.1b.tar.gz and libid3tag-0.15.1b.
tar.gz.
(2) Put these three files into the madplay folder. The specific operations are as follows:
#cd /
#mkdir madplay
#cd madplay
#mkdir src-arm target-arm
After decompression#cd madplay
#for f in $(ls *.tar.gz); do tar xvzf $f –C/src-arm ; done.
(3) Install libid3tag
#cd /src-x86/libid3tag-0.15.1b
# . / c o n f i g u r e - - p r e f i x = / m a d p l a y /target-x86
#make
#make install
(4) Install libmad
#cd / libmad-0.15.1b
#./configure --prefix= /target-arm
#make
#make install
[page]
(5) Compile and install madplay
#cd /madplay/madplay-0.15.2b
# . / c o n f i g u r e - - p r e f i x = / m a d p l a y /t a r g e t - x 8 6 - - C P P F L A G S = - I m a d p l a y /t a r g e t - a r m / i n c l u d e – L D F L A G S = - L /madplay/target-arm/lib
Generate the Makefile file required for compilation. Enter the following command to start compiling and installing:
#make
#make install
(6) After the execution is completed, the executable file is installed in the specified directory /madplay/target-arm/bin/madplay. Copy an MP3 file to the directory where madplay is located, and execute: #./madplay test.mp3, and you can hear the sound of the MP3.
3. Write a program
(1) Write operation process.
Create a mainwindow class in the main program to display the startup interface and receive click events on the startup interface.
① Create a setting class in the main program, initialize it as hidden, and use it to configure the background music, volume, and slide show format. When the boot interface is displayed, click the configuration icon, the object of this class is displayed, and the configuration interface is displayed. Click the hidden icon of the setting interface to hide the interface; the configuration interface sets the switching time, music, and volume of the slide show. ② Create a play class in the main program, initialize it as hidden.
After the startup interface is displayed, if you click the play button, the picture will start playing. During the playback process, click the on-demand interface to display the startup interface.
③ After setting, click the "Play" icon to start playing.
(2) Establish a program framework.
QT is easy to use and powerful. Using it to realize the functions of this work saves a lot of trouble in writing programs. It provides support for most popular image formats, such as BMP, PNG, JPEG, etc., and can process images. We can use QT programming to achieve image flipping, distortion, scaling, overlapping, and various switching effects of playing slides. Use the touch screen to realize input operations and switch interfaces.
(3) Edit and debug the program.
The program is written in C++, edited with source insight software in the Windows host system, and compiled in the virtual machine Linux environment through file sharing. The specific steps are as follows:
① In the shared directory of the Windows host and the Linux virtual machine, open the source insight software, create a project, import the QT source code into the source insight project, and then create a new digital photo frame file in this project. In this way, the class members will be automatically completed.
② After editing, save.
③ Enter the digital photo frame project path of the virtual machine and execute the following command to compile.
/bin/qmake –project
/bin/qmake
make
④ Mount the development board and debug (using NFS). Enter the development board terminal, execute relevant commands, and view the program execution effect.
Repeat the above steps until the program is debugged satisfactorily, then burn the debugged program into the flash chip of the board and run it offline.
IV. Conclusion
Digital photo frames require simplicity and practicality, beautiful interface, and strive to give people spiritual enjoyment. This production focuses on this goal and highlights the beautification of the interface, such as the slide switching and volume adjustment interface. The digital photo frame has simple functions and a general framework. On this basis, many modifications and upgrades can be made, such as connecting to the network, playing videos, displaying calendars, alarm clocks, etc.
Previous article:Development of Traffic Violation Capture System Based on ARM9
Next article:Research on SIM card detection system based on ARM
Recommended ReadingLatest update time:2024-11-16 16:54
- Popular Resources
- Popular amplifiers
- Practical Deep Neural Networks on Mobile Platforms: Principles, Architecture, and Optimization
- ARM Embedded System Principles and Applications (Wang Xiaofeng)
- ARM Cortex-M4+Wi-Fi MCU Application Guide (Embedded Technology and Application Series) (Guo Shujun)
- osk5912 evaluation board example source code
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
- What if the uploaded image is not used? See here
- [Xingkong Board Python Programming Learning Main Control Board] Flip Tomato Clock
- How to send more than 20 bytes of data at a time with blue_nrg
- I stayed up late to sort it out. Here is the servo information on the national competition list.
- How to make an overvoltage protection circuit?
- Detailed explanation of starting surge current
- Showing off the goods + the development boards we have used together over the years
- A newbie asks for help, IAR compiles and reports undefined errors
- The motherboard of Huawei P30 looks like this
- RS-485 Transceiver