217KB

The following document contains information on Cypress products.
Colophon
The products described in this document are designed, developed and manufactured as contemplated for general use,
including without limitation, ordinary industrial use, general office use, personal use, and household use, but are not
designed, developed and manufactured as contemplated (1) for any use that includes fatal risks or dangers that, unless
extremely high safety is secured, could have a serious effect to the public, and could lead directly to death, personal injury,
severe physical damage or other loss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, air traffic control,
mass transport control, medical life support system, missile launch control in weapon system), or (2) for any use where
chance of failure is intolerable (i.e., submersible repeater and artificial satellite). Please note that Spansion will not be liable
to you and/or any third party for any claims or damages arising in connection with above-mentioned uses of the products.
Any semiconductor devices have an inherent chance of failure. You must protect against injury, damage or loss from such
failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and
prevention of over-current levels and other abnormal operating conditions. If any products described in this document
represent goods or technologies subject to certain restrictions on export under the Foreign Exchange and Foreign Trade Law
of Japan, the US Export Administration Regulations or the applicable laws of any other country, the prior authorization by the
respective government entity will be required for export of those products.
Trademarks and Notice
The contents of this document are subject to change without notice. This document may contain information on a Spansion
product under development by Spansion. Spansion reserves the right to change or discontinue work on any product without
notice. The information in this document is provided as is without warranty or guarantee of any kind as to its accuracy,
completeness, operability, fitness for particular purpose, merchantability, non-infringement of third-party rights, or any other
warranty, express, implied, or statutory. Spansion assumes no liability for any damages of any kind arising out of the use of
the information in this document.
®
®
®
TM
Copyright © 2013 Spansion Inc. All rights reserved. Spansion , the Spansion logo, MirrorBit , MirrorBit Eclipse ,
TM
ORNAND and combinations thereof, are trademarks and registered trademarks of Spansion LLC in the United States and
other countries. Other names used are for informational purposes only and may be trademarks of their respective owners.
Fujitsu Semiconductor (Shanghai) Co., Ltd.
Application Note
MCU-AN- 500065-E-10
F²MC-8FX FAMILY
8-BIT MICROCONTROLLER
MB95310/370 SERIES
LCD LIBRARY USAGE API
APPLICATION NOTE
LCD Library Usage API V1.0
Revision History
Revision History
Date
2010-01-04
Author
Jane Li
Change of Records
V1.0, First draft
This manual contains 14 pages.
1. The products described in this manual and the specifications thereof may be changed without prior notice.
To obtain up-to-date information and/or specifications, contact your Fujitsu sales representative or Fujitsu
authorized dealer.
2. Fujitsu will not be liable for infringement of copyright, industrial property right, or other rights of a third party
caused by the use of information or drawings described in this manual.
3. The contents of this manual may not be transferred or copied without the express permission of Fujitsu.
4. The products contained in this manual are not intended for use with equipments which require extremely
high reliability such as aerospace equipments, undersea repeaters, nuclear control systems or medical
equipments for life support.
5. Some of the products described in this manual may be strategic materials (or special technology) as defined
by the Foreign Exchange and Foreign Trade Control Law. In such cases, the products or portions thereof
must not be exported without permission as defined under the law.
© 2009 Fujitsu Semiconductor (Shanghai) Co., Ltd
MCU-AN- 500065-E-10 – Page 2
LCD Library Usage API V1.0
CONTENTS
CONTENTS
REVISION HISTORY .............................................................................................................. 2 CONTENTS ............................................................................................................................ 3 1 INTRODUCTION ................................................................................................................ 4 2 LCD LIBRARY FUNCTION LIST ....................................................................................... 5 3 LCD FUNCTION DETAIL .................................................................................................. 6 3.1 Init_LCD Function ..................................................................................................... 6 3.2 LCD_Clear Function.................................................................................................. 7 3.3 LCD_LigON_NUM Function ...................................................................................... 8 4 USAGE DEMO ................................................................................................................. 10 4.1 Steps of Using MB95F310 LCD Library .................................................................. 10 5 DEBUGGING ................................................................................................................... 12 6 ADDITIONAL INFORMATION ......................................................................................... 13 7 APPENDIX ....................................................................................................................... 14 7.1 Figures .................................................................................................................... 14 7.2 Tables ..................................................................................................................... 14 MCU-AN- 500065-E-10 – Page 3
LCD Library Usage API V1.0
Chapter 1 Introduction
1 Introduction
This document introduces API for LCD library.
Fujitsu MCU MB95F310 has LCD module and it can drive LCD panel by connecting MCU
SEG to panel SEG, MCU COM to panel COM.
In following chapter we will describe the library of Fujitsu MCU MB95F310.
MCU-AN- 500065-E-10 – Page 4
LCD Library Usage API V1.0
Chapter 2 LCD Library Function List
2 LCD Library Function List
This chapter introduces all functions in LCD library in project Simulate LCD EV Board.prj
which uses MB95F310 as MCU.
Table 2 - 1 lists the LCD functions.
Table 2 - 1 LCD Functions
Function name
Description
void Init_LCD(void)
Initialize LCD module
void LCD_Clear(void)
Clear LCD panel display
void LCD_LigON_NUM(unsigned char Num, unsigned
char Dat)
Drive LCD display number or letter
MCU-AN- 500065-E-10 – Page 5
LCD Library Usage API V1.0
Chapter 3 LCD Function Detail
3 LCD Function Detail
This chapter introduces the detail of LCD functions.
3.1
Init_LCD Function
Table 3 - 1 describes Init_LCD function.
Function name
Table 3 - 1 Init_LCD Function
initial_I2C
Function prototype
void Init_LCD(void)
Behavior description
Initialize LCD and selects external voltage drive
Input parameter
None
Return value
None
Example
Select main clock, 1/4 duty, off blink function, set pin as SEG pin:
Init_LCD ();
In this function default duty is 1/4 and bias is 1/3.
MCU-AN- 500065-E-10 – Page 6
LCD Library Usage API V1.0
Chapter 3 LCD Function Detail
3.2
LCD_Clear Function
Table 3 - 2 describes LCD_Clear function.
Table 3 - 2 LCD_Clear Function
Function prototype
void LCD_Clear(void)
Behavior description
Clear LCD panel
Input parameter
None
Return value
None
Example
Turn off all display:
LCD_Clear();
MCU-AN- 500065-E-10 – Page 7
LCD Library Usage API V1.0
Chapter 3 LCD Function Detail
3.3
LCD_LigON_NUM Function
Table 3 - 3 describes LCD_LigON_NUM function.
Table 3 - 3 LCD_LigON_NUM Function
Function name
AD_Read
Function prototype
void LCD_LigON_NUM(unsigned char Num, unsigned char Dat)
Behavior description
Drive LCD to display number or letter
Input parameter1
Num, LED position of LCD panel
Input parameter2
Dat, please refer Table 3 – 4
Return value
None
Example
Light on the first LED and display number 5:
LCD_LigON_NUM(0x00,0x05);
Table 3 – 4 describes the parameter Dat.
Table 3 - 4 Parameter Dat
Dat
LED
0 6 7 8 9 10
0~0x0a, please refer to Table 3 - 5
12345
0~0x24, please refer to Table 3 - 6
Table 3 – 5 describes the value of Dat for LED 0 6 7 8 9 10.
Table 3 - 5 Parameter Dat for 8-SEG
Dat
Description
0
displayed Number “0”
1
displayed Number “1”
2
displayed Number “2”
3
displayed Number “3”
4
displayed Number “4”
5
displayed Number “5”
6
displayed Number “6”
7
displayed Number “7”
8
displayed Number “8”
9
displayed Number “9”
0x0a
Closes the LED
MCU-AN- 500065-E-10 – Page 8
LCD Library Usage API V1.0
Chapter 3 LCD Function Detail
Table 3 – 6 describes the value of Dat for LED 1 2 3 4 5.
Dat
Table 3 - 6 Parameter Dat for 16-SEG
Description
0
displayed Number “0”
1
displayed Number “1”
2
displayed Number “2”
3
displayed Number “3”
4
displayed Number “4”
5
displayed Number “5”
6
displayed Number “6”
7
displayed Number “7”
8
displayed Number “8”
9
displayed Number “9”
0x0a
displayed Number “A”
0x0b
displayed Number “B”
0x0c
displayed Number “C”
0x0d
displayed Number “D”
0x0e
displayed Number “E”
0x0f
displayed Number “F”
0x10
displayed Number “G”
0x11
displayed Number “H”
0x12
displayed Number “I”
0x13
displayed Number “J”
0x14
displayed Number “K”
0x15
displayed Number “L”
0x16
displayed Number “M”
0x17
displayed Number “N”
0x18
displayed Number “O”
0x19
displayed Number “P”
0x1a
displayed Number “Q”
0x1b
displayed Number “R”
0x1c
displayed Number “S”
0x1d
displayed Number “T”
0x1e
displayed Number “U”
0x1f
displayed Number “V”
0x20
displayed Number “W”
0x21
displayed Number “X”
0x22
displayed Number “Y”
0x23
displayed Number “Z”
0x24
Closes the LED
MCU-AN- 500065-E-10 – Page 9
LCD Library Usage API V1.0
Chapter 4 Usage Demo
4 Usage Demo
This chapter describes the steps of how to use this library and some usage attention.
4.1
Steps of Using MB95F310 LCD Library
—
First step is adding LCD library to project document, Figure 4 – 1 is a sample for
adding this library.
—
Second step is adding LCD library to project, Figure 4 – 2 is a sample for this work.
Figure 4 - 1 First Step of Using LCD Library
Figure 4 - 2 Second Step of Using LCD Library
MCU-AN- 500065-E-10 – Page 10
LCD Library Usage API V1.0
Chapter 4 Usage Demo
— Third step is using the LCD library, for detailed library please refer to Table 2 – 1.
Figure 4 – 3 is an example for library use.
Figure 4 - 3 Usage of LCD
—
Fourth step is debugging,
User needs to add debug document. Figure 4 – 4 is an example for creating serial
interface debug document.
Figure 4 - 4 Step of Setting Debug Environment
For detailed debug information please refer to Chapter 5.
MCU-AN- 500065-E-10 – Page 11
LCD Library Usage API V1.0
Chapter 5 Debugging
5 Debugging
This chapter describes how to debug the sample code lcd_library.prj on EV-Board and what
will happen when the code is running.
Attachment is the sample project lcd_library.prj.
This project is based on our EV-Board MB2146-450-E and the target MCU is MB95F310.
Figure 5 - 1 is a debugging picture.
Figure 5 - 1 Debugging Operation
Figure 5 – 2 is the result of the running program which shows “0BASIC12345”.
Figure 5 - 2 Running Result
MCU-AN- 500065-E-10 – Page 12
LCD Library Usage API V1.0
Chapter 6 Additional Information
6 Additional Information
For more information about how to use MB95310 EV-board, BGM Adaptor and SOFTUNE,
please refer to EV-Board MB2146-450-E User Manual, or visit Websites:
English version:
http://www.fujitsu.com/cn/fsp/services/mcu/mb95/application_notes.html
Simplified Chinese Version:
http://www.fujitsu.com/cn/fss/services/mcu/mb95/application_notes.html
MCU-AN- 500065-E-10 – Page 13
LCD Library Usage API V1.0
Chapter 7 Appendix
7 Appendix
7.1
Figures
Figure 4 - 1 First Step of Using LCD Library .......................................................................... 10 Figure 4 - 2 Second Step of Using LCD Library ..................................................................... 10 Figure 4 - 3 Usage of LCD ..................................................................................................... 11 Figure 4 - 4 Step of Setting Debug Environment ................................................................... 11 Figure 5 - 1 Debugging Operation ......................................................................................... 12 Figure 5 - 2 Running Result ................................................................................................... 12 7.2
Tables
Table 2 - 1 LCD Functions ....................................................................................................... 5 Table 3 - 1 Init_LCD Function .................................................................................................. 6 Table 3 - 2 LCD_Clear Function .............................................................................................. 7 Table 3 - 3 LCD_LigON_NUM Function .................................................................................. 8 Table 3 - 4 Parameter Dat ....................................................................................................... 8 Table 3 - 5 Parameter Dat for 8-SEG ...................................................................................... 8 Table 3 - 6 Parameter Dat for 16-SEG .................................................................................... 9 MCU-AN- 500065-E-10 – Page 14