146KB

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- 500040-E-10
F²MC-8FX FAMILY
8-BIT MICROCONTROLLER
MB95200 SERIES
LED API
APPLICATION NOTE
LED API V1.0
Revision History
Revision History
Date
2009-4-8
Author
Jane Li
Change of Records
V1.0, First draft
This manual contains 11 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- 500040-E-10 – Page 2
LED API V1.0
CONTENTS
CONTENTS
REVISION HISTORY .............................................................................................................. 2 CONTENTS ............................................................................................................................ 3 1 INTRODUCTION ................................................................................................................ 4 2 FUNCTION LIST IN LED LIBRARY .................................................................................. 5 3 DETAILS OF LED FUNCTION .......................................................................................... 6 3.1 Led_Funct Function .................................................................................................. 6 3.2 Array ......................................................................................................................... 7 4 HARDWARE ...................................................................................................................... 9 5 ADDITIONAL INFORMATION ......................................................................................... 10 6 APPENDIX ....................................................................................................................... 11 6.1 Figure ...................................................................................................................... 11 6.2 Tables ..................................................................................................................... 11 MCU-AN- 500040-E-10 – Page 3
LED API V1.0
Chapter 1 Introduction
1 Introduction
This document introduces API for LED driven by MB95200.
I/O port is used to drive LED and send different values to display different numbers.
MCU-AN- 500040-E-10 – Page 4
LED API V1.0
Chapter 2 Function List in LED Library
2 Function List in LED Library
This chapter introduces the functions in LED library.
Table 2-1 lists function in the LED library.
Table 2-1: Led Function
Function name
Description
void Led_Funct(unsigned char Show_Num)
Show the number rang is 0~9
MCU-AN- 500040-E-10 – Page 5
LED API V1.0
Chapter 3 Details of LED Function
3 Details of LED Function
This chapter introduces the details of LED function.
3.1
Led_Funct Function
Table 3-1 describes the Led_Funct function.
Table 3-1: Led_Funct Function
Function name
Led_Funct
Function prototype
void Led_Funct(unsigned char Show_Num)
Function description
Display number from 0~9 on LED, use I/O port0
Input parameter1
Show_Num, set the number which need to display
Return value
None
Example
Display number 5:
Led_Funct(0x05);
This function is used to display the number which needed to show.
Table 3-2 describes parameter values of Show_Num.
Show_Num
Table 3-2: Show_Num Definition
Description
0x00
Display number 0
0x01
Display number 1
0x02
Display number 2
0x03
Display number 3
0x04
Display number 4
0x05
Display number 5
0x06
Display number 6
0x07
Display number 7
0x08
Display number 8
0x09
Display number 9
MCU-AN- 500040-E-10 – Page 6
LED API V1.0
Chapter 3 Details of LED Function
3.2
Array
There is one array in function Led_Funct(). It lists all values which will drive port0.
Table 3-3 describes the array Data_Lib[10].
Array name
Table 3-3: Array Definition
Data_Lib[10]
Array prototype
unsigned char Data_Lib[10]
Array description
List all value which will be use in drive function
Value
Hex value which drive the port to let the led show interrelated number
Example
For general positive polarity LED:
unsigned char Data_Lib[10]=
{0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
For general positive polarity LED, setting the pin to low will light the led; for general negative
polarity LED, setting the pin to high will light the led.
Table 3-4 describes hex values in general positive polarity LED.
Array Parameter
Table 3-4: Positive Polarity Definition
Description
General Positive LED
0xc0
Display number 0
0xf9
Display number 1
0xa4
Display number 2
0xb0
Display number 3
0x99
Display number 4
0x92
Display number 5
0x82
Display number 6
0xf8
Display number 7
0x80
Display number 8
0x90
Display number 9
MCU-AN- 500040-E-10 – Page 7
LED API V1.0
Chapter 3 Details of LED Function
Table 3-5 describes hex values in general negative polarity LED.
Array Parameter
Table 3-5: Negative Polarity Definition
Description
General Negative LED
0x3f
Display number 0
0x06
Display number 1
0x5b
Display number 2
0x4f
Display number 3
0x66
Display number 4
0x6d
Display number 5
0x7d
Display number 6
0x07
Display number 7
0x7f
Display number 8
0x6f
Display number 9
MCU-AN- 500040-E-10 – Page 8
LED API V1.0
Chapter 4 Hardware
4 Hardware
This chapter describes the hardware.
Figure 4-1 describes the instance port0 driving one positive polarity LED.
Figure 4-1: Hardware Definition
MCU-AN- 500040-E-10 – Page 9
LED API V1.0
Chapter 5 Additional Information
5 Additional Information
For more information on FUJITSU MB95200 products, please visit following 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- 500040-E-10 – Page 10
LED API V1.0
Chapter 6 Appendix
6 Appendix
6.1
Figure
Figure 4-1 Hardware Definition ................................................................................................ 9 6.2
Tables
Table 2-1 Led Function ............................................................................................................ 5
Table 3-1 Led_Funct Function ................................................................................................. 6 Table 3-4 Show_Num Definition .............................................................................................. 6 Table 3-1 Array Definition ........................................................................................................ 7 Table 3-2 Positive Polarity Definition ....................................................................................... 7 Table 3-3 Negative Polarity Definition ...................................................................................... 8 MCU-AN- 500040-E-10 – Page 11