Implementation of electronic photo frame based on Atmel-View

0 Preface

This article refers to the address: http://

As a core function of digital photo preservation, playback and browsing, the electronic photo frame caters to the needs of consumers. Combining liquid crystal display technology, TV technology and digital storage technology, the electronic photo frame has increasingly become the best companion for digital cameras and digital cameras for fashion personality. With the price reduction of the core devices NandFlash and LCD screens, the market demand for electronic photo frames will be further stimulated.

1 AT76C120 processor introduction

This design uses Atmel's AT76C120 architecture to build applications. This architecture adopts ARM7TDMI CPU with maximum frequency of 78MHz, supports JPG picture browsing, MP3 audio function, MPEG video function, remote control TV function, USB2.0 interface and various flash memory card support, etc. It is a high performance digital image and video. Processing system.

2 Atmel-View framework analysis

Atmel-View is Atmel's custom application for the AT76C120 development board. It provides a low-level implementation of all features and is a mature and scalable Application solution. It forms the entire software system together with the Command Shell and the underlying driver Lib.

Command Shell is mainly used for dynamic non-compilation function debugging. It can directly perform command operations through the serial port during program running, which greatly reduces the debugging time of the development process, and is a convenient and effective auxiliary development method.

The API of each driver module is mainly implemented by the underlying driver Lib. The function implementation of Atmel-View is mainly based on the application and organization of APIs in Lib. Table 1 lists the relevant modules in Atmel-View and their functions.

Table 1 Atmel-View related function modules

Module

Features

DCF module

Provide file operation related function

Font module

As a font, load as a header file

Infrared module

Provides related functions for infrared remote control control

Main module

System initialization work and program main entrance

Menu module

Menu system implementation

Mp3 module

Provides implementation of Mp3 playback

Ppt module

Provide the implementation of folder and file list functions

Setting module

The settings for each function parameter are recorded and read in this module.

Strings module

Record string values ​​corresponding to various functions and other functions of menu items

View module

Provides image browsing, photo slideshows, and video playback

Bmp-icons module

Stores all icon image converted objects in the form of a header file

Board_sh120ek module

Card board initialization driver related

3 Function Overview and Process

The Atmel-View-based electronic photo frame application mainly provides the following functions:

JPEG picture browsing, JPEG picture slide show, JPEG thumbnail mode browsing, read and write support for various cards, MP4 video show, MP3 background music, MP3 player, file and folder browsing.

Based on the above functions, it needs to be organized and integrated on the UI, and implemented for new requirements. Figure 2 shows the UI function flow diagram with Bluetooth module support, and analyzes the UI process based on Atmel-View. Flowchart 1 outlines the framework and basic content of the entire menu system from the start of the electronic photo frame to the various functional nodes. First, initialize the Bluetooth module and set the default file transfer location on the card. Then, search for the Jpeg file in the memory card, start the slide show, and if there is a Bluetooth transmission request during the slide show, the Atmel-View process is suspended in the picture switching gap (to prevent resource reentry conflict), and the transmission ends until the user exits the play. After that, the menu module will be officially accessed from the Main module. The boot menu contains three submenus: the card selection menu, the system settings menu, and the Bluetooth settings menu. The card selection menu item includes all the memory card items supported by the card board, and the selected memory card item is selected to enter the lower level function menu. The function menu item provides four functions: picture, Mp3, video, and file browsing. The system settings menu mainly performs global configuration settings: language setting, slide effect setting, background music (on/off) setting. The Bluetooth settings menu is used to set and enable the Bluetooth module. The "on/off" item determines whether Bluetooth transmission is enabled; the "set user name" item uses the soft keyboard to set the Bluetooth name of the device.

Flowchart 2 specifically describes the flow of the picture browsing function module. If there is a Jpeg picture in the memory card, first enter Thumbnail mode, and one page displays thumbnails of multiple pictures. The Bluetooth transmission request is accepted and processed accordingly. Then perform a full-screen image browsing and manually switch the image. In the Thumbnail mode and picture browsing process, the setting menu can be adjusted, such as slide effect, file operation, file sorting, etc., setting the slide cut interval and starting the slide show are also in this menu item.

Flowchart 3 briefly depicts how the menu interacts with the Bluetooth module during the menu (the menus are all called via MenuMode). Before the button response operation flow, first communicate with the Bluetooth module process to monitor the Bluetooth transmission request. If there is a Bluetooth transmission request, it indicates that the Bluetooth transmission is in progress and waits for the Bluetooth file transmission (the Bluetooth transmission is affected by the infrared remote control module, so the transmission process turns off the infrared reception without the button response, and the transmission is completed to enable the infrared reception).


Figure 3 UI function flow with Bluetooth module

4 Nucleus operating system embedding

Nucleus Plus is a new generation embedded operating system introduced by ATI, a US source code operating system. It is a preemptive real-time multitasking operating system kernel. 95% of the code is written in ANSI C, which is very easy to port to various processor families. Widely used in communications, defense, industrial control, aerospace/aerospace, railway, network, POS, automation control, smart home appliances and other fields.

Nucleus Plus is usually implemented as a C library file. The real-time Nucleus Plus app is linked to the Nucleus Plus library. The target file can be downloaded to the target or placed in ROM. In a typical target environment, assuming that all services are applied, the binary image file of the Nucleus Plus instruction set requires approximately 20K bytes of memory.

Overall, Nucleus Plus has greatly improved the development of real-time applications. These can translate into lower development investments and shorter development cycles. Since the Nucleus Plus support application has been moved to the new processor family, the application development investment has been guaranteed.

4.1 Implementation of multitasking system

Atmel-View is essentially a single-tasking embedded custom system, and the use of existing features is based primarily on serial operation. However, with the expansion of the application's in-depth functional modules, the single-tasking system has gradually become inadequate.

The operation of the Bluetooth module requires the support of the multi-tasking system. When the Bluetooth service is turned on, it is necessary to continuously monitor the wireless request and perform transmission processing after receiving the Bluetooth transmission request. It is obviously unreasonable to use the single-task mode to support the monitoring of the Bluetooth service, so that Atmel-View will stop running its functions.

This design uses Nucleus Plus to provide system-level multitasking scheduling that loads the Atmel-View module and the Bluetooth module as equivalent tasks. The choice of Nucleus Plus as a task scheduling system lies in its ease of use, low cost, and embedded features.

4.2 Initialization

The INT_Initialize subroutine is the first to run in the Nucleus Plus system. For most target environments, the hardware reset vector must be included in the INT_Initialize address. INT_Initialize is responsible for all initialization related to the target hardware. Initialization associated with the target hardware typically includes setting up different kinds of processor control registers, interrupt vector tables, global C data elements, some Nucleus Plus variables, and system stack pointers. When INT_Initialize is complete, control is transferred to the advanced Nucleus Plus initialization subroutine INC_Initialize. Note that control does not return INT_Initialize.

INC_Initialize calls the initialization subroutine of each Nucleus Plus component. After all Nucleus Plus initialization is complete, INC_Initialize calls the user-provided initialization subroutine Application_Initialize.

The Application_Initialize subroutine is responsible for defining the initialization application environment. Initializing application tasks, mailboxes, queues, pipes, semaphores, event sets, memory pools, and other Nucleus Plus objects are defined in the subroutine. After Application_Initialize returns, INC_Initialize begins to initialize the task schedule.

4.3 Task

A task is a semi-independent block of purpose. Most modern real-time applications require multitasking. In addition, the importance levels of these tasks often change. Managing the operation of these competing, real-time tasks is the primary purpose of Nucleus Plus. Each task has five states: run, ready, suspend, abort, and complete.

4.4 Task Communication and Synchronization

Nucleus Plus provides mailboxes, queues, and pipes for communication purposes. Mailboxes, queues, and pipes are independent public devices. The connection between tasks and other system devices is determined by the application. The main difference between these communication devices is the type of data communication. In the interprocess communication mode of Atmel-View module and Bluetooth module, here choose to use queue and semaphore to achieve.

4.4.1 Application of Queue

In the application of the menu system, support for the Bluetooth module needs to be added. In addition to constructing the Bluetooth settings menu, in the state where the Bluetooth process is turned on and running in real time, the inter-process communication in the queue mode is required to obtain the transmission request status of the Bluetooth process. When the transfer request occurs, the menu system will respond in a timely manner, prompting the user that the Bluetooth transmission process is currently in progress and the program is blocked. When the transfer is over, the same message is sent through the queue message to continue the program logic of the menu system.

The Bluetooth process performs monitoring of the Bluetooth transmission service. Once an external transmission request occurs, the Bluetooth process will notify the Atmel-View task by calling the BTUI_UpdateResponse function and start data reception and writing. This function is mainly used as a Bluetooth task end to respond to Bluetooth transmission related events, and then communicate and coordinate with Atmel-View in a timely and effective manner. When the Bluetooth task-side event responds, the NU_Send_To_Queue function is called to pass the information to the queue Task_bt_queue.

After the initial interface is drawn in MenuMode, the queue Task_bt_queue shared with the Bluetooth module is continuously monitored. After the function NU_Receive_From_Queue receives the Bluetooth transmission request, a pop-up message box informs the user that the Bluetooth transmission is in progress, and turns off the infrared that affects the Bluetooth transmission. Receive and set the Bluetooth transmission status to TRUE to avoid the button processing module. In this way, the program will continuously listen to the new information of Task_bt_queue at any time during the while transmission during the Bluetooth transmission. Until the transmission completion information from the Bluetooth module is received, indicating that the Bluetooth transmission operation is completed, the display area is updated, the infrared reception is turned on, and the Bluetooth transmission status is set to FALSE for the key processing module to be re-executed.

4.4.2 Application of Semaphore

Nucleus Plus provides semaphores, event groups and signals to solve signal synchronization problems. Both semaphores and event sets are independent, public devices. The connection of tasks to other system devices is determined by the application. In the process of synchronization between the Atmel-View module and the Bluetooth module, here choose to use semaphores to achieve.

In the UI application of Atmel-View, loading media files to access the memory card is inevitable, and the transmission of the Bluetooth module will also write the received file to the memory card. When the Bluetooth process and the Atmel-View process access the memory card device at the same time, the resource conflict procedure will occur due to the unsupported resource re-entry. Therefore, Nucleus' Semaphore is used here to solve the resource competition problem.

After the NU_SEMAPHORE variable is declared, this variable will be shared between the Atmel-View process and the Bluetooth process. When accessing conflicting resources, the NU_Obtain_Semaphore and NU_Release_Semaphore functions are called to wrap the resource access module, thus ensuring that after the Semaphore is obtained, the Semaphore is released. Previously, resource access was safe because another process that was accessing this resource would be temporarily suspended automatically due to the lack of a unique Semaphore.

5 summary outlook

With the maturity of the electronic photo frame market, the continuous development of technology, the increasing number of functional modules, and the more complex the system architecture. This makes the usability, ease of use, and friendliness of software products more important. Whether the UI design is reasonable or not will directly affect these factors.

The UI design of many electronic photo frames popular in the market has the problems of poor structure, poor reusability and poor scalability. The scheme of this thesis is mainly based on Atmel-View, which completes a hierarchical, structured and easy-to-expand menu system with good results. And embedded in the Nucleus Plus operating system, the process communication and synchronization between the menu system and the Bluetooth module is realized, and the Bluetooth module is effectively supported.

Microsoft Surface Charger

Microsoft Surface charger have 4 types. For Surface Pro 1/2/3/4.

Surface Pro 1/2: 12V 3.6A

Surface Pro 3: 12V 2.58A

Surface Pro 4: 15V 1.6A


Microsoft charger has different connector with other Laptop Adapter. Its connector is magnetic tip.

Definitely Charge Faster, excellent power supply for Microsoft Surface Pro. Just drop it in your bag or even pocket and get going – no need to carry anything else, as power is always within easy reach.

Microsoft Surface Charger,Microsoft Surface RT Charger,Microsoft Surface Tablet Charger,Charger For Microsoft Surface

Shenzhen Waweis Technology Co., Ltd. , https://www.szwaweischarger.com

This entry was posted in on