Home

78K0R - Say it! - Renesas Electronics

image

Contents

1. Si Unmount AVDD 100 y2 LIH 306 32 7680K A0 2 c2 SRSERSTRASSSSESSSSYSSLLRE 9 swt 10pF T0pF UP P70 ee 7 4 P73 RIGHT PUSH _ PZ 2 5 COMMON anns EFT 228 oeu DOWN 2 ee SKRHABEO10 885882288895 ARLEQR AG Ca Ske AAN 285252458 FFA 8 Rud Boe foal AGND Rae ast a E39 Eegi AVDD MRI sa 5 P80 SML512BC4T 9 8 1 1 75 ANII5 LEDI 10 7 n gt 142 5 20 5 120 8 PIS7 ANI15 75 sMsizncer AA 11 A 14 Pr PCLBUZOINTP AvREFo S 12 3 4 swiy o E P120 INTPO EXLVI PIANO H ANO 2 SMLS12BC4T LED 15 5 15 ot P47 INTP2 P110 ANOO 75 ANOO 2 283 SMLS12BC4T RR 15 gt 1 5 P46 INTP1 T105 TOOS AVREF1 i_7 69 1 LED4 16 1 5 i P45 SO01 P10 EX24 SCKO0 68 1 T69 P84 SMLS12BC4T T8 1 91 P44 Sl01 P11 EXe5 SIO0 RXDO 67 1 ACD LEDS P43 SCK01 P12 EX26 SO00 TXD0 Tur 1 JT 10 5 Pa2 TIO4 TOD4 P13 EX27 TXD3 88 gt 2 P13 3 SMLSi28C4T NS sss 3 P41 shteti 40 0
2. M H 43 11 Sample programs isiin a ME 45 11 1 Generalilntroductlori a I cutee ceanuetacutecencescouetsdacreanters 45 11 2 78 Sayit VoiceDemo Obj sample program J u u u u 46 11 2 1 How to run the sample 48 112 2 Sound Play F nctlion u u 5 1 eal regie ya 48 11 2 8 Illuminance Sensor 0 020024 enne 51 11 2 4 Beep Play Function iiit re eene tenis 53 11 3 78 Sayit VoiceDemo sample u u u u 55 11 4 78 Sayit DownloadDemo sample u u u 58 11 4 1 Procedure to change sound data by downloading via CVADPCM tool 59 11 5 78 Sayit VoiceDemo source code description eese 60 11 5 1 Example of Creating Sound Play Application sese 61 TS InitiallZe nni eres dtd ie det ee ime 61 11 5 1 2 Waitifor user M puts u dti ein eee eL boe eT eet nro ta EE e tn 62 11 5 1 3 Preprocessor sound data er Le be e e 63 14 5 1 4 Process to play sound x rab e D Re E en abre sm 64 1
3. 34 Search Location Specification 1 Windows XP I 35 Search Location Specification 2 Windows XP 35 Search Location Specification 3 Windows XP enne 36 Windows XP Logo Testing Windows 36 USB Driver Installation Completion Windows XP sse 37 Device Managot oie tete e Rte cr EE uer te ere re dette De cavet Pe 38 AR Embedded Workbench uuu itr ee et nem e gente 39 AR project WOrKSpaGe u etre te e ue ER tuin 40 IAR d bugger Options icti teat ee RS 40 IAR Linker intentum teuer e 41 T 78 hardware setup ed e vere ede a ee RR 41 IAR project download ere de 42 5 2 i Ee oe eine c DRE Ed dep duode 43 TK 78 enter Hardware Setup a a a na n DS 44 TK 78 Hardware Setup menu I 44 T7 8 flashierasing u au aint ete tie Sun eis ee ie ea te ea us a ee 44 USB interface cable Mini B type n n n sss 92 78KOR Say it schematics 1 9 93 78KOR Say it schematics 2 3 1 1 1 00 0000 00060
4. User s Manual 78KOR Say it Demonstration Kit for the 78 16 bit microcontroller family Document No U19237EE1VOUMOO Date Published June 2008 NEC Electronics Europe GmbH 78KOR Say it NEC The information in this document is current as of June 2008 The information is subject to change without notice For actual design in refer to the latest publications of NEC Electronics data sheets or data books etc for the most up to date specifications of NEC Electronics products Not all products and or types are available in every country Please check with an NEC Electronics sales representative for availability and additional information No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics NEC Electronics assumes no responsibility for any errors that may appear in this document NEC Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products No license express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC Electronics or others Descriptions of circuits software and other related information in this document are provided for illustrative purposes in semic
5. ca Roses uae exa 83 TETA START PWM ease ide te nest oat fe ge Et eae a epe n Ta DET ERE 83 4527222 is iiti E tt tom tit e nti etas 83 AT 4 93 S ARM DACA 0 cis tice acts Speers em Ei UE TURPE 83 TEZA STOP mm 83 1 45 START 625 eiie eet ae eae Fu aa AEREN VEEN A NE aye 84 1756 STOBP32625 0 icto iibi ice 84 Tt 7 7 thee 84 147 8 PWM LEDE TIE 84 11 27 91 PEAY Re Ga beeen chads 85 lt t D re 85 ectetur 85 11 72 e 85 117 13 PEAYA LED X doeet 86 T1714 EBED X Jte a Sanu edet nre iota beats 86 11 7 15 ced titre eie Came 86 11 7 16 JOYSTK icti retten te ler ebat fa rode hapa tutam feni cetera lel 86 11 8 Variable Constant Specifications u u uuu u u 87 TERT 6 l k ddan dann m t noie ede ice aki 87 11 8 2 data p D uu http iic 87 COU
6. User s Manual U19237EE1VOUMOO 83 78KOR Say it NEC 11 7 5 START 625 Macro START 625 Description Enable 62 5us cycle interrupt Source File 78KOR Voice c Input Value Return Value Remarks 11 7 6 STOP 625 Macro STOP 625 Description Disable 62 5ps cycle interrupt Source File 78KOR Voice c Input Value Return Value Remarks 11 7 7 DA LED x Macro DA LED x Description Turn ON OFF D A output mode LED Source File common h Input Value LED ON Light ON LED OFF Light OFF Return Value Remarks 11 7 8 PWM LED x Macro PWM LED x Description Turn ON OFF PWM output mode LED Source File common h Input Value LED ON Light ON LED OFF Light OFF Return Value Remarks User s Manual U19237EE1VOUMOO 78KOR Say it 11 7 9 PLAY LED x Macro PLAY LED x Description Turn ON OFF PLAY LED Source File common h Input Value LED ON LED OFF Light ON Light OFF Return Value Remarks 11 7 10 PLAY1 LED x Macro PLAY1 LED x Description Turn ON OFF play number 1 LED Source File common h Input Value LED ON LED OFF Light ON Light OFF Return Value Remarks 11 7 11 PLAY2 LED Macro PLAY2 LED x Description Turn ON OFF play number 2 LED Source File
7. Declaration static U8 PlayMode Source File 78KOR Voice c Use To determine output mode PWM D A with interrupt process Remarks 11 8 7 uilntCounter1 Variable Constant uilntCounter1 Declaration U32 uilntCounter1 Source File 78KOR Voice c Use General purpose 1msec timer Remarks 11 8 8 uilntCounter2 Variable Constant uilntCounter2 Declaration U32 uilntCounter2 Source File 78KOR Voice c Use General purpose 1msec timer Remarks User s Manual U19237EE1VOUMOO 88 78KOR Say it NEC 11 8 9 usKeyStsCount 5 Variable Constant usKeyStsCount 5 Declaration U16 usKeyStsCount 5 Source File 78KOR Voice c Use Joystick status counter Increment when ON with 1msec cycle handler usKeyStsCount 0 UP Key continuous ON time in msec usKeyStsCount 1 PUSH Key continuous ON time in msec usKeyStsCount 2 LEFT Key continuous ON time in msec usKeyStsCount 3 RIGHT Key continuous ON time in msec usKeyStsCount 4 DOWN Key continuous ON time in msec Remarks 11 8 10 ucKeyStsLocked 5 Variable Constant ucKeyStsLocked 5 Declaration U8 ucKeyStsLocked 5 Source File 78KOR Voice c Use Joystick lock flag Set when continuous ON time exceeds certain value with 1msec cycle handler ucKeyStsLocked 0 KEY SHORT ON UP Key ON locked KEY SHORT OFF UP Key OFF ucKeyStsLocked 1 K
8. vDecode 24k play mode amp play_volume sound size _adpcmDataAdr if data type AUDIO 16K vDecode 16k play mode amp play_volume sound size _adpcmDataAdr playEnvflg 0 uiIntCounterl 0 D Process if it has play permission 2 Get sound data information such as sound data number data size data address etc 3 Call decompression process depending of compression data information Reset play permission flag and set playEndflg 0 to prevent from play repeatedly User s Manual U19237EE1VOUMOO 78KOR Say it NEC 11 5 7 Example of A D Conversion This is the sample program for A D conversion process which is used in the illuminance sensor application To deal with fluctuation of sensor data it samples the data several times Function light sensor control Descr U32 uiADconvert void Inputs Outputs Return 10 bit A D Conversion Data U32 uiADconvert void U16 3 U32 addata U32 caladdata 0 ADCE 1 for 1 0 i 10000 i NOP5 wait ADCS 1 ADIF 0 while ADIF for i20 i 64 i caladdata 0 for j 0 j 64 j ADIF 0 while ADIF caladdata caladdata ADCR addata addata caladdata gt gt 6 addata addata gt gt 6 6 ADCS 0 ADCE 0 return addata D Start the A D conversion It needs to wait 1 after setting the ADCE 2 Skip the first con
9. Input Value Return Value Remarks User s Manual U19237EE1VOUMOO 76 78KOR Say it Function 11 6 5 void vAdpcmPrmlnitialize void vAdpcmPrmlnitialize Syntax void vAdpcmPrmlnitialize void Description Initialize sound data information table Input Value Return Value Remarks Function 11 6 6 void Standby U8 p mode U8 p num U8 p volume vKeyMon Standby Syntax void vKeyMon Standby U8 p mode U8 p num U8 p volume Description Monitor key input before the start of sound play Process depending on key input Input Value U8 p mode Output mode information PWM mode 0 D A mode 1 U8 p num Play number information Play number 1 4 U8 p volume Volume information Volume 0 8 Return Value Remarks Function The function does not end until key is pushed 11 6 7 void vKeyMon Play U8 p volume vKeyMon Play Syntax void vKeyMon Play U8 p volume Description Monitor key input while sound is playing Process depending on key input Input Value U8 p volume Volume information Volume 0 8 Return Value Remarks Function 11 6 8 void vVolumeLED 08 vVolumeLED Syntax void vVolumeLED U8 Description Output volume LED Input Value U8 Volume infromation Volume 0 8 R
10. 78KOR Say it NEC 11 3 78 Sayit VoiceDemo Src sample program This program has the same functionality like the 78KOR Sayit VoiceDemo sample described in chapter 11 2 By using this sample you are able to change the sound data and replace it by your own preferred sound data For this purpose the project is split into the main application project 78 Sayit VoiceDemo and four sound projects ADPCM_Sound1 to ADPCM_Sound4 containing the sound data The corresponding workspace and the partitioning of the projects can be seen in the figure below 78KOR_Sayit_VoiceDemo Debug E Bis Files SEN 78KOR_Sayit VoiceDemo Ha B 78K0R Sayit VoiceDemo Debug Library 2 adpcmsp r26 8K R Voice c Output E 78 Sayit VoiceDemo d26 E 78 Sayit VoiceDemo map DPCM Soundl Debug adpem1 c C3 Output E common h Speech 01 Output Ha BJADPCM Sound Debug Ha B adpem2 c C3 Output E common h L i Speech 02 c Output Ha BJADPCM Sound3 Debug E adpcm3 c C3 Output I F common h L i Speech 03 c Output BJADPCM Sound4 Debug B adpcm4 c C3 Output I E common h L i Speech 04 c Output zie Ha FT Overview 78KOR_Sayit VoiceDemo amp DPCM Soundl ADPCM_Sound2 ADPCM_Sound3 ADPCM_Sound4 The main project doesn t contain any sound data The reference to the sound data itself is done by po
11. Interrupt Cycle for PWM and D A Update output data P DataA DataA DataB 19 2nd Time 1st Time H Output Sound Data A User s Manual U19237EE1VOUMOO 66 78KOR Say it NEC 11 5 5 Decode 32Kbps Compressed Data This is the sample function to decompress 32Kbps compressed sound data Depending on the compressed data type it loads the compressed data decompress and store the playable data to the playing buffer area void vDecode 32k 08 p mode 08 p volume 032 size U8 far adr U32 loop 08 adpcmPos 0 U8 adpcmBuf U8 adpcmCode 016 usPCMdata output_count 0 if p mode MODE START PWM else START DA A START_625 vSilence 500 p_mode while loop lt size BORK KK KK X X K K K K KOK K K KOK K kkk K KOK k IK f key check BORK KK KK X X KK K KOK K K KOK K vKeyMon Play p volume Playing BORK KK KK X X KK K KOK K K KOK K k kkk I IKK I K f if ucPlaySts STATUS_PLAY if output_count lt 2 if adpcmPos 0 adpcmBuf adr adpcmCode adpcmBuf amp 0 0 adpcmPos 1 else adpcmCode adpcmBuf gt gt 4 adpcmPos 0 usPCMdata adpcm 132 dec adpcmCode Adpcm Work Enable one of PWM or D A output and allow only interrupt of 62 5us cycle time 2 Loop dep
12. Ox O0 Ox OO Ox OO Ux00 0x00 0x00 0x00 OxOF OXOF OXOF 0x 7E 0x 55 0x55 0x44 0x45 0x44 0x34 0x33 0x33 Ux23 0x12 0x01 0x00 0xEE OxEF OxCD OxCC OXDC OXDC OxCC OXCD OxCC xDB 0xDC OxED OxEF OxFF 0x00 0x11 0x02 0x01 0x00 0x10 0x00 0xEF 0xDD OxDE OxDE 0xDE 0xEE 0xFF 0x00 0x00 0x11 0x21 0x11 0x21 0x12 0x21 0x10 0x10 0x00 0xFO OxEE 0xEE 0xED 0xEE UxED OxEC OxEC OxED OXED Ox FD OxED OxEE OxEE OxFO 0xFE 0x1E 0x11 0x11 0x21 0x11 0 11 0 01 0 21 0 10 0 12 0 21 0 10 0 21 0 10 0 01 0 01 0 2 0 0 2 0 00 0 20 OxEF 0x11 0x01 0x0F 0x02 0x00 0x01 0xEF 0x10 0xEE 0x0D 0xD0 0xED 0xED 0xDE 0xEE 0xFD OxED xEE OxEE OXDF Ox FE 0x0E OxFE 0xFE OxEF 0xF0 0xEF 0x10 0x00 0x20 0xDF 0 21 0 0 0 1 0 2 0 0 02 0 1 0 01 0 01 0 01 0 0 0 0 01 0 10 0 00 0 11 fo 2 The definition of the sound format and sound size is done by the constants adpcm1 format and adpcm1 size They have to be set according to the sound data file in this example the file Speech 01 generated by the CvADPCM converter tool The sound data file itself is included and placed to the ADPCM1 section Analog to this the format and size information is placed to the ADPCM1 FORMAT and ADPCM1 SIZE sections The three sections are referenced and accessed within the main sample project via pointers The creation of the sound data is done by simply r
13. User s Manual 019237 1 00 00 37 78KOR Say it NEC 8 4 Confirmation of USB Driver Installation After installing the USB driver check that the driver has been installed normally according to the procedure below When using the 78KOR Say it board in combination with IAR C SPY debugger the NEC Electronics Starter Kit Virtual UART should be present like in the figure below By choosing the Device Manager within the Windows Properties Hardware tab check that the driver is installed normally Figure 24 Device Manager 2 Device Manager File Action View t HB e Ea ETC LABOR 7 Computer See Disk drives 2 Display adapters DVD CD ROM drives Floppy disk controllers E HB Floppy disk drives IDE ATA ATAPI controllers 91 Keyboards 77 Mice and other pointing devices 2 Monitors 8 Network adapters Ports COM amp LPT 7 Communications Port 1 7 Communications Pork COM2 7 ECP Printer Port LPT1 BSA Electronics Starter Kit Virtual UART CC 88 Processors SCSI and RAID controllers Sound video and game controllers lt Storage volumes System devices Universal Serial Bus controllers Check that NEC Electronics Starter Kit Virtual UART COM is present User s Manual U19237EE1VOUMOO 38 78KOR Say it NEC 9 IAR sample session When everything is set up correctly the IAR Embedded Workben
14. common h Input Value LED ON LED OFF Light ON Light OFF Return Value Remarks 11 7 12 LED x Macro PLAY3 LED x Description Turn ON OFF play number 8 LED Source File common h Input Value LED ON LED OFF Light ON Light OFF Return Value Remarks User s Manual U19237EE1VOUMOO 85 78KOR Say it 11 7 13 PLAYA LED x Macro PLAYA LED x NEC Description Turn ON OFF play number 4 LED Source File Common h Input Value LED_ON Light ON LED_OFF Light OFF Return Value Remarks 11 7 14 VLM LED x Macro VLM LED x Description Turn ON OFF volume LED Source File common h Input Value ucAmpLebelTable 9 table value Return Value Remarks 11 7 15 DIPSW Macro DIPSW Description Get DIPSW status Source File common h Input Value Return Value 0 7 ON 1 to show DIPSW8 7 6 3 bit Remarks 11 7 16 JOYSTK Macro JOYSTK Description Get joystick status Source File common h Input Value Return Value Status of joystick with 5 bit ON 1 BIT 0 UP Key BIT 1 PUSH Key BIT 2 LEFT Key BIT 3 RIGHT Key BIT 4 DOWN Key Remarks User s Manual U19237EE1VOUMOO 86 78KOR Say it 11 8 Variable Constant Specifications The specificati
15. 0 9 Oot 3 Tes CN1J8 103 1 QjTPUS INTPO P120 INTPO EX VI P13 TxD6 7 RESETU 5 26 RxD6 RESET P14 RxD6 FLMDOU eL mp0 pis SX CSTCE16MOV53 RO 7 24 P16 USBVDD Y3 P122 X2 EXCLK OCD0B P16 TOH1 FLMD0U 8 23 T150 P121 X1 OCDOA P17 TIS0 TOSO T 1112 9 22 MR3 8 REGC P33 TI51 TO51 47 USBVDD 10 21 USBVDD Nae Evis ol TPUS TPU7 BLM41PG750S 11 20 USB1 1 1 gt 12 is 21 19 Shield 71 er USBREGC P31 INTP2 OCD1A veus H SANE 13 usBP H Shield 2 R37 2 g 14 17 R38 2 33 USBM P60 x TPU8 15 spout e USBVDD USBVDD IDLNG x uPD78F0730 5 d R39 886 us 10K C36 C37 AE e OduF lt 0 1uF 2 3885 1 4 2 1 R40 15K 0 tuF SN74LVC1G125DCK USBVDD T al USBVDD L vcca vcca hes eu e 010 RxD6 n RxD6Buf 1 USBVDD SN74LVC2T45DCU VDD R42 CN1J8 108 MR36 5 UBA SS ad D TxD6 zd 1 6 nl TxD6Buf 2 SN74LVC2G07DCK sws R43 10K INTPO 1 S16 al 2 15 TxD6Buf 3 14 1 lt P40 VDD USBVDD 4 13 5 12 noy 6 11 22 PM 8 1 1 P75 7 10 VCCB VCCA 1 P76 3 5 4 1 P77 DIR GND CHS 08B 1 P gt Shield S Shield 1150 SN74LVC2T45DCU P TN VDD E VDD T uga MR3 1 g CN1J8 103 8
16. 1 00 00 59 78KOR Say it 11 5 78 Sayit VoiceDemo source code description You can develop an application by using the sound data decompression library for 2 3 4 bit compression sound data Following chart shows the process of the application Initialize CPU built in functions Load the sound data and store in memory Case of using multiple sound dala Case of using single sound data Builtin ROM Sound data info Sound data Initialize CPU The sound data is with n i bit compression start at i m address and nnn byte Load sound data info Built in RAM Initialize compression z Initialize decompression librery Library residentarea Load sound data Play based on sound data info 16 24 32 decode Wait until output time Interruption Process cycle D APWM Output With this example it stores the sound data information such as compression info sound data address data size etc from the built in ROM to RAM in advance When it is time to play sounds it calls the library initialize API to start the process It loads and calls decompression API the sound data based on the preloaded sound data information The output code from the decompression is outputted several times depending of the data size by PWM or D A User s Manual U19237EE1VOUMOO 60 78KOR Say it NEC 11 5 1 Example of Creating Sound Play Application The 78KOR Sayit VoiceDemo
17. 3 16 CeBIT Suay aass 21 T1 T100 t SIEpadsu I uerit ieri eterne eei reed reis 22 4 On sGhlp debugging eee sechs Ge 24 41 OCD via TK 78KOR On Board debug function J J nennen nnn 24 4 2 OCD via QB MINI2 emulator J 25 5 78KOR KG3 memory map eee ir e eed ecd 26 6 78KO0H Say it installation and 27 6 1 Getting started coL XE 27 GD ROM eontenls erit cena m Pate renda Se ee ka 27 f Hardware Installallon riconosce ai See etica ease iit 28 User s Manual U19237EE1VOUMOO 78KOR Say it NEC 8 Software inStallati nu assi NS ea 28 8 1 Systems Embedded Workbench for 78K installation 28 8 2 Sample program installation u 28 8 3 USB Driver Installation kae n DUE deer 29 8 3 1 Installation on Windows 2000 29 8 3 2 Installation on Windows XP uuu u u nennen 34 8 4 Confirmation of USB Driver Installation l u J 38 9 sample o ge eee ete 39 JUI dris c 9
18. ADPCM SP 32Kbps ADPCM SP 24Kbps b7 DT1 DT5 074 DT3 ADPCM SP 16Kbps bO b7 bO L L I l DT4 DT3 DT2 DT1 DT8 DT7 DT6 DT5 DT12 DT11 DT10 DT9 User s Manual U19237EE1V0UM00 65 78KOR Say it NEC In case of 32Kbps compression 1 sound data is represented by 4 bits This means that 3 byte of memory can included 6 sound data packages In case of 24Kbps compression 1 sound data is represented by 3 bits If you just use 1 byte it causes a fraction This fraction should be treated as connected 3 bit with the last bits of following byte This means that you need 3 byte of memory to include 8 sound data packages In case of 16Kbps compression 1 data is data is represented by 2 bits This means that 3 byte to memory can carry 12 sound data packages As it mentioned previously the compression decompression library processes the decompression to DTn Therefore the application needs to gain the compression bit information of 8 bit sound data 11 5 4 Output Cycle and Interruption This application targets to the sampling cycle of 8KHz This means that it plays sound data once in 125us It depends on speaker play band and hearing sense of people but it means the sound in 8KHz Based on this the application outputs the same 16KHz 62 5us data for 2 times Following chart describes the cycle of outputs and interrupts
19. All standard debug functions are available in the On Board debugging mode like FLASH programming downloading code execution single stepping breakpoints memory manipulation etc Additionally 78KOR Say it supports the QB MINI2 On Chip debug emulator in order to use On Chip debug function of the 78KOR KG3 device The system configuration for On Chip debugging is shown in figure below OCD via On Board debug function 8 S o OCD via QB MINI2 On chip debug emulator Figure 7 On Chip debugging 4 1 OCD via TK 78KOR On Board debug function To operate the 78KOR Say it board within the On Board debug mode configure switch SW5 bits1 5 following om o 2 Table 12 via 78 On Board debug function individual selectable by user User s Manual U19237EE1VOUMOO 24 78KOR Say it NEC 4 2 OCD via QB MINI2 emulator To operate the 78KOR Say it board together with the QB MINI2 On Chip debug emulator configure switch SW5 bits1 5 as following OFF OFF OFF OFF ON OFF ON Table 13 OCD via QB MINI2 emulator c1 IOO IN individual selectable by user User s Manual U19237EE1V0UM00 25 78KOR Say it 5 78KOR KG3 memory map The memory layout of 78KOR KG3 device is shown in the figure below FFFFFH Special function register SFR 256 byt
20. Directive on compliance with the EMC protection requirements this equipment has no autonomous function Consequently this equipment is not marked by the CE symbol EEDT ST 005 10 CAUTION This equipment should be handled like a CMOS semiconductor device The user must take all precautions to avoid build up of static electricity while working with this equipment All test and measurement tool including the workbench must be grounded The user operator must be grounded using the wrist strap The connectors and or device pins should not be touched with bare hands EEDT ST 004 10 For customers in the European Union only Redemption of Waste Electrical and Electronic Equipment WEEE in accordance with legal regulations applicable in the European Union only This equipment including all accessories is not intended for household use After use the equipment cannot be disposed of as household waste NEC Electronics Europe GmbH offers to take back the equipment All you need to do is register at http www eu necel com weee User s Manual U19237EE1VOUMOO 78KOR Say it Regional Information Some information contained in this document may vary from country to country Before using any NEC product in your application please contact the NEC office in your country to obtain a list of authorized representatives and distributors They will verify Device availability Ordering information Product release schedule Av
21. This file contains the definition of the sound format the sound size and the raw sound data The sound data itself is generated by the CvADPCM converter tool The figure below shows for instance the definition for the sound data 1 User s Manual U19237EE1V0UMOO 56 78KOR Say it NEC include common h definition of sound format please specify the format according to the file generated by the CvADPCM converter tool ADPCM 32kbps gt AUDIO 32K ADPCM 24kbps gt AUDIO 24K ADPCM 16kbps gt AUDIO 16K location ADPCM1 FORMAT object attribute root const unsigned char adpcul format AUDIO 32K definition of sound size please specify the size generated by the CvADPCM converter tool i e Size 0x00001B59 pragma location ADPCM1 SIZE object attribute root const unsigned int size 0x00001B59 cording to the file definition of sound data please specify the fiNe containing the sound data generated by the CvADPCM converter tool i e speech 01 c Speech_01 pragma location ADPCMl pragma object attribute include Speech 01 Lr Encoder ADPCM SP Type ADPCM 32kbps fol SampleCountA 0 000036 1 Size 0 00001859 const unsigned char adpcm32kl 7001 Ox00 0x00 0x00 OxOD 0x00 0x00 0x00 Ox O0 OxOD 0x00 Ox O0 OxOO Ox 00
22. product documentation Host interface USB interface that enables communication based on USB Ver1 1 or later 1 3 Package contents Please verify that you have received all parts listed in the package contents list attached to the 78KOR Say it package If any part is missing or seems to be damaged please contact the dealer from whom you received your 78KOR Say it Note X Updates of the IAR Embedded Workbench for 78K documentation and or utilities for 78KOR Say it if available may be downloaded from the NEC WEB page s at http www eu necel com updates 1 4 Trademarks IAR Embedded Workbench visualSTATE IAR MakeApp and C SPY are registered trademarks of IAR Systems AB Microsoft and Windows are registered trademarks of Microsoft Corporation Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated All other product names are trademarks or registered trademarks of their respective owners User s Manual U19237EE1VOUMOO 12 78KOR Say it NEC 2 78KOR Say it system configuration The 78KOR Say it system configuration is given in the diagram below Figure 1 78KOR Say it system configuration 2 1 78KOR Say it 78KOR Say it is a demonstration kit for the 78KOR KG3 16 bit microcontroller of the 78KOR family The demonstration board is connected to the host system via USB interface cable The host system may be used for On Chip debugging by using the IAR C SPY debug
23. A D Conversion Value LED Output l It got dark _ Conversion Value lt 0063 H Conversion Value lt 00A5 H 4 Lights Conversion Value lt 00 7 H Conversion Value lt 0200 H 8 Lights Light gt To simple demonstrate the functionality of the sample spread you hand over the illuminance sensor to change the light radiation After the A D threshold value stays for 1 5 seconds the corresponding speech data is played The speech data is played again not until the illuminance value gets back to the center value area photo IC illuminance sensor Q1 A QN in jund Select n User s Manual U19237EE1V0UM00 51 78KOR Say it NEC The flow of the sensor application example is given below vAD main usADconvert TAB Conversion Output LED Depending on Conversion Level Output Sound When Condition Meets Read illuminance sensor data using the A D converter of the 78KOR KG3 microcontroller 2 Output LED volume 9 levels depending on A D in value bit information Play sounds depending on the condition Relationships between the A D conversion value and LED output are shown below User s Manual U19237EE1VOUMOO 52 78KOR Say it NEC 11 2 4 Beep Play Function This simple demo outputs alternately a high pitched silent and low pitched beep sound by driving the loudspeaker To run this function please set switch SW5 to the follow
24. a need of an active USB connection 1 VDD 5V 2 GND Table 5 External power connector JP2 Note Be sure to unplug the USB connection before applying external power supply to input JP2 and Open jumper JP1 3 9 Photo IC illuminance sensor Q1 Q1 is the photo IC illuminance sensor It is connected to the A D converter input P157 ANI15 of the 78KOR KG3 microcontroller The output voltage of the sensor rises in case of the light radiation increases and is falls in case of the light radiation decreases For details on how to configure the A D converter of the 78KOR KG3 microcontroller accordingly please refer to the user s manual of the device User s Manual U19237EE1VOUMOO 18 78KOR Say it 3 10 LED1 16 general purpose LEDs LED1 16 are general purpose LEDs A low level signal at the corresponding I O port pin of the 78KOR KG3 microcontroller switches the LED on h as ut D A PWH Plax 1 LED1 P80 EX0 LED2 P81 EX1 LED3 P82 EX2 Volume LED4 P83 EX3 LED5 P84 EX4 LED6 P85 EX5 LED7 P86 EX6 LED8 P87 EX7 D A LED9 P50 EX8 PWM LED10 P51 EX9 Play LED11 P52 EX10 1 LED12 P53 EX11 2 LED13 P54 EX12 3 LED14 P55 EX13 4 LED15 P56 EX14 LED16 P57 EX15 Table 6 General purpose LEDs LED1 16 3 11 LED17 power LED LED17 is the power LED of the 78KOR Say it board It indicates if power is applied to the 78KOR Say it bo
25. common h intrinsics h I 8 io78f1 166 a0 h ms OK an sasa i L io78f1166 a0 In case of any question please do not hesitate to contac Lm Cj Output Technical Product Support NEC Electronics Europe GmbH Arcadiastrasse 10 D 40472 Duesseldorf Germany 7BKOR_Sayit_VoiceS ample Log Wed Apr 23 10 09 48 2008 5 Processor Descriptor for 8K R V4 50B Wed Apr 23 10 09 48 2008 C SPY MINICUBE and TK 78 Emulator Driver for 78K0R V4 50A Kickstart Wed Apr 23 10 09 48 2008 Emulator has to be configured before downloading a new application Press OK to enter Emulator Hardware Setup Wed Apr 23 10 10 07 2008 Download complete _ Wed Apr 23 10 10 07 2008 Loaded debugee J td_v1 SWStarterkits 78KOR Say it Work SamplePrograms 78KOR_Sayit_VoiceSample_Obj Debug Exe 5 78KOR_Sayit VoiceSample d26 SN vacat Ane 99 102 0 00 Tis nc _ Build Debug Log Ready 391 Col 9 2 Figure 30 IAR project download User s Manual 019237 1 00 00 78KOR Say it NEC After the download was completed all debug features of IAR C SPY debugger are available i e Single Stepping Step Over In Out Go Execution Breakpoints Register Memory view etc To get more details on the debugger configuration and capabilities please refer to the 78K IAR Embedded Workbench IDE User Guide of the IAR installation IAR Embedded Wo
26. enne nnne nennen enn nennen nns 94 78KOR Say it schematics 3 3 n n nennen nennen nennen 95 User s Manual U19237EE1VOUMOO 78KOR Say it NEC List of Tables Table 1 On Board debug mode setting switch SW5 eene 16 Table 2 Stand alone mode setting switch SW5 sse neret ens 17 Table 3 General purpose switches switch SW5 eene nnns 17 Table 4 Power supply selector JP1 uu Spa nennen nennen enne enses 18 Table 5 External power connector 2 18 Table 6 General purpose LEDs 1 16 19 Table 7 External speaker jack CN2 20 Table 8 PG FP4 QB MINI2 connector 1 n ananas 20 Table 9 Configuration of SW5 bits1 5 when using PG FP4 or QB MINI2 20 Table 10 Pin Configuration of Connector 06 1 21 Table 11 Test pads T 1 100 caer evene c ct eec e t e nen ee Con 23 Table 12 OCD via TK 78KOR On Board debug flfunclion enne 24 Table 13 OCD via QB MINI2 emulator 2 4 10001 entente nennen NEERA EAE AAEE 25 Table 14 78KOR Say it CD ROM directory
27. if data type AUDIO 24K sound size voice_adpcm play_num 1 datacount 3 8 else if data_type AUDIO_16K Sound size voice adpcm play num 1 datacount 4 else sound_size 0 5 adpcmDataAdr voice adpcom play num 1 address D Get compression bit info 2 Calculate data size if compression bit is 4 bit 3 Calculate data size if compression bit is 3 bit 4 Calculate data size if compression bit is 2 bit 5 Get the start address of compressed sound data User s Manual U19237EE1VOUMOO 78KOR Say it NEC 11 5 1 4 Process to play sound After all sound data information are loaded and initialized the corresponding play function is called dependent on the compression OK KOR R KOK OK K R OK f Play k k KOK K k k K KOK K KO KOK K KOR KOK KOR OR KOK f vVolumeControl play volume adpcm init Adpcm Work PLAY LED LED ON ucPlaySts STATUS PLAY if data type AUDIO 32K vDecode 32k play mode amp play_volume sound size _adpcmDataAdr if data type AUDIO 24K vDecode 24k play mode amp play volume sound size _adpcmDataAdr if data type AUDIO 16K vDecode 16k play mode amp play_volume sound size _adpcmDataAdr BRR RR KK k k KOK OK k K K I K KOK KOK KOR I I KOR end of play RR RR K k I KK A k k I I KOK KOR I I I OR INT 1MSEC DISABLE PLAY LED LE
28. msec vBeep Syntax void vBeep U8 p mode 08 tone U32 msec Description Output beep Input Value U8 p mode Output mode PWM mode 0 D A mode 1 U8 tone Output sound tone high pitched 1 low pitched 0 U32 msec output time in ms Valid range 1 10000 10 seconds Return Value Remarks Function 11 6 22 U32 uiADconvert void uiADconvert Syntax U32 usADconvert void Description Process 10 bit A D conversion Input Value Return Value Conversion result Remarks User s Manual U19237EE1VOUMOO 82 78KOR Say it 11 7 Macro Specifications The specifications of macros bundled application program are explained in this section 11 7 1 START PWM Macro START PWM Description Start PWM Source File 78KOR Voice c Input Value Return Value Remarks 11 7 0 STOP PWM Macro STOP PWMI Description Stop PWM Source File 78KOR Voice c Input Value Return Value Remarks 11 7 3 START DA A Macro START DA A Description Start D A output volume Source File 78KOR Voice c Input Value Return Value Remarks 11 7 4 STOP DA A Macro STOP DA Description Stop D A output volume Source File 78KOR Voice c Input Value Return Value Remarks
29. permission with playEnvflg 2 1 to output process gt 7 228 indicates light In the same way it contains the statement playEndFlg_High 0 it is still light to prevent outputting the sound successively When it meets the condition it sends the play sound number with play num 2 and play permission with playEnvflg 1 to output process If other than above clear the cycle interrupt counter When the Illuminance level is close to intermediate level initialize those flags to be able to check light dark User s Manual U19237EE1VOUMOO 73 78KOR Say it NEC if playEnvflg 1 of KK KKK ke kk KK KK I I He ko ke ke ex x Prepare KK KKK A KK KK KK IK I x data type audio_adpcm play_num 1 datatype if data type AUDIO 32K sound size audio_adpcm play_num 1 datacount 2 else if data type AUDIO 24K sound size audio adpcm play num 1 datacount 3 8 else if data type AUDIO 16K sound_size audio_adpcm play_num 1 datacount 4 else sound_size 0 _adpcmDataAdr audio_adpcm play_num 1 address KKK KK 3k SK KK KK I I He HH He ke ex x Play Af KKK ke AK KK KI I He koe e ex x f vVolumeControl play_volume adpcm init Adpcm Work ucPlaySts STATUS PLAY PlayMode play mode if data type AUDIO 32K vDecode 32k play mode amp play volume sound size adpcmDataAdr if data type AUDIO 24K
30. sample application plays one sound from four sounds stored in built in flash memory by using PWM or D A output based on inputs from user interface The processes consist of 4 coding blocks Initialize Wait for user input Pre process for sound data Process to play sound These blocks will be explained based 78 Sayit VoiceDemo application 11 5 1 1 Initialize Initialize internal parameters and set displays on 78KOR Say it as default Function play main Descr void vVoice main void Inputs oT Outputs Return Se void vVoice main void 8 play_mode PWM_MODE 8 play num PLAY NUM MIN 8 play volume PLAY VOLUME U8 data type U8 ucKeySts U32 sound size U8 far adpcmDataAdr J CREEK k k ko K k KOK KOK KOK KOK ke ke ek ke ke eoe ee x x Initialize k k K K K kk ee e x vAdpcmPrmInitialize ee ke ke ke ke ek ke ke e ee ee x x LED initialize vModeLED play mode vPlayNumLED play num vVolumeLED play volume I ee ke ke kk ke ke e read data koe ke ke ee ke ke eoe ee e vLoadAdpcmData D Initialize parameters flags that are used by application Initialize displays display initial screen 8 Load sound data information compression bit info address data length etc User s Manual
31. to the corresponding documentation of the IAR Embedded Workbench 8 1 IAR Systems Embedded Workbench for 78K installation To install the IAR Systems Embedded Workbench for 78K0 KOS KOR including C SPY debugger simulator select the AUTORUN program in the directory NIARN of the CDROM The setup dialogues will guide you through the installation process 8 2 Sample program installation To install the sample demonstration programs for the 78KOR Say it board select the SETUP program in the directory NSampleProgramsN of the CDROM The setup dialogues will guide you through the installation process User s Manual U19237EE1VOUMOO 28 78KOR Say it NEC 8 3 USB Driver Installation In order to use the 78KOR Say it board for On Chip debugging the USB driver needs to be installed on the host machine Install the driver according to the following procedure Installation on Windows 2000 Page 29 Installation on Windows XP Page 34 Note The USB driver is part of the IAR Embedded Workbench software package Therefore please install the IAR Embedded Workbench first 8 3 1 Installation on Windows 2000 1 When the 78KOR Say it board is connected with the host machine the board is recognized by Plug and Plays and the wizard for finding new hardware is started Click Next Figure 9 Found New Hardware Wizard Windows 2000 Found New Hardware Wizard Welcome to the Foun
32. 1 5 2 Decode Process e ie ibid iad 65 11 5 2 1 Initialization of Decode Process 65 11 5 2 2 32Kbps Decompression AP hiria Cere tet rete eee Eater eee teg dip te a pe rte gen 65 11 5 2 2 24Kbps Decorripression APT iiit teret eee u ee en uD way ainda 65 11 5 2 4 16Kbps Decompression 65 11 5 3 Format of Decompressed 65 11 5 4 Output Cycle and Interruption enne nennen sinn 66 11 5 5 Decode 32Kbps Compressed 2 2 67 11 5 6 Sound Output Process 62 5ys Interrupt nennen 69 11 5 7 Example of A D ConversiOn uu dece Ya 75 11 6 Function U U u u u uuu uuu 76 vold imaln Old ED 76 11 6 2 void yVolce maln Void uu y daya da ne n nean 76 11 6 3 vCPUinitialize void aa a ha Gaan nnns snnt 76 11 6 4 void vPlayPrminitialize void u eere t nt 76 11 6 5 void vAdpcmPrmlnitialize 77 11 6 6 void vKeyMon Standby U8 p mod
33. 19237EE1VOUMOO 80 78KOR Say it Function 11 6 16 void vINTTMOA hdr void vINTTMO4 hdr Syntax void 04 hdr void Description 62 5us cycle interrupt handler Input Value Trigger to update output sound data Return Value Remarks Function 11 6 17 void vINTTMOS5 hdr void vINTTMOS hdr Syntax void VINTTMO5 hdr void Description 1ms cycle interrupt handler Used as general purpose timer Input Value Monitor joystick key input Return Value Remarks Function 11 6 18 void vBeep sample void vBeep sample Syntax void vBeep sample void Description Sample function to output beep Input Value Return Value Remarks Function 11 6 19 void vAD main void vAD main Syntax void vAD main void Description Get illuminance sensor data Input Value Return Value Remarks User s Manual U19237EE1VOUMOO 81 78KOR Say it Function 11 6 20 void vSilence 032 msec U8 p mode vSilence Syntax void vSilence U32 msec U8 p mode Description Output silence Input Value U32 msec Valid range output time in ms 1 10000 10 seconds U8 p_mode Output mode PWM mode 0 D A mode 1 Return Value Remarks Function 11 6 21 void vBeep U8 p mode U8 tone U32
34. 5 P41 TOOL1 P14 EX28 RXD3 P14 3 P86 RR 3 P40 lt RESET 15 P40 TOOLO 78KOR KG3 GC P15 EX29 RTCDIV RTCCL T64 LED Fema 3 RESET 14 RESET PD78F 1166GC UEU AX 16 0 101 01 1 5 65 T 2 P87 SML512BC4T IT 124 2 LASH 256KB RAN 12KB P17 EX31 TIO2 TOO2 61 T62 TEDS FLMDO ge P123 XT1 E 57 5 16 60 FLMD025 5 31 0 P56 EX14 69 ps5 P122 X2 EXCLK P55 EX13 28 Ps7 19 P121 X1 P54 EXI2 25 53 20 REGC P53 EX11 22 555 r a vss P52 EXIO 21 50 Ps1 EX9 55 597 0 47uF 22 54 MR2 53 VDD roan P50 EX8 53 P50 SML512BC4T SA 16 i z F Iso EEEE EVDD 752 i LED 15 2 QT re 2222 2 aj rer 152 P51 SML5128C4T A 14 3 T25 P61 SDA0 i P87 EX7 iE 13 5 P52 SML512BC4T S md 12 5 P53 SML512BC4T SS 10 7 Ezziunuuuuuusosun lu LEDi2 9 8 SBSSSSSRLLELARRSSSBoIBSBS P54 SML512BC4T A ONUS o lt 09 ex eo lt t up co r o o 55 SML512BC4T V UPD78F1166GC UEU AX S N N N ss s ss SS SS S E EE aa ES P56 SML512BC4T If 1mA 1 015 P57 SML512BC4T WX SRERBEB EEEEE 53 BEREEBE LEDi6 PEPEPEPE AVDD zoo 3 P77 3 P76 1 1 1 es c5 ce c4 C7 ZT 4JuF 25V OiuF TX 4 25 0 tuF x AGND AGND yup ni DCVDD Un
35. 6 Figure 27 Figure 28 Figure 29 Figure 30 Figure 31 Figure 32 Figure 33 Figure 34 Figure 35 Figure 36 Figure 37 Figure 38 78KOR Say it system configuration I nennen nes 13 78KOR Say it board connectors and 14 Navigation switch 1 15 Switch SWA Filter Amplifier circuit 16 USB1 USB Mini B Type Host Connector Pin 21 Test pads TA T1003 urere eco ee Fea e reed i date Pee venae dedu edd eene 22 On Chip debuggiNg Da dev d ee a Y den av 24 Z8aKOR KGO9 memory mapi bro ter p 26 Found New Hardware Wizard Windows 2000 sese 29 Search Method Windows 2000 ener nente nennen snnt innen nnns 30 Driver File Location Windows 2000 30 Address Specification 1 Windows 2000 nnne 31 Address Specification 2 Windows 2000 eene 31 Address Specification 3 Windows 2000 eene nennen 32 Driver File Search Windows 2000 sse tentent enne 32 USB Driver Installation Completion Windows 2000 seen 33 Found New Hardware Wizard 1 Windows 34 Found New Hardware Wizard 2 Windows
36. 6 0 tuF Ra 4 gt gt FLMDO 1 en tu 1 5K SN74LVC2G126DCU 1 USBVDD P16 MR3 5 4 voD 18 B use CN1J8 108 8 CN1J8 103 MR3 3 Pot 5 3 RESET gt RESET 1 sws His 5 al zl 4 USB 1 2 3 4 MR3 2 MR3 Title CN1J8 103 gt CN1J8 103 SN74LVC2G126DCU TI 78KOR KG3 Voice SKQMBB 100 2 SN74LVC2G07DCK i a Bize Document Number ev Ce E A3 62 0167A 1 0 Date Wednesday January 17 2007 heet 3 of il Aes 40381 78KOR Say it MEMO User s Manual U19237EE1VOUMOO 96
37. 78KOR KG3 device carefully to get information about the electrical specification of the available I O ports before you connect any external signals to the 78KOR Say it board User s Manual U19237EE1VOUMOO 14 78KOR Say it NEC 3 1 SW1 Navigation switch Button SW1 is a navigation switch connected to the key interrupt pins of the 78KOR KG3 device It operates in four directions and has a center push function When the navigation switch is moved to one of the four directions or it is pushed a low level signal Vss is applied to the corresponding pin of the 78KOR KG3 device The connection of SW1 to the microcontroller is shown in the table below Right Left P72 EX18 KR2 P73 Down P74 EX20 KR4 INTP8 Center Push P71 EX17 KR1 Right P73 EX19 KR3 Center Push Up P70 EX16 KRO P71 Down P74 Figure 3 Navigation switch SW1 For information about the pull up resistor setting of the corresponding port please refer to the user s manual of the 78KOR KG3 device 3 2 SW2 Switch INTPO SW2 is a push button connecting VSS to external interrupt input INTPO of the microcontroller This is equal to port P120 INTPO EXLVI of the 78KOR KG3 device The port may be programmed to generate the external interrupt INTPO The necessary initialisation for this purpose is described in the user s manual of the 78KOR KG3 device Please note when using SW2 turn ON the built in pull up resistor of the 78KOR KG3 devic
38. After changing the configuration of SW5 bits1 5 it is necessary to power up the 78KOR Say it board to make changing active This can be done by simply dis and re connecting the USB interface cable 3 5 3 SW5 bits6 8 General purpose switches The bits 6 8 of switch SW5 are connected to the pins P75 P77 of the 78KOR KG3 microcontroller They are free for any application purpose Setting a corresponding bit to ON applies low level Vss to the dedicated microcontroller pin Please note when using SW3 turn ON the built in pull up resistor of the 78KOR KG3 device register PU7 For doing so please refer to the user s manual of the 78KOR KG3 device 6 75 7 76 8 P78 Table 3 General purpose switches switch SW5 User s Manual U19237EE1VOUMOO 17 78KOR Say it NEC 3 6 SW6 RESET button SW6 is the reset button It activates the power on reset Switch SW6 controls the reset input signal of the 78KOR KG3 microcontroller 3 7 JP1 Power Supply selector Jumper is the power supply selector of the 78KOR Say it board 1 2 Closed power supply from AC adapter via connector CN1 2 3 Closed default power supply from USB via connector USB1 1 2 3 Open power supply from connectors JP2 or FP1 Table 4 Power supply selector JP1 3 8 JP2 External power connector By using connector JP2 not assembled external power supply can be applied to the 78KOR Say it board without
39. D OFF D Set volume level for amplifier device on the 78KOR Say it board Initialize compression decompression library 3 Call decompression function if compression bit is 4 bit Call decompression function if compression bit is 3 bit Call decompression function if compression bit is 2 bit Those decompression function is called with parameters of the output mode PWM D A volume level sound size and start address of sound data User s Manual U19237EE1VOUMOO 64 78KOR Say it NEC 11 5 2 Decode Process The 78KOR_Sayit_VoiceDemo project data contains the ADPCM SP compression decompression library lib adpcmsp r26 This library provide following API for compression decompression process However the sample program uses only the decompression process 11 5 2 1 Initialization of Decode Process API Initialize the memory area 32 byte RAM used for decompression process This work area should be located in resident area This API should be called every time before you start decompression process 11 5 2 2 32Kbps Decompression API Decompress 32Kbps ADPCM SP code 11 5 2 3 24Kbps Decompression Decompress 24Kbps ADPCM SP code 11 5 2 4 16Kbps Decompression API Decompress 16Kbps ADPCM SP code Above 4 APIs are available for decompression 11 5 3 Format of Decompressed Data The format of decompressed sound data is shown below 1st Byte 3rd Byte b7 CORRE E
40. EY SHORT ON PUSH Key ON locked KEY LONG ON PUSH Key Long ON locked KEY SHORT OFF PUSH Key OFF ucKeyStsLocked 2 KEY SHORT ON LEFT Key ON locked KEY SHORT OFF LEFT Key OFF ucKeyStsLocked 3 KEY SHORT ON RIGHT Key ON locked KEY SHORT OFF RIGHT Key OFF ucKeyStsLocked 4 KEY SHORT ON DOWN Key ON locked KEY SHORT OFF DOWN Key OFF Remarks User s Manual U19237EE1VOUMOO 78KOR Say it 11 8 11 voice adpcm 4 Variable Constant voice adpcm 4 Declaration static struct tstsSOUND voice adpcm 4 Source File 78KOR Voice c Use Sound data information array U8 datatype compression bit information 2 ADPCM SP 16K 8x2bit 3 ADPCM SP 24K 8x3bit 4 ADPCM SP 32K 8x4bit U32 datacount Data count information U8 far address Data address information Remarks 11 8 12 ucAmpLevelTable 9 Variable Constant ucAmpLevelTable 9 Declaration static const UB ucAmpLevelTable 9 Source File 78KOR Voice c Use Amplifier volume level table D A output value ucAmpLevelTable 0 VLVL_AMPO ucAmpLevelTable 1 VLVL_AMP1 ucAmpLevelTable 2 VLVL_AMP2 ucAmpLevelTable 3 VLVL_AMP3 ucAmpLevelTable 4 VLVL_AMP4 ucAmpLevelTable 5 VLVL_AMP5 ucAmpLevelTable 6 VLVL_AMP6 ucAmpLevelTable 7 VLVL_AMP7 ucAmpLevelTable 8 VLVL_AMP8 Remarks User s Manual U19237EE1VOUMOO 90 78KOR
41. F 1000pF zi 920 1000pF 1000 E al Bat 4309 1000pF id P R24 C25 R25 12K 39K C26 C27 gt R26 30K 36K 1200 24K 1800pF o 1000pF 6800pF ach ach acho acto agp R27 AGND R28 10K R29 10K 10K R30 i AGAD RS pas ach 1 2 1 2 AGND 1 2 20K 12K 18K AVDD C28 C29 J 2 8 5 2 CN2 i S ic 4 4 151 1 gum 4 1 100uF 16V LGY6501 0900F 1 ANO gt DC Vol SD 2 i R33 i NDT 03C 150 7 Bypass of AVDD R35 T 1 3 amp x Sense jo 100K a LM4865M C81 c32 4 TuFJ25N F 0 tuF AGND AGND Aud i litle TK 78KOR KG3 Voice ize Document Number Rev A3 62 0167A 1 0 Date Thursday January 18 2007 Eneet 2 of il Aes 40381 OOWNOALAAZEZELN Enue A 5 195 96 ge anfi E E j ACS H0M8Z us USBVDD 1 1 5 22 1_O PU Shield Pot 2 1 010
42. KOR Say it board please set switch SW5 bits 1 5 to the following configuration 1 ON OFF 2 ON 3 ON 4 OFF 5 OFF Table 1 On Board debug mode setting switch SW5 When biti is set to ON the microcontroller stays in reset state till TK 78KOR debugging is started When bit 1 is set to OFF the microcontroller immediately starts code execution from the internal FLASH memory after power is applied to the board Note After changing the configuration of SW5 bits1 5 it is necessary to power up the 78KOR Say it board to make changing active This can be done by simply dis and re connecting the USB interface cable User s Manual 19237 1 00 00 16 78KOR Say it NEC 3 5 2 SW5 bits1 5 Stand alone mode To run a program stored in built in flash memory of the 78KOR KG3 device without using the On Board debugging mode please set switch SW5 bits 1 5 to the following configuration Additionally when using PG FP4 for FLASH programming or QB MINI2 for debugging purpose please use the same configuration 1 OFF 2 OFF 3 OFF 4 OFF ON 5 OFF ON Table 2 Stand alone mode setting switch SW5 When setting bits 4 5 to ON the UARTS signals RxD3 and TxD3 or the 78KOR KG3 device are connected to the uPD78F0731 USB microcontroller Within this mode standard serial communication to a terminal program running on the HOST PC can be established Note
43. LED shows which of the four sound data areas is selected The configuration and operation of the download sample is displayed by the LED s D A Starts blinking when downloading PWM Starts blinking when downloading PLAY It starts blinking when the board is ready for downloading SOUND It shows which sound data storage area 1 4 is selected by driving the corresponding LED VOLUME Before download no light Starting download all are lighted then reduce the number of lights FLASH deletion time While downloading no light then increase the number of lights FLASH writing progress Complete download light Error occurred all are lighted To program the 78KOR Say it starterkit with the download sample please open the 78KOR Sayit DownloadDemo project within the IAR Embedded Workbench Please press the 9 Debugger button to start FLASH programming After the IAR C SPY debugger has finished re programming please close the debugger The download sample is now successfully programmed To use the IAR Embedded workbench for reprogramming please set configuration switch SW5 accordingly User s Manual 1 719237 1 00 00 58 78KOR Say it NEC 11 4 1 Procedure to change sound data by downloading via CVADPCM tool In this section how to change the sound data by downloading is explained 1 Connection of devices Connect the 78KOR Say it starterkit and the host PC
44. N Un Goran enine anmi Q su eee qose i ied k i Sal 87 11 9 4 6 kamami haku hka feda date td pedes attende 87 11128755 E80 itii Ou annui iR E 88 11 8 6 me bone Sun REED 88 1158 7 uilntCOUDter s 88 11 8 8 d 88 11 8 9 usKKeyStsCount b deletes e rtr e rere nt ot prb eb o et eet 89 11 9 10 ucKeyStsLEockoed b 1 det ete i e debe Ho eq ire tbe p eiut 89 EE 90 11 8 12 90 11 8 13 _ 9 91 QE gere 92 121 USB interface cable Mini B type U u u uu u uuu u 92 13 Schemat GS a tuoi i niin us passes 93 User s Manual U19237EE1V0UM00 78KOR Say it NEC List of Figures Figure 1 Figure 2 Figure 3 Figure 4 Figure 5 Figure 6 Figure 7 Figure 8 Figure 9 Figure 10 Figure 11 Figure 12 Figure 13 Figure 14 Figure 15 Figure 16 Figure 17 Figure 18 Figure 19 Figure 20 Figure 21 Figure 22 Figure 23 Figure 24 Figure 25 Figure 2
45. R_Voice c Output B adpemsp h I A common h I intrinsics h I B io78f1166_a0 h B io76f1166 a0 exth Output ex Module Versi Copyright c 2008 by NEC Electronics Europe GmbH a company of the NEC Electronics Corporation Purpose main routine of 78K0R Say it sample In case of any question please do not hesitate to contact Technical Product Support Electronics Europe Gmbh Arcadiastrasse 10 D 40472 Duesseldorf Germany e mail K0_support eu necel com FAX 49 0 211 65 03 12 79 Warranty Disclaimer I Because the Product s is licensed free of charge there is no warranty of any kind whatsoever and expressly disclaimed and excluded by NEC either expressed or implied including but not limited to those for non infringement of intellectual property merchantability and or fitness for the particular purpose NEC shall not have any obligation to maintain service or provide bug 78KOR_Sayit VoiceSample J td_v1 SwiStarterkits 78KOR Say it Work SamplePragrams 7BKOR_Sayit_VoiceSample_Obj 76KOR_Sayit_VoiceSample ewp fal its Bandaran ee iniii Figure 26 IAR project workspace As a next step check some settings of the IAR Embedded Workbench that have to be made for correct operation and usage of the On Board debug function of the 78KOR Say it bo
46. Say it 11 8 13 ucVolumeLevelLEDTable 9 Variable Constant ucVolumeLevelLEDTable 9 Declaration static const 08 ucVolumeLevelLEDTable 9 Source File 78KOR Voice c Use Volume level LED output table 1 output value ucVolumeLevelLEDTable 0 ucVolumeLevelL EDTable 1 ucVolumeLevelL EDTable 2 ucVolumeLevelLEDTable 3 ucVolumeLevelLEDTable 4 ucVolumeLevelLEDTable 5 ucVolumeLevelLEDTable 6 ucVolumeLevelL EDTable 7 ucVolumeLevelLEDTable 8 VLVL LEDO VLVL LED1 VLVL LED2 VLVL_LED3 VLVL_LED4 VLVL LED5 VLVL LED6 VLVL LED7 VLVL LED8 Remarks User s Manual U19237EE1VOUMOO 91 78KOR Say it NEC 12 Cables 12 1 USB interface cable Mini B type Series A Plug Series Mini B Plug Series Plug Series Mini B Plug Figure 35 USB interface cable Mini B type User s Manual U19237EE1VOUMOO 92 OOWNOALAAZEZELN enue 5 195 6 95 L soneujeuos jJ ABS 84 Yi x CSTCE20M0V53 3 AUD EP1 1 GND res 2 m 3451 4 so 6 7 8 9 10 M FLMDO T RESET Pat T RESET IN IN 9 shiela 16 5403
47. U19237EE1VOUMOO 61 78KOR Say it 11 5 1 2 Wait for user input Wait for user input by activating the navigation switch SW1 KK KK k k k k K k K KOK KOK AK I eoe Start RK KR k k k K RRA I OR K KOK enable interrupt while 1 ucPlaySts STATUS_STANDBY KR KKK KK Wait for Key ucKeySts OxFF while ucKeySts ucKeySts JOYSTK vPlayPrmInitialize 1K RK k k k k K K k K KOK KOK ARK A HH OK K R KOK Wait for Joystick push x KR KKK KR AAR RA I He INT_1MSEC_ENABLE vKeyMon Standby amp play mode amp play num amp play volume PlayMode play mode D Start play application with global interrupts enabled Initialize internal parameters in loop process 3 Wait until the navigation switch to be pushed to start playing User s Manual U19237EE1VOUMOO 62 78KOR Say it NEC 11 5 1 3 Pre process for sound data As the first initialization the sound data information is loaded The voice adpcm array contains compression bit info data address data length etc In this block the sound data information of user selection is loaded KKK k k k k k KOK K K A KOK AAR AKI KOR KO prepare KK k k k k k k k K K K A KOR AAR ARI IK data type voice adpcm play num 1 datatype if data type AUDIO 32K Sound size voice adpcm play num 1 datacount 2 else
48. ailability of related technical literature Development environment specifications for example specifications for third party tools and components host computers power plugs AC supply voltages and so forth e Network requirements In addition trademarks registered trademarks export restrictions and other legal issues may also vary from country to country NEC Electronics Inc U S Santa Clara California Tel 408 588 6000 800 366 9782 Fax 408 588 6130 800 729 9288 NEC Electronics Europe GmbH Duesseldorf Germany Tel 0211 65 03 0 Fax 0211 65 03 1327 Sucursal en Espana Madrid Spain Tel 091 504 27 87 Fax 091 504 28 60 Succursale Francaise V lizy Villacoublay France Tel 01 30 67 58 00 Fax 01 30 67 58 99 Filiale Italiana Milano Italy Tel 02 66 75 41 Fax 02 66 75 42 99 Branch The Netherlands Eindhoven The Netherlands Tel 040 244 58 45 Fax 040 244 45 80 Branch Sweden Taeby Sweden Tel 08 63 80 820 Fax 08 63 80 388 United Kingdom Branch Milton Keynes UK Tel 01908 691 133 Fax 01908 670 290 NEC Electronics Hong Kong Ltd Hong Kong Tel 2886 9318 Fax 2886 9022 9044 NEC Electronics Hong Kong Ltd Seoul Branch Seoul Korea Tel 02 528 0303 Fax 02 528 4411 NEC Electronics Singapore Pte Ltd Singapore Tel 65 6253 8311 Fax 65 6250 3583 NEC Electronics Taiwan Ltd Taipei Taiwan Tel 02 2719 2377 Fax 02 2719 5951 NEC do Brasil S A Electron D
49. alue lt 50 Conversion Value lt 150 Conversion Value lt 250 Conversion Value lt 350 Conversion Value gt 400 Next you are going to add conditional statement to compare with light and dark and play the different sound No Light 2 Lights 4 Lights 6 Lights 8 Lights User s Manual U19237EE1VOUMOO 72 78KOR Say it if 1 0 amp amp playEndflg_Low 0 if uilntCounterl gt KEY LONG ON TIME play_num 1 playEnvflg 1 playEndflg Low playEndflg High 1 0 else if 1 gt 7 amp amp playEndflg High 0 if uilntCounterl gt KEY LONG ON TIME play_num playEnvflg playEndflg_Low playEndflg_High 2 1 0 1 else uilntCounterl 0 gt 3 amp amp 1 lt 5 uilntCounterl playEndflg_Low playEndflg_High 0 0 0 QD i220 indicates dark To prevent for outputting the sound repeatedly by keeping the dark status it contains the statement playEndFlg_Low 0 it is still dark With the statement uilntCounter1 gt KEY LONG ON TIME it can check if it passed off certain period of time uilntCounter1 is general purpose 1msec counter using cycle interrupt Since KEY LONG ON TIME is set to 1500 the cycle is more than 1 5 seconds When it meets the condition it sends the play sound number with play num 1 and play
50. ard 3 12 CN1 AC power supply connector CN1 is the AC power supply connector of the 78KOR Say it board Caution please connect only power supply of maximum 5V to the board There is no voltage regulator assembled on the 78KOR Say it board Higher supply voltage can damage the board Center VDD 5V Ring GND Note Be sure to unplug the USB connection before connecting a 5V AC power supply to CN1 and set jumper JP1 to 1 2 closed User s Manual U19237EE1VOUMOO 19 78KOR Say it NEC 3 13 CN2 external speaker jack CN2 is the jack for external speakers You can connect an external speaker to improve the sound quality when playing sounds Supported jack 3 5mm monaural Table 7 External speaker jack CN2 3 14 FP1 MINICUBE2 PG FP4 connector Connector not assembled allows connecting the PG FP4 FLASH programmer to 78KOR Say it board in order to program application software into the 78KOR KG3 internal flash memory Please note the PG FP4 FLASH programmer is a separate product from NEC it is not included in this package Additional allows connecting the QB MINI2 On Chip debug emulator to the 78KOR Say it board in order to use On Chip debug function of the 78KOR KG3 device Please note 2 is a separate product from NEC and it is not included in this starterkit package FLMDO RESET IN CLK IN Table 8 PG FP4 2 connect
51. ard First highlight the upper project folder called 78KOR Sayit VoiceDemo Debug in the workspace window Then select Project gt Options from the pull down menus Next select the category Debugger Make sure that the driver is set to TK 78 in order to use the On Board debug function of the 78KOR Say it board The device description file must be set to io78f1166_a0 ddf The corresponding COM port where the 78KOR Say it board is connected to the host PC will be detected automatically by the IAR C SPY debugger Options for node ADC demo Category Factory Settings General Options C C compiler Assembler Custom Build Build Actions Linker IE 78 IECUBE MINICUBE Simulator TK 78 Setup Extra Options Plugins Driver Tk 78 Runto TK 78KOxxx TK 78KOR xxx main Setup macros Use macro Device descriptions Override default Cancel Figure 27 IAR debugger options User s Manual 019237 1 00 00 Select TK 78 to use On Board debugging Check that device description file of 78 1166 is selected 40 78KOR Say it Next the correct linker settings of the demo project will be checked This be done in the Linker category as shown below Select the Config tab and check that the linker command file Ink78f1166 adpcmsp xc is selected This file is used by the linker and contains information on
52. ation swilch 16 3 5 1 SW5 bits1 5 On Board debug mode TK 78KOR 16 35 2 SWb bitst 5 Stand alone mode 1 derer eter terr rerit C Fea erred Fal neat hasa Tasa 17 3 5 3 5 5 bits6 8 General purpose switches n n u 17 3 6 SW6 RESET Laco eoo Ran ae aS aeuo LAS Rave danda 18 3 7 1 Power Supply selector u u u u uu u uu u J T T 18 3 8 2 External power connector esses essen 18 3 9 Photo IC illuminance sensor Q1 18 3 10 LED1 16 general purpose LEDs J U u u uu uu nnmnnn nnmnnn 19 3 11 EED17 power LED eerie eid ee iiie 19 3 12 CN1 AC power supply connector u u u u u u u J T 19 3 13 CN2 external Speaker jack J u u u u u u u u u u uuu u u 20 3 14 FP1 MINICUBE2 PG FP4 connector U 20 3 15 USB1 serial interface connector U u u 21
53. ch can be started To do so start the Embedded Workbench from Windows Start menu Programs folder IAR Systems IAR Embedded Workbench Kickstart for 78K The following screen appears JAR Embedded Workbench IDE File Edit View Project Tools Window Help De amp Belo 71 S J P 4 By 2 SID Worspae Embedded Workbench Startup Create new project in current workspace Add existing project to current workspace existing workspace Example workspaces Riecent workspaces Do not show this window at startup Cancel Figure 25 IAR Embedded Workbench Now select the option Open exiting workspace from the File menu and locate the sample project 78KOR_Sayit_VoiceDemo_Obj Open the file 78KOR_Sayit_VoiceDemo eww This is the workspace file that contains general information about the demo projects and corresponding settings User s Manual U19237EE1VOUMOO 39 78KOR Say it After the demo workspace has been opened the files contained in the workspace are displayed Now click the little sign next to the project filename 78KOR_Sayit_VoiceDemo Debug to show all files that were part of the selected demonstration project The screen should now look similar to this Embedded Workbench IDE File Edit View Project Tools Window Help D L m Debug Files cs Library Sounds Ha B 78KO
54. d New ey Hardware Wizard NS This wizard helps you install a device driver for a hardware device Cancel User s Manual U19237EE1VOUMOO 29 78KOR Say it NEC 2 Following the window below is displayed So check that Search for a suitable driver is selected then click Next Figure 10 Search Method Windows 2000 Found New Hardware Wizard Install Hardware Device Drivers device driver is a software program that enables a hardware device to work with ey an operating system This wizard will complete the installation for this device Check that Search for a e USB Device suitable driver is selected device driver is a software program that makes a hardware device work Windows needs driver files for your new device To locate driver files and complete the installation click Next What do you want the wizard to do Display a list of the known drivers for this device so that can choose a spe driver lt Back Neo Cancel 3 Check the Specify a location check box only then click Next gt Figure 11 Driver File Location Windows 2000 Found New Hardware Wizard Locate Driver Files Where do you want Windows to search for driver files S Search for driver files for the following hardware device USB Device Check that Specify a location on ly is checked The wizard searches for suitable drive
55. data zi gt dem coe BUFCNT BUF 1 BUF 2 BUF CNT BUF 1 BUF 2 BUF 2 1 PCM Data a 2 Data No data 1 i gt gam lt BUF CNT BUF Counter 0 4 BUF CNT BUF 1 BUF2 1 BUF 1 BUF2 3 Data Data 2 5 w BUF CNT BUF 1 BUF2 gt BUFCNT BUF 1 BUF 2 Transfer 4 Data Data 3 gt E BUF CNT BUF 1 BUF 2 4 BUFCNT BUF 1 BUF 2 This application allow other process to be taken even it is waiting for the next cycle of 62 5us output process while playing process is running in loop There are 2 decompressed output data areas output data 0 output data 1 and 1 buffer counter area output count It outputs the data from lower buffer area output data 0 with the cycle of 62 55 output process It does not allow interrupts when it handles output buffer in decode process User s Manual U19237EE1VOUMOO 78KOR Say it NEC Example of Application Using Sensor In this section the application example to output Sound A when it gets lighter and Sound B when it gets darker using illuminance sensor on 78KOR Say it board will be explained Following processes are needed to develop this application 1 Read Current Level by Sensor 2 Compare Current Level with Light Dark reference Value 3 Output S
56. e U8 p U8 p volume 77 11 6 7 void vKeyMon Play U8 p 77 11 6 8 void vVolumeLED E RR Er 77 11 6 9 void VModeLED 08 uyu l l y ener nnn nnne 78 11 6 10 void vPlayNumLED U8 78 11 6 11 void vVolumeControl U8 Ivl 78 11 6 12 void vDecode_32k U8 p mode U8 p volume 032 size U8 _ far 79 11 6 13 void vDecode 24k U8 p mode U8 p volume 032 size U8 far 79 11 6 14 void vDecode 16k U8 p mode U8 p volume 032 size U8 _ far 80 11 6 15 void vLoadAdpcmData 80 User s Manual U19237EE1VOUMOO 78KOR Say it NEC 11 6 16 void vINTTMOA 81 T1 6 17 void vINTTMOS ll A k am tene 81 11 6 18 void vBeep sample Void u ux k um eret ce e tenet eel re sete n err te nani 81 11 6 19 void VAD man void sio teer toe 81 11 6 20 void vSilence U32 msec U8 p 82 11 6 21 void vBeep U8 mode U8 tone U32 nens 82 11 6 22 U32 uiADCconVvert VOId 82 11 7 Macro SpecifiCatlons eric oci
57. e register PU12 3 3 SW3 Switch INTP1 SW3 is a push button connecting VSS to external interrupt input INTP1 of the microcontroller This is equal to port PA6 INTP1 TIOS TOO05 of the 78KOR KG3 device The port may be programmed to generate the external interrupt INTP1 The necessary initialisation for this purpose is described in the user s manual of the 78KOR KG3 device Please note when using SW3 turn ON the built in pull up resistor of the 78KOR KG3 device register PU4 User s Manual U19237EE1VOUMOO 15 78KOR Say it NEC 3 4 SW4 Switch Filter SWA is the slide switch to select if the onboard Filter circuit LMV324M should be used or not If SW4 is set to OFF the Filter is not used and the sound output signal of the microcontroller is directly connected to the amplifier SW4 Jack CN2 OFF 78KOR KG3 I A Micro Filter o sudio oig signa controller On board loudspeaker LS1 Figure 4 Switch SW4 Filter Amplifier circuit 3 5 SW5 Configuration switch The different operation modes of the 78KOR Say it board can be set by switch SW5 The bits 1 5 of switch SW5 are for the mode setting of the board and bits 6 8 are DIP switches connected to P75 P77 pins of the 78KOR microcontroller and can be used for user application purpose 3 5 1 SW5 bits1 5 On Board debug mode TK 78KOR debugging To use the TK 78KOR On Board debugging function of the 78
58. e PWM LED and D A LED shows which output mode is selected The mode cannot be changed while the sound data is played UP Down This changes the sound output volume There are 9 volume levels OFF 1 8 The VOLUME LEDs are showing the selected level The sound volume can be changed during sound it played Center Push The sound playing can be started paused or stopped by pressing the navigation switch Pressing the switch when a sound is playing pauses the sound output Within the pause mode the PLAY LED starts blinking By pressing the SW1 for more than 1 5 seconds the sound output is stopped Playing of the sound can be started by pressing SW1 one s again Right This selects the sound data to play from totally four sound data stored in built in FLASH memory of the 78KOR KG3 device The SOUND LEDs 1 4 shows which sound is actually selected The sound data cannot be changed while the sound data is played User s Manual U19237EE1VOUMOO 48 78KOR Say it NEC Below the flow chart of the main sound play process is shown vVoice main Start Initialize Parameters vAdpcmPrminitialize vModeLED Initialize Display vPlayNumLED vVolumeLED Load Sound Data Info vLoadAdpcmData Wait for Key Input vKeyMon_Standby 9 Load Sound Data Length Load Sound Data and Data Address Output Volume vVolumeControl 32Kbps Data 32K Play Process 24K Play Proces
59. e building the corresponding project By doing so an Intel Hex file is generated that is mapped to the corresponding sound data area To download new sound data to the 78KOR Say it board and furthermore to re flash the reserved sound data area within the 78KOR KG3 device please press the 32 Debugger button within the IAR Embedded Workbench Note be sure that the function Erase flash before next ID check is not active within the TK 78 Hardware Setup menu Otherwise the complete FLASH memory of the 78KOR KG3 device will be erased before programming the sound data 78 Hardware Setup for 78 78F1166A0 don t enable ID code Time unit FFFFFFFFFFFFFFFFFFFF nsec Cancel Erase flash before next ID check After the IAR C SPY debugger has finished re programming of the chosen sound data area please close the debugger The new sound data is now successfully updated Please proceed in the same way for the remaining sound areas Because the 78KOR Say it starterkit comes with the IAR Embedded Workbench Kickstart version the maximum size for each sound data is limited to 16KByte After you have programmed or changed the sound data please activate the 78KOR Sayit VoiceDemo project and debug it as usual Please note also by debugging the sample be sure that the function Erase flash before next ID check is not active within the TK 78 Hardware Setup menu Otherwise the complete FLASH memory of the 78KOR KG3 device
60. eader files The xc1 directory contains the linker control file of the 78KOR KG3 device All output files including the object files list files debug information and finally the executable file are stored in the directory Debug For details of using the IAR Embedded Workbench and the IAR C SPY debugger please refer to the 78K IAR Embedded Workbench IDE User Guide User s Manual 019237 1 00 00 45 78KOR Say it NEC 11 2 78 Sayit VoiceDemo Obj sample program This sample program is a simple sound play application that uses the ADPCM compress decompress library The sample is divided into three major parts the sound play beep play and illuminance sensor application Please use the source code of the different application parts as reference on how a sound play system based on the 78KOR device can be realized To get more details on the source program itself please refer to the following chapters Because the 78KOR Say it starterkit comes with the IAR Embedded Workbench Kickstart version which is limited to generate maximum 16KByte of code size the sound data within this sample is provided as object code files adpcm r26 If you want to change the sound data please refer to the sample 78 Sayit VoiceDemo Src chapter 11 3 of this document Workspace space ebug E Files 8K0R Sayit VoiceDemo Debug Library adpemsp r26 Sounds E adpem 126 adpern2 r26 E adpcm3 r26 E adpc
61. el Erase flash before next ID check Cancel Main clock Sub clock 9 Default efaul External Extemal 7 None v MHz None v kHz2 Flash programming Target power off Target connect 6 TOOLD TOOl Not Permit 2 Not Permit Pin mask Peripheral break r TARGET RESET A timer C INTERNAL RESET serial etc ie Memory map Start address Length Type 860 Internal ROM 0 00000 Ox3FFFF Internal ROM 256 Kbytes OxFCFOO OxFFEFF Internal 12288 bytes Remove Remove All Figure 29 TK 78 hardware setup menu User s Manual 019237 1 00 00 41 78KOR Say it NEC Now the debugger is started and the demo project is downloaded to the 78KOR Say it board The progress of downloading is indicated by blue dots in the TK 78 Emulator window Please note downloading of larger executables can take some time 7 Embedded Workbench IDE ge 78K0R Voice c Module EY E Version V1 00 B E 78KOR Sayit Vo v p Lir RT a C3 Library COPYRIGHT Ha Sounds D l 8 78K0R_Voice c Copyright c 2008 by NEC Electronics Europe GmbH C3 Output of the NEC Electronics Corporation I adpemsp h I E
62. ending on the size of playing sound data 3 Monitor key inputs 4 Extract compressed data As this function decompresses 4 bit compressed data it extracts the lower 4 bit and then the higher 4 bit compressed data 5 Send the 4 bit data to decompression library and store the data in usPCMdata User s Manual U19237EE1VOUMOO 67 78KOR Say it disable interrupt if output count if p mode PWM MODE NEC output_data 0 016 U16 usPCMdata 0x8000 gt gt 6 if p mode DA MODE output data 0 U8 016 usPCMdata 0 8000 gt gt 8 output_count 2 else if mode PWM MODE output_data 1 016 016 usPCMdata 0x8000 gt gt 6 if p mode DA MODE output data 1 U8 016 usPCMdata 0 8000 gt gt 8 output_count output_count 2 enable interrupt loopt K KOR KOK KOR KOR KOR break ay k K K K KOK K A AAI He KOR KOR KO f else if ucPlaySts STATUS BREAK break while output_count 0 vVolumeControl 0 if p mode MODE STOP PWM ise STOP DA A TOP 625 D Store decompressed data in playing buffer area 2 Respond to key inputs while playing 3 Loop until it outputs all data Turn off the volume disable PWM and D A output and disable interrupt after finishing playing so
63. es j FFEFFH General purpose register FFEEOH 32 bytes Program area FFEDFH F86FFH _ Mirror 29 75 KB g F1000H FOFFFH Use prohibited F0800H F07TFFH 010C4H Special function register 2nd SFR 010C3H 2 KB 010C0H 4 bytes 010BFH CALLT table area 64 bytes 01080H FooooH EFFFFH Use prohibited Data memory 0107FH space EDFFFH Vector table 2 128 bytes External expansion area 01000H 440 KB max OOFFFH Program area 80000H 000C4H 00003 Option byte area 000COH 4 bytes 000BFH CALLT table area Program PED I Flash memory 64 bytes 512 00080H ipae 0007 Vector table area 128 bytes 00000H 00000H Use of the area F8700H to FBEFFH is prohibited when using the self programming function Notes 1 2 When using boot swap write the contents of 00000H through OOFFFH to 01000H through 01FFFH Figure 8 78KOR KG3 memory map The 78KOR Say it does not reserve any resources of the 78KOR KG3 microcontroller consequently all available memory of the device is free for application software 26 User s Manual 019237 1 00 00 78KOR Say it NEC 6 78KOR Say it installation and operation 6 1 Getting started The IAR Embedded Workbench including the C SPY debugger allows to build and download application programs to the 78KOR Say it starterkit A
64. eturn Value Remarks 0 no light on 8 all lights on User s Manual U19237EE1VOUMOO 77 78KOR Say it Function 11 6 9 void vModeLED U8 mode vModeL ED Syntax void vModeLED U8 mode Description Output mode LED Input Value U8 mode Output mode information PWM mode 0 D A mode 1 Return Value Remarks Function 11 6 10 void vPlayNumLED U8 num vPlayNumLED Syntax void vPlayNumLED U8 num Description Output play number LED Input Value U8 num Play number information Play sound number 1 4 Return Value Remarks Function 11 6 11 void vVolumeControl U8 Ivl vVolumeControl Syntax void vVolumeControl U8 Ivl Description Control amplifier volume Input Value U8 Volume information Volume 0 8 Return Value Remarks Settings for amplifier 8 bit D A 0 0x00 1 0x60 0x80 0x90 0 OxBO 0xC0 OxEO 0xFF User s Manual U19237EE1V0UM00 78 78KOR Say it 11 6 12 void vDecode 32k U8 p mode U8 p volume 032 08 far Function vDecode 32k Syntax void vDecode 32k U8 p mode U8 p volume U32 size U8 _ far adr Description Decompress 4 bit compressed data Input Value U8 mode Output mode information PWM mode 0 D A mode 1 U8 p volume Volume informati
65. evices Division Guarulhos Brasil Tel 55 11 6465 6810 Fax 55 11 6465 6829 User s Manual U19237EE1VOUMOO 78KOR Say it Revision History 17 06 2008 Revision Chapter Description First release User s Manual 19237 1 00 00 78KOR Say it NEC Table of Contents JE I 11 1 1 Main features of 78KOR Say 11 1 2 System 12 1 3 Package 12 1 4 TRAM tih 12 2 78KOR Say it system configuration 13 21 78 5 13 2 2 91 gasas 13 2 3 Power supply via USB interface u u u u uuu uuu u u J 13 3 7 Say It components UU III Ia sawas asas sasa ceeeeateeceeeedeestners 14 3 4 SW1 N avigationiswitch u u riri 15 EP AMEEA PAUCI 15 2 3 SW3 Switch INTP1 erroe eens saccadic tarnen rea eie age caen causer ana aaa 15 3 4 SW4 Switch Filter annaa ne da ames 16 3 5 SW5 Configur
66. f no output buffer area is available 3 Extracts the higher or lower 4 bit of 1 sound data 8 bit depending on number of outputs even or Decode the 4 bit data 5 Store decompressed data in one of output buffer area depending on the availability User s Manual U19237EE1VOUMOO 50 78KOR Say it NEC 11 2 3 Sensor Function By using this mode the light radiation is determined via the A D converter by measuring the output voltage of the onboard illuminance sensor The light radiation is displayed by the VOLUME LEDs Additionally pending on the light radiation the speech data It got dark or It got light is played by driving the onboard loudspeaker The corresponding speech data is stored in the adpcm1 r26 and adpcm2 r26 object files If you change the sound data by re flashing of the corresponding memory area different sound data can be played To run this function please set switch SW5 to the following configuration 1 2 3 4 5 6 7 8 OFF OFF OFF ON When using TK 78KOR On Board debugging ON OFF When using stand alone normal mode OFF ON A configuration via the navigation switch is not needed and supported within this sample Depending on the measured light radiation the number of driven VOLUME LEDs is changed The relationship between the A D conversion value and the driven VOLUME LEDs is shown in the table below
67. ger and to allow execution of application programs on 78KOR Say it starterkit 78KOR Say it runs the microcontroller at 20 MHz operating speed The sub clock is provided with 32 768 kHz 2 2 Host computer The USB host interface enables communication to the 78KOR Say it board The uPD78F0731 78 0 8 Bit microcontroller with on chip USB interface and the NEC virtual UART driver allows application software to access the USB device in the same way as it would access a standard RS232 interface The NEC virtual UART driver appears to the windows system as an extra Com Port in addition to any existing hardware Com Ports 2 3 Power supply via USB interface The 78KOR Sayl it board is powered by the USB interface Optional the power supply can be applied via the connectors JP2 or CN1 User s Manual U19237EE1VOUMOO 13 78KOR Say it NEC 3 78KOR Say it components The 78KOR Say it board is equipped with a navigation switch a loudspeaker a photo IC illuminance sensor LED s and with several connectors in order to be connected to host computers FLASH programmer or any external target hardware JP2 JP1 151 SW5 Q SW4 CN2 I JAPAN dn SPE SU LED9 16 LED17 Power LED4 8 SW1 SWe sw2 sw3 Wrap Field FP1 Figure 2 78KOR Say it board connectors and switches Some of the 78KOR Say it components are free for user application hardware and software Please read the user s manual of the
68. ing configuration 1 2 3 4 5 6 7 8 OFF 60 Q j OFF ON OFF When using TK 78KOR On Board debugging OFF When using stand alone normal mode OFF ON The flowchart of the beep play sample is shown below vBeep sample Start vVolumeControl Set Volume Stat PWMorD A Start 62 5us Timer adpcm init Initialize Library vBeep Call BEEP Function Output high pitched sound adpcm init Initialize Library vSilence Call Silence Function adpcm init Initialize Library vBeep Call BEEP Function Output low pitched sound adpcm init Initialize Library vSilence Call Silence Function User s Manual U19237EE1VOUMOO 53 78KOR Say it QD Fix the volume level 2 Use PWM as output 3 Initialize compression decompression library then call BEEP output function set high pitched sound and 2sec as the input parameters Initialize compression decompression library then call Silence output function set 500msec as the input parameter 5 Initialize compression decompression library then call BEEP output function set low pitched sound and 2sec as the input parameters Initialize compression decompression library then call Silence output function set 500msec as the input parameter User s Manual U19237EE1VOUMOO 54
69. inters to the corresponding sound data areas For each of the four sound data a fixed memory area is defined The corresponding mapping can be seen in the figure below User s Manual U19237EE1V0UM00 55 78KOR Say it NEC 78KOR KG3 a 028000H 32k 020000H_ 32k 12k ROM Sound data area 3 256k Sound data Sound data information area 2 Size Compression format Sound data Data area 1 32k 64k Library etc The assignment of the memory for the different sound data is done within the linker directive file Ink78f1166 adpcmsp xc which is mutual for the main and the four sound data projects Each sound data area contains about a ADPCM FORMAT ADPCM SIZE and ADPCM DATA section The definition and mapping of the corresponding sections within the linker directive file can be seen in following figure Ink78f1166 adpcmsp xcl Z CONST ADPCMl FORMAT 10000 Z CONST ADPCMl SIZE 10002 Z CONST ADPCM1 DATA 10004 Z CONST ADPCM2 FORMAT 18000 Z CONST ADPCM2 SIZE 18002 Z CONST ADPCMZ DATA 18004 ni Z CONST ADPCM3 FORMAT 20000 Z CONST ADPCM3 512 20002 Z CONST ADPCMS DATA 20004 Z CONST ADPCM4 FORMAT 28000 Z CONST ADPCM4 SIZE 28002 Z CONST ADPCM4 DATA 28004 0111 The projects ADPCM Sound1 to ADPCM Sound 4 do include only the corresponding sound data for the four sound data areas The definition of the sound data is done within the adpcm c file
70. isual equipment home electronic appliances machine tools personal electronic equipment and industrial robots Special Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems life support systems and medical equipment for life support etc The quality grade of NEC Electronics products is Standard unless otherwise expressly specified in NEC Electronics data sheets or data books etc If customers wish to use NEC Electronics products in applications not intended by NEC Electronics they must contact an NEC Electronics sales representative in advance to determine NEC Electronics willingness to support a given application Note 1 NEC Electronics as used in this statement means NEC Electronics Corporation and also includes its majority owned subsidiaries 2 NEC Electronics products means any product developed or manufactured by or for NEC Electronics as defined above 02 11 1 User s Manual U19237EE1VOUMOO 78KOR Say it NEC CAUTION This is a Test and Measurement equipment with possibility to be significantly altered by user through hardware enhancements modifications and or test or application software Thus with respect to Council Directive 89 336 EEC
71. m4 r26 78KOR_Voice c C3 Output E adpcmsp h E common h 8 intrinsics h 8 io78f1166_a0 h l io78f1166_a0_exth Output T 5 M m VoiceDemo The structure of the sample program is shown below Sample Application Sample Sound Data 1 Sound Play Application Beep Play Application Sample Sound Data 2 Sample Sound Data 3 32Kbps Play Sample Sensor Application Sample Sound Data 4 24Kbps Play Sampl Compress Decompress 16Kbps Play Sample Library Supplied as Object Code User s Manual U19237EE1VOUMOO 46 78KOR Say it NEC The flowchart of the 78KOR Sayit VoiceDemo is given below vCPUinitialize Initialize CPU Load DIPSW Beep Play illuminance Sensor Mode mode vBeep_sample vAD main vVoice main Beep Output Main Sensor Main Sound Play Main D Initialize the microcontroller when power is on 2 Depending on the condition of switch SW5 it branches to different functions 1 Mode to beep high low pitched sound repeatedly 2 Mode to output LED repeatedly with reading illuminance sensor data A D input 3 Mode to play sound stored in built in flash memory using PWM or D A output User s Manual U19237EE1VOUMOO 47 78KOR Say it NEC 11 2 1 How to run the sample program The sample program s
72. might happen that the connection to the 78KOR Say it can not be established This be caused by the following two situations Wrong security ID The security ID is required to prevent the FLASH memory of the 78KOR KG3 microcontroller from being read by an unauthorized person The security ID is located in the internal flash memory at addresses 0xC4 0xCD of the 78KOR KG3 microcontroller The IAR C SPY debugger starts only when the security ID that is set during debugger start up and the security ID set at addresses 0 4 to OxCD do match Disabled On Chip debug The On Chip debug function of the 78KOR KG3 microcontroller can be controlled by a dedicated Option Byte located at address 0xC3 in the internal flash memory By disabling the On Chip debug operation no connection to device can be established neither using the TK 78 interface nor using the QB MINI2 On Chip debug emulator In the above mentioned cases it is necessary to erase the internal flash memory of the 78KOR KG3 microcontroller to restore the security ID and to enabled the On Chip debug function User s Manual U19237EE1VOUMOO 43 78KOR Say it NEC In case of a security ID mismatch the following message box is displayed by the IAR C SPY debugger Click the YES button to enter the Hardware Setup menu TK 78 Emulator 9 Could not verify ID Code Press YES to enter new ID Code Pressing NO will end debug session Figure 32 TK 78 enter Ha
73. mount EC0470 01 630 DCVDD dua VDD R3 VDD AVDD 1 USBVDD JP1 VDD JP2 330 1 1 2 2 2 2 3 NF1 R 2 NFM41PC204F1H3 FFC SAMEP1 LED17 Lanm WF poiti2n gt z 4 P 78KOR KG3 Title TK 78KOR KG3 Voice Bize Document Number lev 62 0167A 1 0 Date Thursday January 18 2007 Bheet 1 of 96 EL il Aes 40381 OOWNOALAAZEZELN Enue A 5 195 v6 n soneuieuos j AES H0M8Z R6 D A IN R7 eu 1 2 1 ANO0 1 2 2 Sat 10uF 16V 28 R9 33K LMV324M a 4 AVDD 7 1 ar m aj evap AVDD U2A 5 IN NC R10 cn Rit 4 4 1 2 At 2 C12 1 TO01 33K M 22K 5 GND 10uF 16V HM of 00 n 7 ed AGND AGND AGND V R14 adip 20K of acho C15 c16 n p 2200 AVDD I 2200 AVDD 5555222700 2200 AVDD 1 E ecd 3 LMV324M 49 LMV324M 6 DENEN 2 LMV324M 9 C18 c19 s 7 6 13 8 x 5 i 14 x 10 zn L u 12 17 u2c 1000p
74. nal conversion e Various input output signals available such as ports prepared to be connected to user hardware 9 Timer input output signals Two or three wire serial I O Virtual UART interface via the uPD78F0731 78KO 8 bit microcontroller with on board USB interface 16 analog input lines 2 analog output lines Navigation switch prepared for key interrupt generation The IAR Embedded Workbench for 78K and the IAR C SPY debugger simulator are included These packages are restricted in such that maximum program code size is limited to 16 kByte e Full documentation is included for the NEC 78KOR KG3 microcontroller IAR Systems Embedded Workbench and IAR Systems C SPY debugger simulator 78KOR Say it is not intended for code development NEC does not allow and does not support in any way any attempt to use 78KOR Say it in a commercial or technical product User s Manual 019237 1 00 00 11 78KOR Say it NEC 1 2 System requirements HOST PC A PC supporting Windows 2000 or Windows XP is required for the IAR Systems Embedded Workbench demo version A Pentium processor with atleast 1 GHz CPU performance with at least 256 Mbytes of RAM allowing you to fully utilize and take advantage of the product features 500 Mbytes of free disk space and an additional 10 Mbytes of free disk space on the Windows system drive A web browser and Adobe Acrobat Reader to be able to access all the
75. now What do you want the wizard to do O Install the software automatically Recommended Check that Install from a list or specific is selected Click Next to continue lt Back User s Manual 019237 1 00 00 78KOR Say it NEC 3 Check that Search for the best driver in these locations is selected Select the Include this location in the search check box and then click Browse Figure 19 Search Location Specification 1 Windows XP Found New Hardware Wizard 1 Check that Search for the Please choose your search and installation options best driver these locations Sy is selected Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Include this location in the search 2 Check Include this 1 E location in the search v only Don t search will choose the driver to install Choose this option to select the device driver from a list Windows dog not guarantee that the driver you choose will be the best match for your hardware 3 Click 4 Locate the folder C Program Files IAR Systems Embedded 4 0 78K config nec ie_pc_driver MINICUBE and click Workbench Figure 20 Search Location Specification 2 Windows XP Browse For F
76. older Select the folder that contains drivers for your hardware My Documents 4 My Computer B 31 Floppy A 5 Sw Local Disk C Documents and Settings 5 1386 amp C3 Program Files amp Common Files ComPlus Applications rr Systems 5 Embedded Workbench 4 0 78k bin config devices 3 C nec ie pc driver IECUBE o amp win9x C3 winzooo Click winnt To view any subfolders click a plus sign above Remark Ifthe installation destination folder is changed at the time of IAR Embedded Workbench installation enter new folder 78K config nec ie_pc_driver MINICUBE User s Manual U19237EE1VOUMOO 35 78KOR Say it NEC 5 After the location of the USB driver has been specified click to continue driver installation Figure 21 Search Location Specification 3 Windows XP Found New Hardware Wizard Please choose your search and installation options e S Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed C Search removable media floppy CD ROM Include this location in the search C Program Files I4R Systems Embedded Workben w Don t search will choose the driver to install Choose this option to select
77. on Volume 0 8 U32 size Play data size in byte U8 __far adr Play data start address Return Value Remarks 11 6 13 void vDecode 24k U8 p mode U8 p volume 032 size 08 far Function vDecode 24k Syntax void vDecode 24k U8 p mode U8 p volume U32 size U8 _ far Description Decompress 3 bit compressed data Input Value U8 mode Output mode information PWM mode 0 D A mode 1 U8 p volume Volume information Volume 0 8 U32 size Play data size in byte 08 jfar adr Play data start address Return Value Remarks User s Manual U19237EE1VOUMOO 79 78KOR Say it Function vDecode 16k 11 6 14 void vDecode 16k U8 p mode U8 p volume 032 size 08 far Syntax void vDecode 16k U8 p mode U8 p volume U32 size U8 _ far adr Description Decompress 2 bit compressed data Input Value U8 mode PWM mode D A mode Output mode information 0 1 U8 p volume Volume information Volume U32 size 0 8 Play data size in byte U8 __far adr Play data start address Return Value Remarks Function 11 6 15 void vLoadAdpcmData void vLoadAdpcmData Syntax void vLoadAdpcmbData void Description Extract sound data to sound data information table Input Value Return Value Remarks User s Manual U
78. onductor product operation and application examples The incorporation of these circuits software and information in the design of a customer s equipment shall be done under the full responsibility of the customer NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits software and information While NEC Electronics endeavors to enhance the quality reliability and safety of NEC Electronics products customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely To minimize risks of damage to property or injury including death to persons arising from defects in NEC Electronics products customers must incorporate sufficient safety measures in their design such as redundancy fire containment and anti failure features NEC Electronics products are classified into the following three quality grades Standard Special and Specific The Specific quality grade applies only to NEC Electronics products developed based on a customer designated quality assurance program for a specific application The recommended applications of an NEC Electronics product depend on its quality grade as indicated below Customers must check the quality grade of each NEC Electronics product before using it in a particular application Standard Computers office equipment communications equipment test and measurement equipment audio and v
79. onfirmation NEC Electronics used only the USB cable delivered with the 78KOR Say it board 3 16 Wrap field For the integration of additional application hardware and user circuits the 78KOR Say it board offers a wrap field Please read the user s manual of the 78KOR KG3 device carefully to get information about the electrical specification of the available I O ports before you connect any external signals to the 78KOR Say it board User s Manual U19237EE1VOUMOO 21 78KOR Say it 3 17 T1 T100 test pads Several pins of the 78KOR KG3 microcontroller are connected to the test pads T1 T100 The corresponding assignment can be found in table below Test Pad MADE I JAPAN SAMASPEST ut IJ c 5 8 m iem E 3 lor Ti 7 085 9 G 5 Test Test Pad Figure 6 Test pads T1 T100 User s Manual U19237EE1VOUMOO Test Pad NEC 22 78KOR Say it Table 11 Test pads T1 T100 User s Manual U19237EE1VOUMOO 23 78KOR Say it NEC 4 On Chip debugging The 78KOR Say it board offers two possibilities to use On Chip debugging OCD The TK 78KOR On Board debug function of 78KOR Say it allows On Chip debugging without a need of external debug hardware Within this mode the default USB connection to the Host computer based on the virtual UART driver is used as debug interface
80. ons of variables constants in bundled application program are explained in this section 11 8 1 Adpcm Work 16 Variable Constant Adpcm Work 16 Declaration static 016 Adpcm Work 16 Source File 78KOR Voice c Use Work area for compression decompression library Remarks 11 8 2 output data 2 Variable Constant This should be located in resident area output data 2 Declaration static U16 output data 2 Source File 78KOR Voice c Use Output data buffer Store output data Remarks 11 8 3 output count Variable Constant It outputs output data 0 with the cycle interrupts output count Declaration static U8 output count Source File 78KOR Voice c Use 62 55 output counter This indicates the status of output data buffer Remarks 11 8 4 ucPlaySts Variable Constant ucPlaySts Declaration static U8 ucPlaySts Source File 78KOR Voice c Use Application play status Before Play STATUS STANDBY Playing STATUS PLAY Stop Playing STATUS STOP Break STATUS BREAK Remarks User s Manual U19237EE1VOUMOO 87 78KOR Say it 11 8 5 stop Led Variable Constant stop Led Declaration static U8 stop Led Source File 78KOR Voice c Use LED blinking action when play is stopped Remarks 11 8 6 PlayMode Variable Constant PlayMode
81. or FLMDO RESET IN CLK IN When using PG FP4 for FLASH programming or QB MINI2 for debugging purpose please configure switch SW5 bits1 5 of the 78KOR Say it board as following OFF OFF OFF OFF ON OFF ON Table 9 Configuration of SW5 bits1 5 when using PG FP4 or 2 C1 OO N gt individual selectable by user User s Manual U19237EE1VOUMOO 20 78KOR Say it NEC 3 15 USB1 serial interface connector This interface allows connecting the IAR C SPY debugger to the 78KOR Say it board in order to use the On Board debug function TK 78KOR debugging The TK 78KOR interface supports On board FLASH erasing programming and standard debug features like code execution single stepping breakpoints memory manipulation etc For standard communication to a host computer i e by using a terminal program the input output signals of UART3 of the 78KOR KG3 device can be redirected to the USB1 connector via the uPD78F0731 USB microcontroller The power supply of the 78KOR Say it board is also provided by the USB1 connector ieee ice Figure 5 USB1 USB Mini B Type Host Connector Pin Configuration VBUS D D ID NC GND Table 10 Pin Configuration of Connector USB1 OR IN For connection with the host machine use a USB cable Mini B type For c
82. ound A respectively Sound B when it matches with the corresponding condition Function light sensor mode Descr void vAD main void Inputs oem Outputs Return oS void vAD main void play mode MODE play num 2 play volume 4 readAD i cmp playEndflg_Low 0 playEndflg_High 0 playEnvflg 0 data_type sound_size far adpcmDataAdr Oo OO w CO OO OF OO CO OO OO CO vLoadAdpcmData __enable_interrupt 2 uilntCounterl 0 INT 1MSEC ENABLE while 1 readAD uiADconvert for 1 0 cmp 50 i 8 i cmp 50 if readAD lt cmp vVolumeLED i break if i 8 vVolumeL User s Manual U19237EE1VOUMOO 78KOR Say it The function main reads current data and reflects the data by driving the volume LEDs D Load sound data information from built in memory It is assumed that the sound data this application use are Sound Data areas 1 and 2 2 Enable interrupts that the application does use 3 Use uiADconvert to convert level to voltage value by A D conversion Determine output of volume LED by the value of return value readAD The relationships between the A D conversion value and LED output is shown in the table below A D Conversion Value LED Output _ Conversion V
83. p information file MQB2ALL inf is automatic selected then click Open to proceed within driver installation Figure 13 Address Specification 2 Windows 2000 Locate File Ka x Look in SS MRE emeE Modified 8 MQB2ALL 4KB Setup Information 27 03 2006 11 03 History MQB2SALL 4KB Setup Information 20 10 2006 07 47 8 MQB78K0 4KB Setup Information 27 01 2006 13 48 D k 8 8 05 4KB Setup Information 27 01 2006 13 48 Desktop UN My Documents My Computer 4 File name in My Network P Files of type Setup Information inf Y User s Manual U19237EE1V0UM00 31 78KOR Say it 6 5 After the location of the USB driver has been specified click OK Click Figure 14 Address Specification 3 Windows 2000 to proceed Found New Hardware Wizard C Program Files IAR Systems E mbedded Workbe Next Figure 15 Driver File Search Windows 2000 Found New Hardware Wizard Driver Files Search Results The wizard has finished searching for driver files for your hardware device User s Manual U19237EE1VOUMOO 32 78KOR Say it NEC 6 Click Finish to complete the installation of the USB driver Figure 16 USB Driver Installation Completion Windows 2000 Found New Hardware Wizard Completing the Found New Hardware Wizard 2 NEC Electronics Starter Kit Virtual UART Windows ha
84. rams 11 1 General Introduction Each of the sample programs is located in a single directory which will be called main directory of the sample This main directory of each sample contains the complete project inclusive all output files of the development tool and the workspace file for instance 78KOR_Sayit_VoiceDemo eww All sample programs use the same directory structure 78KOR Sayit DownloadDemo Download sample project 3 78KOR_Sayit_VoiceDemo_Obj Voice sample project C Debug debug output files for IAR C SPY debugger inc C header files Cl lib ADPCM library settings configuration files IAR Embedded Workbench sound Sound files source C source files xcl Linker control file Sayit VoiceSample eww workspace file IAR Embedded Workbench 78KOR Sayit VoiceSample dep dependency information file IAR Embedded Workbench 78KOR 5 VoiceSample ewd project setting file IAR C SPY debugger 78KOR Sayit VoiceSample ewp project file IAR Embedded Workbench Sayit VoiceDemo Src Voice sample project CvVADPCM CvADPOM voice conversion and download tool Sounds Sample waves Table 15 Example directory structure The main directory contains only the project and workspace files for the IAR Systems Embedded Workbench for 78K All source files are located in the directories source and sound The inc directory contains the h
85. rdware Setup Specify the default security ID 1 the default security ID of an erased flash is equal to 10bytes OxFF each and enable the erase flash before next ID check option 2 Then press the button 3 to start flash erasing and to establish the debugging session 1 specify default 78 Hardware Setup for 78 78F1166A0 security ID ID code Time unit FFFFFFFFFFFFFFFFFFFF nsec v Cancel Erase flash before next ID check _ Cancel 3 Click Main clock Sub clock p Default External External _ Dead Iv iv 2 enable erase flash None v MHz None v kHz A Ed s Flash programming Target power off Target connect Permit Permit TOOLO TOOL1 Not Permit Not Permit Pin mask Peripheral break ju TARGET RESET A timer E INTERNAL RESET serial etc e Memory map Start address Length Type 360 Internal ROM m Add 0 00000 Ox3FFFF Internal ROM 256 Kbytes OxFCFOO OxFFEFF Internal RAM 12288 bytes Remove Remove All Figure 33 TK 78 Hardware Setup menu The progress of flash erasing is indicated by blue dots in the TK 78 Emulator window Following the debugger starts downloading the executable to the 78KOR Say it board like shown in figure 28 TK 78 Emulator Erasing flash Figure 34 TK 78 flash erasing User s Manual U19237EE1VOUMOO 44 78KOR Say it NEC 11 Sample prog
86. rkbench IDE File Edit View Project Debug Emulator Tools Window Help Doug amp gt play mode default T gt mode 9 2 gt light sensor mode E 78KOR Sa OQutputs 574 Library Return Eros Ha G Sounds Ree ee See eee Ree a eee te eee F6 78KOR_Voi void main void BF40CF C3 Output us dip_sw CPU initialize eec eai vCPUinitialize 7 8K0R Initialize call each mode dip sw DIPSW DIPSW Read if dip sw MODE DIPSW 7 ON 1 vBeep 1 BEEP else if dip sw MODE AD DIPSW 8 ON FDC312 t EFOC n infis hr 78KOR_Sayit VoiceSample fol pAn iaht canenr T x Log Wed Apr 23 10 10 34 2008 C SPY Processor Descriptor for 78KOR V4 50B Wed Apr 23 10 10 34 2008 C SPY MINICUBE and 78 Emulator Driver for 78K0R V4 50A Kickstart Wed Apr 23 10 10 49 2008 Download complete Wed Apr 23 10 10 48 2008 Loaded debugee J td_v1 SWAStarterkits 78K0R Say itl WorkisampleProgramsY 8K R Sayit VoiceSample ObjDebugYExe 8K0R Sayit VoiceSample d25 Wed Apr 23 10 10 50 2008 Target reset Wed Apr 23 10 10 50 2008 78K0R MINICUBE Executor v1 02 7 OCD Control Code V1 00 B innana ADAM ACCAI le arainn V2 nn 391 Col 9 Figure 31 IAR C SPY debugger 10 Troubleshooting In some cases it
87. rs in its driver database on your computer and in any of the following optional search locations that you specify To start the search click Next If you are searching on a floppy disk or CD ROM drive insert the floppy disk or CD before clicking Next ptional search locations Floppy disk drives CD ROM drives Microsoft Windows Update lt Back Cancel User s Manual U19237EE1VOUMOO 30 78KOR Say it 4 Locate to the folder C Program Files IAR Systems Embedded Workbench 4 0 78K config nec ie_pc_driver MINICUBE Figure 12 Address Specification 1 Windows 2000 2x Locate File Look in MINICLIBE History Desktop History 27 03 2006 11 03 20 10 2006 07 47 27 01 2006 13 48 27 01 2006 13 48 n My Documents My Computer E 29 3 Floppy x 29 Local Disk Desktop Program Files IAR Systems we Embedded Workbench 4 0 My Documents 78k config nec ie pc driver cs Local Disk D Compact Disc E Removable Disk F My Network Places Locate to C Program Files I AR Systems Embedded Workbench 4 0 78K config nec ie_pc_driver MINICUBE ae i My Network P Remark Ifthe installation destination folder is changed at the time of IAR Embedded Workbench installation enter new folder 78K config nec ie_pc_driver MINICUBE 5 setu
88. s 16K Play Process I vDecode 32k vDecode 24k vDecode 16k Initialize parameters that used by application Initialize displays 3 Load sound data information from memory 1 compression bit info of sound data 2 data size 3 data start address Wait until the navigation switch input up down left right push 5 Load sound data information of selected sound 6 Decompression process when compression bit is 4 bit 7 Decompression process when compression bit is 3 bit Decompression process when compression bit is 2 bit User s Manual U19237EE1VOUMOO 49 78KOR Say it NEC As reference the flow of the 32kbps decompression is shown in the chart below vDecode 32k Complete Play NO vKeyMon Play Monitor Key Inputs Playing Sound YES Output buffer is available 1 or 2 output buffer is available Output even times YES 9 Get 1 byte data from Get 1 byte data from current sound data current sound data pointer pointer Higher digits mask Lower digits mask Increment pointer lt i Decode Process adpem 82 9 Output buffer 1 is available Set decompressed data Set decompressed in output buffer 1 in output buffer 1 Set 2 to buffer counter Set 2 to buffer counter CD Monitor key inputs while playing sound 2 It does not start the decompression process i
89. s communication interface between the PC host system and the 78KOR Say it board a standard USB interface line is needed Before you can download and run a program software and hardware must be installed properly 6 1 1 CD ROM contents The CD ROM shows following directory structure NEC 78KOR Say it F CD ROM ROOT C3 Acrobat Acrobat Reader for 32Bit Windows OS Bb tee ee aaa RR Embedded Workbench Tor 78K SamplePrograms Sample programs for 78KOR Say it including o 78 Say it Voice Samples o 78KOR Say it Download Sample o CvADPCM conversion download Tool o Sound Wave samples Table 14 78KOR Say it CD ROM directory structure User s Manual U19237EE1VOUMOO 27 78KOR Say it NEC 7 Hardware installation After unpacking 78KOR Say it connect the board to your host computer using the provided USB interface cable When 78KOR Say it is connected the USB driver needs to be installed on the host machine Please refer to the following CHAPTER 8 SOFTWARE INSTALLATION 8 Software installation The 78KOR Say it package comes with the following software demo packages e IAR Systems Embedded Workbench for 78K including C compiler assembler linker librarian and IAR C SPY debugger simulator Sample programs The IAR Systems Embedded Workbench must be installed on your PC For detailed installation hints refer to the following chapters and
90. s finished installing the software for this device To close this wizard click Finish lt Back i Cancel User s Manual 019237 1 00 00 33 78KOR Say it NEC 8 3 2 Installation on Windows XP 1 When the 78K0H Say it board is connected with the host machine the board is recognized by Plug and Play and the wizard for finding new hardware is started At first the hardware wizard will ask if windows should search on the windows update web check No not this time and then click Next gt Figure 17 Found New Hardware Wizard 1 Windows XP Found New Hardware Wizard Welcome to the Found New Hardware Wizard Windows will search for current and updated software by looking on your computer on the hardware installation CD or on the Windows Update Web site with your permission Read our privacy policy Check that No not this time is selected Can Windows connect to Windows Update to search for software O Yes this time only Yes now and every time connect a device Click Next to continue Cancel 2 Check that Install from a list or specific location Advanced is selected then click Next Figure 18 Found New Hardware Wizard 2 Windows XP Found New Hardware Wizard This wizard helps you install software for USB Device If your hardware came with an installation CD or floppy disk insert it
91. structure enne 27 Table 15 Example directory structure 4 a uA KATANA PaF essen nennen RA KAE ARA kia TAKET EAA nnns 45 User s Manual U19237EE1VOUMOO 10 78KOR Say it NEC 1 Introduction 78KOR Say it is a demonstration kit for the NEC 78KOR 16 bit microcontroller family It allows the development of an sound system based on the 78KOR KG3 device It supports onboard debugging and real time execution of application programs The board is prepared to be connected to user hardware parts such as digital I O or analog signals 1 1 Main features of 78KOR Say it e Easy to use device demonstration capabilities 78KOR Say it contains elements to easily demonstrate simple l O functions i e navigator switch a photo IC illuminance sensor I O lines analog inputs and outputs UART serial interface etc On Board debug function TK 78KOR debugging The 78KOR Say it supports an On Board debug function by using the IAR C SPY debugger without a need of additional debug hardware It allows FLASH downloading and standard debug functions like code execution single stepping breakpoints memory manipulation etc e Audio parts The 78KOR Say it provides an audio filter amplifier onboard speaker and additional a loudspeaker connector to build up sound systems based on the 78KOR KG3 device e Power supply by USB interface e Analog to digital signal conversion e Digital to analog sig
92. the device driver from a list Windows does not guarantee that the driver you choose will be the best match for your hardware lt Back Cancel 6 As shown below NEC Electronics Starter Kit Virtual UART has not passed Windows Logo testing to verify its compatibility with Windows XP is displayed Click Continue Anyway Figure 22 Windows XP Logo Testing Windows XP Hardware Installation The software you are installing for this hardware NEC Electronics Starter Kit Virtual UART has not passed Windows Logo testing to verify its compatibility with Windows XP Tell me why this testing is important Continuing your installation of this software may impair or destabilize the correct operation of your system either immediately or in the future Microsoft strongly recommends that you stop this installation now and contact the hardware vendor for software that has passed Windows Logo testing Continue Anyway STOP Installation User s Manual 019237 1 00 00 78KOR Say it 7 After the installation of the USB driver is completed the window below is displayed Click Finish to close the hardware wizard Figure 23 USB Driver Installation Completion Windows XP Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for 7 NEC Electronics Starter Kit Virtual UART Click Finish to close the wizard
93. unds User s Manual U19237EE1VOUMOO 68 78KOR Say it NEC 11 5 6 Sound Output Process 62 5ys Interrupt Those output data from decompression process is outputted by D A or PWM with the 62 5us Interrupt cycle void vINTTM04_hdr void if output_count 0 if PlayMode MODE TDRO1 Ul6 output data 0 if PlayMode DA MODE DACSO 08 output_data 0 output count if output count 2 output_data 0 output_data 1 D Check if there is decompressed data ready to output 2 Output by PWM or D A depending on the output mode Transfer play data to buffer Play data buffer in decode process interrupt process is shown in following chart User s Manual U19237EE1VOUMOO 69 78KOR Say it NEC Kee 62 5us Process Play Main Process Both BUF 1 and 2 eS BUF 2are in Use Pd Buffer Available Decode Data set process Data in Buffer A Delete data Dorem inBUF2 BUF 2 Set Set 2 ana BUFONT 24 i j BUF CNT 542 o BUF 1 Data Out BUF 1 is Available become 2 ata Output Buffer in Use Application Process No Data in Buffer Out of Play Cycle Transfer Data in Buffer Output Buffer Decrement BUF CNT after Output BUF1 1 PCM Data Before Output After Output 1 Data No
94. upports the following three modes e Sound Play Mode Within this mode the 78KOR Say it board plays one of four sounds The selection of the corresponding sound data to be played can be done by the navigation switch SW 1 e luminance Sensor Mode By using this mode the light radiation is determined via the A D converter by measuring the output voltage of the onboard illuminance sensor The light radiation is displayed by the VOLUME LEDs Additionally pending on the light radiation the speech data It got dark or It got light is played by driving the onboard loudspeaker e Beep Play Mode This simple demo outputs alternately a high pitched silent and low pitched beep sound by driving the loudspeaker 11 2 2 Sound Play Function This sample application plays a selected sound from a set of four different sound data To run this function please set switch SW5 bits6 8 to OFF Depending on if you want to run the sample within stand alone mode or if you want to use On Board debugging please set the bits1 5 of configuration switch SW5 accordingly 1 2 3 4 s 6 7 8 OFF 0 0 0 OFF OFF OFF When using TK 78KOR On Board debugging ON OFF When using stand alone normal mode OFF ON The sound play sample can be controlled by the navigation switch SW1 The functionality of the navigation switch is a following Left This selects the wave output via PWM or D A Th
95. version data Sample illuminance sensor data It samples 64 times and calculates the average value Again it samples 64 times and calculates the average value This loop process uses about 55ms During this time it rounds the value from illuminance sensor about 5 times 4 Stop the A D conversion The statement addata addata gt gt 6 6 is the shifting process of the average data of 64 times sampling 10 bit A D User s Manual U19237EE1VOUMOO 75 78KOR Say it NEC 11 6 Function Specifications The specifications of functions in bundled application program are explained in this section 11 6 1 void main void Function main Syntax void main void Description Application Main Process Get the status of DIPSW and branch to appropriate process after initializing CPU Input Value Return Value Remarks 11 6 2 void vVoice main void Function vVoice main Syntax void vVoice main void Description Sound Play Application Main Process Input Value Return Value Remarks 11 6 3 void vCPUinitialize void Function vCPUinitialize Syntax void vCPUinitialize void Description Initialize CPU Input Value Return Value Remarks 11 6 4 void vPlayPrmlnitialize void Function vPlayPrminitialize Syntax void vPlayPrminitialize void Description Initialize information table used by application
96. where to place the different sections of code data and constants that may be used within the demo project Options for node 7 Sayit VoiceSsample Category Factory Settings General Options Compiler Output Extra Output define Diagnostics List Contig Proce He Assembler Linker command file Custom Build T NInk78f1166 adpomsp scl E Debugger IE 78 IECUBE Override default program entry MINICUBE Simulator gt 78 Search paths one per line TOOLKIT DIRSALIBN Raw binary image File Symbol Segment Align mj OK Cancel Figure 28 IAR Linker options Now after everything has been setup correctly it s time to compile and link the demonstration project Close the Options menu and select Rebuild from the Project menu If the project is compiled and linked without errors or warnings it can now be downloaded to the 78KOR Say it board and debugged To start the IAR C SPY debugger select the option Debug from the Project menu or press the 3 Debugger button In the next step the TK 78 Emulator has to be configured before downloading a new application Press the OK button to enter the emulator hardware setup Set the configuration as show in the figure below and start the download by pressing the OK button 78 Hardware Setup for 78 78F1166A0 ID code Time unit OK FFFFFFFFFFFFFFFFFFF nec v Eug Canc
97. will be erased before programming the sample project and the sound data gets lost User s Manual 1 19237 1 00 00 57 78KOR Say it NEC 11 4 78 Sayit DownloadDemo sample program This sample application allows you to download and modify the four different sound data areas by using the CvADPOM tool Additionally it offers the same sound play function like the 78KOR Sayit VoiceDemo CvADPOM tool uses the USB interface and the UARTS of the 78KOR KG3 device for communication Consequently the TK 78KOR On Board debugging function can not be used by running the 78KOR_Sayit_DownloadDemo program The 78KOR Say it starterkit comes with this sample program as default configuration The 78 Sayit DownloadDemo is provided as HEX file only Please note by using the download sample the sound data size for each sound data area is limited to 32kByte To run this sample program please set switch SW5 to the following configuration 1 2 3 4 5 6 7 8 OFF OFF OFF ON ON ON The download sample can be controlled by the navigation switch SW1 The functionality of the navigation switch is a following Left No function UP Down_ No function Center Push This starts the download process The 78KOR Say it waits for data to be transferred from the host PC controller by the CvADPCM tool Right This selects the sound data area that should be modified The SOUND
98. with USB cable PLAY LED start blinking 2 Preparation of the application Select the data area by shifting the navigation switch to the RIGHT direction then press the navigation switch The selected sound data area is indicated by the SOUND LED After the navigation switch has been pressed all VOLUME LED start lighting then the number of driven LED reduces depending of the FLASH erase progress 3 Download sound data Start downloading by selecting the sound data with the CvADPCM tool Caution Following compression format can be used ADPCM SP 4bit Sample ADPCM SP 3bit Sample ADPCM SP 2bit Sample For operation of CVADPCM tool refer to Audio Data Conversion Tool CVADPCM User s Manual You can find sample WAVE data in SampleProgram folder directory SamplePrograms Sounds 4 Start download During downloading the PWM LED and the D A LED start blinking alternately and the lights of VOLUME LED increases depending on the download progress When the download is completed all VOLUME LED are lighted and PLAY LED starts blinking f you wish to continue downloading repeat from step 2 5 Play downloaded sound data Set configuration switch SW5 bits6 7 8 to OFF and reset the board by pressing the reset button SW6 1 2 4 5 6 7 B OFF OFF OFF OFF OFF OFF The sound play application starts Select the sound data and play it User s Manual 1 719237

Download Pdf Manuals

image

Related Search

Related Contents

InFocus LP 540 User's Manual  Cisco Systems InfiniBand SFS 7000 Getting Started Guide  「DVD-V8000」取扱説明書 (ファームウェアVer.1.006  Venus Series User Manual  

Copyright © All rights reserved.
Failed to retrieve file