Home

f²mc-8fx family

image

Contents

1. Page 11 FUjITSU Infrared Remote Function API V1 1 Chapter 7 Usage Demo Usage Demo This chapter describes something we must pay attention to when we use 7 1 Hardware Design For hardware design the following figure may be referred Figure 7 1 Remote Hardware Design MCU AN 500066 E 11 Page 12 Infrared Remote Function API V1 1 FUJITSU Chapter 7 Usage Demo 7 2 Steps for Software Design gt For infrared remote software design initialization is the first step which opens the interrupt sets the interval time and trigger condition Following setting is referred Void initial Remot void TMCRO 0x00 TOOCRO 0x4b TOOCR1 0xa0 Figure 7 2 Initialization Design gt Detecting remote code is the important step Each pulse is one bit of code Each time enter into the interrupt one bit is detected If the remote code is 16bits after sixteen enter into interrupt the key code is generated gt The last step is key value judge Different keys have different codes so user can judge the key value by code which is generated in step two MCU AN 500066 E 11 Page 13 FUJITSU Infrared Remote Function API V1 1 Chapter 7 Usage Demo 7 3 Steps for Adding Remote Library When use this project please refer to following steps gt First step is to add library to document Figure 7 3 describes this step File Edt View Favorites Help E 22 J l Search Folders
2. KeyUA Remote detect by Figure 7 5 Library Use Third Step gt Fourth step is to add interrupt function to vector c Figure 7 6 describes this step Prototypes Add your oun prototypes here Each vector definition needs is proto type Either do it here or include a header file containing interrupt void DefaultIRQHandler void interrupt void void Figure 7 1 Library Use Fourth Step Fifth step is to add remote detect function to main c Figure 7 7 describes this step 8 void 9 18 unsigned char oy M 11 InitIrqLeuels 12 131 15 Initial Inter 154 16 while 1 17 4 18 KeyUn 19 y 28 Figure 7 6 Library Use Fifth Step MCU AN 500066 E 11 Page 15 FUJITSU Infrared Remote Function API V1 1 Chapter 7 Usage Demo gt The sixth step is debugging set a environment before debugging Figure 7 8 describes this step H abs T source Files fy Include Files key judge readme ea Dependencies defin h mb30800 h CM qm a L Add Setup Er Property Figure 7 7 Library Use Sixth Step For more condition please refer to Chapter 8 MCU AN 500066 E 11 Page 16 co Infrared Remote Function API V1 1 FUJITSU Chapter 8 Debug 8 Debug This chapter describes how to debug the sample code
3. law 2009 Fujitsu Semiconductor Shanghai Co Ltd MCU AN 500066 E 11 Page2 Infrared Remote Function API V1 1 CONTENTS FUJITSU CONTENTS REVISION HISTOR Y f 2 CONTENTS ea EEE 3 1 INTRODUC ga aini 4 Eie ciis pe 5 3 DESCRIPTION OF INFRARED REMOTE THEORY oom 6 4 MB95F310 INFRARED REMOTE REGISTER oo man 7 5 INFRARED REMOTE LIBRARY FUNCTION LIST woo oom 8 6 INFRARED REMOTE FUNCTION DETAIL om mm mna 9 SN MEE Remo AO T Em 9 62 UNCION TIT I T T Tnm 10 BS Remol delecti miae e RR 11 7 USAGE DEMO e 12 Pik Hardware ea Tm 12 7 2 Steps for Software Design oooo W oo Woo W man 13 7 3 Steps for Adding Remote Library Woo oom Waah 14 o DEBU 17 9 ADDITIONAL 19 10 APP END Pk 20 MCU AN 500066 E 11 Page 3 FUjITSU Infrared Remote Function API V1 1 Chapter 1 Introduction 1 Introduction This document introduces API for infrared remote function Infrared remote function is generally used in TV audio system and air conditioner In following chapters we describe theory and library of infrared remote Chapter three is the theory of infrared remote and c
4. CU AN 500066 E 11 Page 19 FUjITSU Infrared Remote Function API V1 1 Chapter 10 Appendix 10 Appendix Table 4 1 All Register 7 Table 5 1 Remote Capture FunctionSs oooW WWW oo mma 8 Table 6 1 initial Remot Function oooocooooooooooooooWoo o Woo Wen 9 Table 6 2 Describes Interrupt Function mana 10 Table 6 3 Read 2G FUNCOM as none Ha Dan Ae Nana 11 wie gt Remote 0 EE na 6 Fige 25 Encode Wava 6 Figure 4 1 Register Work Condition Wa 7 Figure 7 1 Remote Hardware Design 12 Figure 7 2 Initialization RERUM 13 Figure 7 3 Library Use First Step Woo Woo naa 14 Figure 7 4 Library Use Second Step W oom WWW 14 FIGUre 755 Library Use Third Step ea na 15 Figure 7 6 Library Use Fifth 15 Figure 7 7 Library Use Sixth SIOD uisu ex XV BAN 16 Figure 8 1 Key COde o W W WK nana 17 Figure 8 2 Debugging Description oooo o oo Woo mn 18 MCU AN 500066 E 11 Page 20
5. Fujitsu Semiconductor Shanghai Co Ltd Application Note F2MC 8FX FAMILY 8 BIT MICROCONTROLLER MB95310 370 SERIES INFRARED REMOTE FUNCTION API APPLICATION NOTE C2 FUJITSU co FUJITSU Infrared Remote Function API V1 1 Revision History Revision History Change of Records 2009 11 06 Jane Li V1 0 First draft 2011 03 17 V1 1 modified Chinese remark This manual contains 20 pages 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 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 he 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 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
6. e key value 142 278 return the key value 153 iet bs PES 145 define note every time to judge the pressed remote 445 itdef ine 281 author jane li 2008 10 15 Kk ee i e i e aee 146 define 283 unsigned char Remote detectivoid 147 define DN 284 148 285 unsigned char Key data 149 286 if RemotePress Flag 0x01 156 define 151 define 288 ICSO1 ICEO 0 disable ir interrupt Seles Key mute 6x26 Key UolumefiD 8x21 Key UolumeDE 8x22 Key basstreble 8x23 Key balance 8x25 Key add 8x25 Key reduce 8x26 Key Function 8x38 Key tape 8x31 Key cd 8x32 Key tuner 8x33 Key Power 0x34 Key display 8x35 Key enter 8x36 KeyLong Play 8x KeyLong Reset 8x 2 E Watch2 Ld key Valu H 36 codebuff2 H FS codebuff3 H 4D 157 KeyLong enter 158 Figure 8 2 Debugging Description MCU AN 500066 E 11 Page 18 Infrared Remote Function API V1 1 FUJITSU Chapter 9 Additional Information 9 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 en fss services mcu mb95 application notes html M
7. hapter four is function library of infrared remote In function library we should set up three functions to control infrared remote Initials remote interrupt remote interrupt function to receive infrared code and key judge function to distinguish which key pressed MCU AN 500066 E 11 Page 4 Infrared Remote Function API V1 1 FUJITSU Chapter 2 Background 2 Background This chapter introduces background of infrared remote Infrared remote is widely used in TV VCD DVD air condition and so on because it is easy to be used easy to be bought and it is very cheap Infrared remote has occurred about twenty five years It encodes the pressed key and transfers this key value to 0 and 1 and then sends out because each key has the only code so user can judge the key value according to the code So user does not need to use the key board to decode the key value in which the complicated circuit and the I O port are left out MCU AN 500066 E 11 Page 5 FUJITSU Infrared Remote Function API V1 1 Chapter 3 Description of Infrared Remote Theory 3 Description of Infrared Remote Theory This chapter describes theory of infrared remote Infrared remote has many types which are decided by remote chip In following description uPD6121G will be described Figure 3 1 describes the configuration of frame which is the remote code First frame Lead code Address code Address code Data code Inverse data code i i F
8. hese registers work condition in detail Capture value i i TOODRITO1DR Br Le OF i Falling edge of capture Rising edge of capture Rising edge of Falling edge of capture External input 4 teenie fm Counter clear mode i Counter free run mode Figure 4 1 Register Work Condition MCU AN 500066 E 11 Page 7 FUjITSU Infrared Remote Function API V1 1 Chapter 5 Infrared Remote Library Function List 5 Infrared Remote Library Function List This chapter introduces all functions in infrared remote library in project Simulate remote prj which MCU are MB95F310 Table 5 1 lists the infrared remote functions Table 5 1 Remote Capture Functions void initial Remot void Initializes remote capture register jinterrupt void inputcaptureO void Interrupt to receive remote code unsigned char Remote detect void According remote code to judge which key pressed MCU AN 500066 E 11 Page 8 Infrared Remote Function API V1 1 FUJITSU Chapter 6 Infrared Remote Function Detail 6 Infrared Remote Function Detail This chapter introduces the detail of infrared remote functions 6 1 Initial Remot Function Table 6 1 describes initial Remot function Table 6 1 initial Remot Function Function prototype Void initial Remot void Behavior description Initializes remote capture condition Input parameter Return value None Example The library function sets clock use internal clock coun
9. igure 3 1 Remote Code Figure 3 2 describes the encode 0 and 1 1 125ms 1 Figure 3 2 Encode Wave For different remote the code and the configuration is different Normally the remote is generating high level except code status it will generate low and high level MCU AN 500066 E 11 Page 6 Infrared Remote Function API V1 1 Chapter 4 MB95F310 Infrared Remote Register FUJITSU 4 MB95F310 Infrared Remote Register This chapter describes MB95F 310 infrared remote register In MB95F310 series MCU remote function is realized by 8 16 BIT composite timer input capture module Following Table 4 1 describes registers in composite timer input capture Table 4 1 All Register List TimerO TOOCRO Low 8bits of stats control registerO TO1CRO High 8bits of stats control registerO TOOCR1 Low 8bits of stats control register1 TO1CHR1 High 8bits of stats control register1 TOODR Low 8bits of data register TO1DR High 8bits of data register TimerO Timer mode control register Timer1 T10CRO Low 8bits of stats control registerO T11CRO High 8bits of stats control registerO Timer1 T10CR1 Low 8bits of stats control register1 T11CR1 High 8bits of stats control register Timer T10DR Low 8bits of data register T11DR High 8bits of data register TMCR1 Timer mode control register For detailed register please refer to MB95F310 Hardware Chapter 18 Figure 4 1 describes t
10. on EV board and what will happen when the code is running There is a simple project remote prj for debugging This project is based on our EV board MB2146 450 E and the target MCU is MB95F310 When debugging the hardware linking please refer to Figure 7 1 Press one key and the wave will be detected by oscilloscope as Figure 8 1 Figure 8 1 Key Code The wide wave is binary 1 and the short wave is binary O From this picture we can judge the remote code is 1111 0101 0100 1101 in binary MCU AN 500066 E 11 Page 17 FUJITSU Infrared Remote Function API V1 1 Chapter 8 Debug Run project the key value will be read by Remote_detect function And key value will be read out by global variable key Valu In this sample the ENTER key is pressed Please refer to Figure 8 2 for detailed result 2 key judgevl 1 c 132 PENA PA fi Pong press key 267 TCDT 0 0000 268 TCCSL SCLR 1 133 define 269 TCCSL STOP 0 132 p 270 ICSO1 ICPO 0 CLEAR INTERRUPT 135 define 90 4 271 ICS01 ICEO 1 enable ir interrupt 136 define re key Valu Remote detecti 137 tdeFine 2 138 define 274 139 tdeFine 275 ana nana 146 276 unsigned char Remote detectivoid 141 itdeFine 277 function judge the code and switch the code to th
11. ter interval is 0 645 and falling edge trigger counter initial Remot If user wants to change capture condition please refer to register TOOCRO TOOCR1 and TMCRO MCU AN 500066 E 11 Page 9 FUjITSU Infrared Remote Function API V1 1 Chapter 6 Infrared Remote Function Detail 6 2 Interrupt Function Table 6 2 describes q interrupt function Table 6 2 Interrupt Function Description Function prototype jinterrupt void inputcaptureO void Behavior description When captured a falling edge the interrupt is occurred and the pulse is received and the width of the pulse will be countered Input parameter None Return value None Different remote the configuration is different so the code is different maybe it is 16 bit code maybe it is 32 bit code user can review the code by oscilloscope In this remote prj the remote code is set to match 16 bit remote code MCU AN 500066 E 11 Page 10 Infrared Remote Function API V1 1 FUJITSU Chapter 6 Infrared Remote Function Detail 6 3 Remote detect Function Table 6 3 describes Remote detect function Table 6 3 Read I2C Function Function name AD Read Function prototype unsigned char Remote detect void Behavior description Judges the code and then decides which key has been pressed according to the code Input parameter Example variable Remote detect The key value can be decided by user s remote encode MCU AN 500066 E 11
12. uk Address 2 softune Gsm MCU NEW 1mb35318 LAN PROJECT REMOTE i Ge File and Folder Tasks Other Places _standby h STANDBY INC H Fila Ind File gt KB 3 KE mal eroe c 2 Em i KB j Desktop Documents i aga START ASM ig My Computer ae ASM File 47 KB My Network Places Details renvobe c C File Date Modified 20002211 17 47 Size 20 8 KE Figure 7 3 Library Use First Step Second step is to add function to project Figure 7 4 describes this step Project Debug Setup Window Help Add Member m Er E E S PET Workspace REMOTE 2 4 RENOTE abs EENOTI I Source Files File name remete Files of type Source File c asm Cancel Automatic d Check data Insertion Folder REMOTE Include Files M hoador Fil Build Delete next facto Figure 7 4 Library Use Second Step MCU AN 500066 E 11 Page 14 Infrared Remote Function API V1 1 FUJITSU Chapter 7 Usage Demo Third step is to add initial function to main c Figure 7 5 describes this step void main uoid i4 J unsigned char InitIrqLeuels MERE i while 1 il

Download Pdf Manuals

image

Related Search

Related Contents

Manual - Garmin  

Copyright © All rights reserved.
Failed to retrieve file