利用液晶模拟器与MAX-IDE和IAR嵌入式工作台开发环境-

abstract: this application note describes how to use the lcd simulator on the max-ide and iar embedded workbench, and explains how to create the lcd memory map and lcd display panel. this article assumes that the reader knows the maxq20 core, and is aware of the max-ide and iar embedded workbench. by the end of this application note the user will understand the workings of the lcd simulator in both development environments.
introductionthe lcd simulator was developed on a windows® platform with a gui that simulates the digital behavior, but not the analog behavior, of the lcd controller. readers can review application notes 3905, max-ide simulator user's guide for the maxq microcontrollers, and 3378, getting started with the iar compiler and the maxq2000 evaluation kit for information on working with max-ide and iar.
overviewthe lcd simulator simulates the digital properties of the lcd controller, including: static, 1/2 mux, 1/3 mux, and 1/4 mux display modes; enabling/disabling lcd operation; and updating the lcd display with the display memory patterns. the lcd simulator ignores analog property changes, including: lcd drive voltage changes, display contrast adjustment, frame frequency effect.
the lcd simulator needs two inputs: lcd segment configuration for static, 1/2, 1/3 and 1/4 display modes lcd pin configuration for static, 1/2, 1/3 and 1/4 display memory development environment settings for the lcd simulatorthe lcd simulator can be used on two environments, the max-ide and the iar embedded workbench. max-ide settings
some maxq® devices are configured and installed during the max-ide installation. you can get the list of those devices from the device→options menu. among these devices, the maxq2000 and maxq3210 have an lcd controller peripheral. follow the steps below to create the project for simulation. a. create a project. this procedure is explained in application note 3905 (see above) on the max-ide simulator.
b. add a file that tests the functionality of lcd controller. the file code is shown in table 1.
c. select device→maxq2000→ok.
d. under the device menu, click on lcd simulator and the lcd gui will be displayed, as seen in figure 1. we are now ready to explore the lcd simulator. iar ide settings
some maxq devices' ddf (device description file), sfr, and rom files are installed under the $toolkit_dir$\config directory during iar embedded workbench installation. follow the steps below to create the project used for simulation. a. create a project. this procedure is explained in the application note 3378 (see above) on the iar compiler.
b. add a file that tests the functionality of the lcd controller. the code is shown in table 2.
c. open project→options and go to the c spy debugger panel.
d. select device simulator from the options shown.
e. select the ddf file of the device to be simulated. in this example the file is maxq200x.ddf under $toolkit_dir$\config.
f. if the program is assembly, uncheck the run to main option and check xlink→include→ignore c startup in the library.
g. select the utility rom routine (.hex) of the device to be simulated, i.e., maxq200x.hex
h. press ok.
i. press debug to debug the program.
j. peripherals simulated can be seen under the view menu option.
k. select the lcd peripheral and the lcd gui will be displayed as in figure 1. we are now ready to explore the lcd simulator. the lcd gui snapshot, along with the assembly files to be included with max-ide and iar, are listed below:
figure 1. lcd simulator gui.
table 1. max-ide_lcd2muxmode.asm simulates the lcd working in 1/2 mux mode in the max-ide environment
the above source code is available for download.
table 2. iar_lcd2muxmode.asm simulates the lcd working in 1/2 mux mode in the iar embedded workbench
the above source code is available for download.
working with the lcd simulatoras mentioned above, the lcd simulator depends on two xml input files: segment configuration file pin configuration file segment configuration file
this file defines the type of the lcd display panel as either 7-segment or alphanumeric. the user can design the lcd display type by editing the xml file. the file details each segment as line or dot or any other shape (all multiples of a line) for static, 1/2 mux, 1/3 mux, and 1/4 mux. without this input file, the lcd simulator will not update the gui. pin configuration file
each maxq controller with a lcd peripheral comes in different pin configuration that assigns a different pin number for static, 1/2 mux, 1/3 mux, and 1/4 mux. also some segment pins are multiplexed with two different functions: a. i/o function
b. external interrupt, with i/o having the low priority and external interrupt having the higher priority. the pin-configuration file supplies the controller pin-package details, sfr display memory-map details, and the multiplex functionality with an i/o and interrupt event for each display mode and for each package type. without these inputs the lcd simulator cannot correctly simulate the data in the lcddx register that may, or may not be sourcing the segment data on the pin. on selecting the maxq2000 device, these two files will be loaded automatically into the max-ide environment. alternatively, you can supply these files in the maxq200x.sfr file in iar under [lcdconfigfiles] option as follows:
[lcdconfigfiles]
configfile = config\lcd_config.xml
pinconfigfile = config\lcd_pin_config.xml
the user can override these files using the file→open option of the gui.
lcd registers and their simulation lcd register adjust (lcra): selects one of the display modes: static, 1/2 mux, 1/3 mux, and 1/4 mux. changes to this register will be reflected on the status bar of the lcd gui. lcd configuration register (lcfg): each bit setting and the gui status is described below: bit settings gui changes
dpe = 1 display: on
dpe = 0 display: off
opm = 1 opm: normal
opm = 0 opm: suspend
lcddx registers: lcddx registers can be updated when dpe = 0/1. contents of lcddx registers will be updated on the gui when dpe = 1 and opm = 1. red will represent lcds that are sourced; black represents lcds that are present, but currently not sourced. lcds not sourced can result from several factors: a. the pcfx bit of the lcfg registers is not set, making the seg pins work as i/o pins.
b. the lcd seg pin that is multiplexed with an interrupt functionality is enabled.
c. the lcddx register contains 0 in that bit position.
d. moving the pc mouse on the display updates the com and seg. gui changes for the example programmaxq2000 comes with three different pinout packages: 56, 68, and 100 pins. the test program (see tables 1 and 2 above) tests the functionality of the maxq2000 68-pin package. select the maxq2000 68-pin configuration from the part number list, and execute the test program. note the gui changes. move lcra, #08ffh : mode: 1/2 mux move lcfg.0, #0h : display: off move lcfg.1, #01h : opm: normal move lcfg.4, #01h : pcf0: configures i/o pins as segment pins move lcfg.5, #01h : pcf1: configures i/o pins as segment pins move lcfg.6, #01h : pcf2: configures i/o pins as segment pins move lcfg.7, #01h : pcf3: configures i/o pins as segment pins move eie0.7, #01h : enables interrupt function of int7, comment : /uncomment to see the mux behavior of seg pins the display pattern is moved from the lcdd0 register to the lcdd8 register. a 1 represents the segments to be sourced, and a 0 represents segments that will not be sourced. move lcfg.0, #1h : display: on with eie0.7 disabled (comment move eie0.7, #01h) and after executing the move lcfg.0, #1 statement, the gui display will look like figure 3.
figure 2. maxq2000 64-pin lcd panel.
after executing move lcd0, #0ffh move lcd1, #0ffh the gui will look like:
figure 3. maxq2000 64-pin lcd panel display changes with dpe = 1.
the difference, you will notice, is that com0:seg2, com0:seg3, com0:seg6, and com0:seg7 change color from black to red which indicates that the lcds are sourced.
with eie0.7 enabled (seg31 multiplexed with int7), the gui will look like:
figure 4. maxq2000 64-pin lcd panel with seg multiplexed with int.
compare figure 2 with figure 4. com0:seg31 and com1:seg31 are not sourced as lcd segments.
note: the user can design/modify the lcd display panel and maxq pinout input of the lcd simulator. the xml input file can be opened in any editor and xml tag names used are self-explanatory.
conclusionthe maxq device simulator can be used to develop and debug the lcd simulator for maxq10 and maxq20 microcontrollers. the application developed is then ready to run on the hardware. maxq is a registered trademark of maxim integrated products, inc.

智能电子门锁的指纹识别真的可以复制吗
基于便携式设备投射式电容触摸屏的电磁干扰设计
APS食品行业生产计划排程解决方案
新能源电池技术之化成问题的解决方案
太阳能供电的无线传感系统的设计
利用液晶模拟器与MAX-IDE和IAR嵌入式工作台开发环境-
卷积神经网络(CNN)的工作原理 神经网络的训练过程
iphone12的屏幕维修价格让人碎不起
酷炫黑科技!能让Macbook Air一秒钟变成触屏的
“一带一路”战略,电线电缆新机遇
华宇电子亮相2022世界集成电路大会
华为mate9和p9的区别,16nm工艺处理器给力升级但mate9曲屏版或跳票
C语言零基础项目:生命游戏!详细思路+源码分享
基于PLC的机器人伺服运动控制系统设计详解
用MDaemon搭建邮件服务器-设置篇
松下进一步增强加码动力电池业务的决心
谷歌发布第三季度财报,总营收461.73亿美元
华为 P20在上海发布 还有全球首款全面屏笔记本
怎么应对刘海屏机型的海报设计
相控阵雷达性能的基石:宽禁带半导体