Mobile phones are becoming more and more widely used in modern life, and their functions are also increasing. For example, many mobile phones now have MP3 and camera functions, and some have flash letters and pedometer functions. The mobile phone flash letter requires the processor to complete multi-channel analog input, real-time processing of data, etc. The original mobile phone is difficult to directly implement these functions, and the MCU is required to complete its function.
PMP and other portable devices mostly have color TFT screens, while the traditional driver is done by white LEDs, but there are color differences; nowadays most of them use RGB three-color LEDs for backlighting, and need to detect the effect of backlight to overcome the darkening of LED brightness. The problem. The MCU can assist the host processor in performing these functions to achieve a good backlighting of the color TFT screen.
Portable devices are often provided by multiple companies to provide modules, and MCUs need good security. Therefore, the requirements of the portable device for the MCU mostly need small size, low power consumption, fast response in real time, good confidentiality, and low cost. Small package high integrated MCU, can integrate FLASH, ADC, DAC, OSC, SRAM, PWM, temperature sensor, watchdog, etc., and facilitate MCU programming and upgrade.
This article introduces the following contents: mobile phone flash and pedometer introduction, mobile phone flash letter to MCU demand, mobile phone flash letter C8051F313 advantages, color TFT screen RGB drive scheme, color TFT screen C8051F310 program, small size MCU Advantages of applications in portable devices, etc.
First, the mobile phone flash letter and pedometer introduction1, the flash function in the phone
In the dark environment, by shaking the mobile phone quickly and left and right, using the human retinal delay phenomenon, resulting in visual residual image, thus forming a continuous light and shadow signal, so that the viewer visually produces continuous information, which is the basic principle of the flash letter. In the actual processing, after the processor detects the acceleration change, the corresponding LED is turned on or off at different times according to the acceleration of the motion, and the user feels that a complete dot image, an image or a The string text will show up in 0.1 seconds.
2, automatic flip
Because of the acceleration of gravity, the motion sensor can detect the direction added by the gravity acceleration, and can automatically adjust the direction of the displayed characters.
3, pedometer function
During the walking or running, the acceleration and time axis become a sine wave; using the acceleration sensor to detect the acceleration of the motion, it is possible to calculate how many steps have been taken, and to estimate the distance traveled according to the stride.
Second, mobile phone flash letter requirements for MCUIn this application, the MCU needs to sample the input of two accelerometers for calculation and analysis, display the corresponding LEDs at different times, analyze the direction held by the mobile phone, and realize the automatic flip function. Analyze the acceleration value and calculate how many steps the holder has taken. Complete the communication function with the mobile phone, receive the command and display data sent by the mobile phone, and return the value of the pedometer.
Since the module needs to be placed in the mobile phone, the size of the module is strictly required, and a small package is also required to facilitate heat dissipation. Handheld devices such as mobile phones have high power requirements. After the mobile phone plus the flash and pedometer modules, the working hours of the mobile phone cannot be shortened. The MCU can directly drive multiple IOs with instantaneous high current, such as driving 16 high-brightness LEDs with a current of 15~20mA, without the need for other driver chips, which can save space and cost. In order to adapt to different mobile phone applications, the module provides as many communication interfaces as possible, such as SMBus (I2C), UART, SPI and other communication functions. Its functional block diagram is roughly as follows:
Its flash letter display effect is as follows:
In this application, we chose C8051F313, its resources are as shown above, and the design is well completed. The chip has the following advantages.
1, small size, high integration: its C8051F313 size is 5x5mm, as shown above, the MCU contains 8K FLASH, 1K SRAM, ADC, I2C, UART, SPI, PCA, watchdog, 25 IO and other resources. Its QFN28 package also facilitates heat dissipation.
2, good confidentiality, easy programming: FLASH can support online modification, while the built-in programming control circuit can prevent external illegal read and write access to FLASH; provide a handheld programmer that does not need to connect to a computer, and can perform MCU through C2 Programming and upgrading.
3, high-speed processing capabilities: C8051F313 uses CIP51 core technology, fully supports the 8051 instruction set, can quickly execute instructions, of which 76 instructions are executed in one to two clock cycles, the instruction execution speed can reach 25MIPS, Handling flash letters and pedometers is sufficient. There are 14 interrupts that can be set internally, which brings convenience to software programming.
4, low power consumption: The MCU only needs 0.36mA at 1MHz processing speed, and there are idle and shutdown working modes, which can save more mobile phone power.
5, direct drive: C8051F313 can directly drive 16 high-current 20mA high-brightness LED, no need for other current drive chips, saving space and cost.
6, AD sampling: C8051F313 with 17 analog AD input IO, its AD sampling is 10 bits, the speed is 200K, can fully meet the needs of flash and pedometer. And with a temperature sensor inside, you can test the ambient temperature of the MCU chip.
7. Communication function: MCU provides SMBus (I2C), UART, SPI communication function, so that the module can communicate reliably with the mobile phone: receive the character or image data to be displayed, and receive the pedometer control command, return the step The value of the device, etc.; you can also pass the value of the acceleration to the phone for other application development, such as mobile games, music drummers, etc.
8, flexible IO management: C8051F313 with CrossBar function, can be different function pins, according to a certain priority configuration output to the relevant IO pin; for example, 4 and 5 feet can be set to UART or I2C through software Function pin.
Its software configuration interface is as follows:
Color TFT screens are often used in portable devices. Traditionally, backlights for TFT screens have been implemented with white LEDs, while white LEDs are actually biased in color, which causes the screen to be distorted or not sufficiently bright. At the same time, as the usage time increases, the brightness of the LED will become darker, which will cause the display effect of this screen to be significantly darkened. Therefore, the following scheme can solve this problem well.
The backlight adopts R, G, B three-color LEDs, and the light emitted by the LEDs is combined into white light. The brightness and color of the light are detected by a Color Sensor, and sent to a small package MCU with AD function. The MCU is controlled by PWM output. An LED driver chip, the LED driver chip completes the control of the R, G, B tri-color LEDs, and the MCU adjusts the PWM output by detecting the color of the light emitted by the LED, thereby realizing the control of the LED color. At the same time, the MCU communicates with the main CPU through an I2C interface, and receives the control command of the main CPU for brightness adjustment.
This adjustment system is directly integrated with the TFT screen, so that the manufacturer of the screen can design reasonable control methods and other functions according to the characteristics of the screen. It is only necessary to define the I2C interface of the screen to allow the main CPU to complete the screen. control. The color and brightness of the screen can always be kept at the level set by the user. The main CPU does not have to intervene in the adjustment process of the screen throughout the process. And the main CPU does not need to support the PWM function, because these functions are integrated into the small size MCU. In the LED driver of the TFT color screen, the high-performance AMS LED Driver is generally selected, and the Color Sensor chip is Avago HDJD-S722-QR999, which is used to detect the brightness of the R, G, and B colors.
Five, color TFT screen C8051F310 programIts C8051F310 resources are as follows
This solution chooses C8051F310, which has the following advantages in color TFT screen driver:
1, small size, LQFP32, the package is very thin, does not increase the thickness of the display.
2. There is a 200K/10 bit / 17 channel ADC that can detect Color Sensor value, test temperature and control current feedback.
3, there are 5 PCA to choose from, three PWM control required to control RGB is enough, and PWM can support hardware direct output.
4, the internal FLASH can be modified online, you can save the characteristics, temperature and use time of the LED inside. It also supports the upgrade of the MCU.
5, good confidentiality, all programming circuits are fully built in, once the chip is encrypted, can not access the contents of the encrypted area through the programming interface, can reliably protect the user's IP design.
6, can work directly without an external clock.
Handheld display driver application example, as shown below:
The above mobile phone flash and TFT color screen drive solutions have been adopted by many manufacturers and design companies. The superior performance of SILabs MCUs plays an important role in the design; Shiqiang Telecom will provide more technical solutions to assist you. Work together to design and develop each product.
Bus Copper Strip Machine,Interconnection Copper Strip Equipment,Photovoltaic Copper Strip Annealing Equipment,Copper Strip Corrosiveness Laboratory Equipment
Jiangsu Lanhui Intelligent Equipment Technology Co., Ltd , https://www.lanhuisolar.com