0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
API4000M8

API4000M8

  • 厂商:

    APLUS

  • 封装:

  • 描述:

    API4000M8 - 4-channel Sound Generator with Melody - Aplus Intergrated Circuits

  • 数据手册
  • 价格&库存
API4000M8 数据手册
INTEGRATED CIRCUITS INC. GENERAL DESCRIPTION SERIES VOICE OTP MODULE API4000M API4000M is a 4-channel Sound Generator which consists of Melody-Controller and Micro-Controller. API4000M can directly drive Speaker by the Power Amplifier inside, It has 12 I/O Ports connect with other units. API4000M give 24Bit parallel Address Bus and 8Bit parallel Data Bus for connecting with the Memory from outside, it can process data maximum 128M bits, it commendatory apply to the product which use high quality voice and music synthesizer. FEATURE *. 4-channel Sound Generator with Melody *. VCC = 2.7V ~ 5V *. 4bit ADPCM *. 24bit Address Bus, 8bit Data Bus *. 42 Instruction Set *. 12 Input/Output Data Port *. Built-In Power Amplifier PART NO. VOICE DURATIONS API4000M2 API4000M4 API4000M8 22 min. 44 min. 88 min. 25mm 42mm 1 Ver1.1 INTEGRATED CIRCUITS INC. ABSOLUTE MAXIMUM RATING Supply Voltage ( VDD to GND ) Input Voltage Range Operating Temperature Range ---------------------------------------------------5V SERIES VOICE OTP MODULE API4000M (GND- 0.3V) to (VDD + 0.3V) 0℃ to +60℃ ELECTRICAL CHARACTERISTICS ( VDD=4.5V , GND=0V ,Ta=+25℃ , unless otherwise noted ) PARAMETER Standby Current Operating Current Input low voltage Input high voltage output low voltage output high voltage CONDITIONS Chip Shut Down Sound On 8 ohm Speaker Input Pins exclude AmpIn Input Pins exclude AmpIn Iout = -0.1mA for Output Pins Iout = 0.1mA for Output Pins 3.8 3.2 0.5 50 0.8 MIN TYP MAX UNITS 10 uA mA V V V V PIN DESCRIPTION NO 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Pin Name VDDD VDDA GNDD GNDA AMPOUT AMPIN OSC1 OSC2 PI3 PI2 ~ PI0 PIO3 ~ PIO0 PO3 ~ PO0 CEN OEN D7 ~ D0 A23 ~ A0 Description Digital Positive Power Supply Analog Positive Power Supply Digital Negative Power Supply Analog Negative Power Supply Power Amplifier Output Power Amplifier Input Oscillator Input Oscillator Output Data Input Pin Data Input/Output Pins Data Input/Output Pins Data Output Pins Memory Chip Enable Pin , Low Active Memory Data Out Enable Pin , Low Active Memory Data Input Pins Memory Address Output Pins 2 Ver1.1 INTEGRATED CIRCUITS INC. Functional Description A. Micro–Controller SERIES VOICE OTP MODULE API4000M The Micro-Controller inside API4000M is a 8Bit Processor, it has 2 groups Data Bank each has 16 X 8 Bit Register, the Function for processing Data: Addition , Subtraction , logical AND , Moving , Shift and the other Basic Function. It also has Address Jump , Data Input , Data Output , Sound Control , Melod yControl and the other Advanced Function. Here is the list of 42 instruction in API4000M, each instruction has its Format and Description. 1. JUMP Instruction Format JUMP INTR1, Pn ﹔ JUMP JUMP JUMP JUMP JUMP JUMP PS : (1). Code : Code of instruction. (2). Cycle : Time to executive instruction, 1Cycle = 64 clock period. (3). Bytes : Size of instruction, 1 Byte = 8 Bits. (4). Pn ﹕Address in Program, e.g. P123;n = 0 ~ 9999. (5). INTR1 ﹕Key In signal. (6). INTR2 ﹕Song End signal. (7). INTR3 ﹕Sound End signal. (8). INTR4 ﹕Change Instrument signal. INTR2, Pn ﹔ INTR3, Pn ﹔ INTR4, Pn ﹔ ADDR, Pn ﹔ CO0, Pn ﹔ CO1, Pn ﹔ Code 01 02 03 04 05 06 07 Cycle 2 2 2 2 2 2 2 Bytes 3 3 3 3 3 3 3 Instruction Description if INTR1 = 1, Program Address(PC) will jump to Pn. if INTR2 = 1, Program Address (PC)will jump to Pn. if INTR3 = 1, Program Address (PC)will jump to Pn. if INTR4 = 1, Program Address(PC) will jump to Pn. Program Address(PC) direct jump to Pn. if carry out = 0,Program Address(PC) will jump to Pn. if carry out = 1,Program Address(PC) will jump to Pn. 2. Register & Data Instruction Format ADDC ADDD ANDD MOVD SUBDC SUBD PS : (1). Rn ﹕Number of Register,e.g. R3;n = 0 ~ 15. (2). Data ﹕a decimal value during 0 ~ 255. Rn, Data ﹔ Rn, Data ﹔ Rn, Data ﹔ Rn, Data ﹔ Rn, Data ﹔ Rn, Data ﹔ Code 6n 7n 4n 5n En Fn Cycle 1 1 1 1 1 1 Bytes 2 2 2 2 2 2 Instruction Description The value of Rn adds Data,only set Carry but don’t change the value of Rn. ( Rn + Data C=?) Rn Rn + Data The value of Rn logical AND Data,set the solution to Rn. ( Rn Rn AND Data) set Rn Data. The value of Rn subduct Data, only return Carry but don’t change the value of Rn.(Rn-Data C?) Rn Rn - Data 3 Ver1.1 INTEGRATED CIRCUITS INC. 3. Single Register Operation Instruction Format SHIFTL SHIFTR DEC INC Rn ﹔ Rn ﹔ Rn ﹔ Rn ﹔ Code 2n 3n An Bn Cycle 1 1 1 1 Bytes 1 1 1 1 SERIES VOICE OTP MODULE API4000M Instruction Description Each Bit of Rn Shift to left Bit,shift 0 to D0. i.e. D7←D6←D5←D4←D3←D2←D1←D0←0. Each Bit of Rn Shift to right Bit,shift 0 to D7. i.e. 0→D7→D6→D5→D4→D3→D2→D1→D0. The value of Rn subduct 1,set the solution to Rn. (Rn Rn-1) The value of Rn add 1,set the solution to Rn.(Rn Rn+1) 4. Operation between two Registers Instruction Format ADDR Rn, Rm ﹔ ADDRI ADDRC SUBR SUBRI SUBRC ANDR MOVR Rn, Rm ﹔ Rn, Rm ﹔ Rn, Rm ﹔ Rn, Rm ﹔ Rn, Rm ﹔ Rn, Rm ﹔ Rn, Rm ﹔ Code D0 D1 D2 D4 D5 D6 D8 D9 Cycle 2 2 2 2 2 2 2 2 Bytes 2 2 2 2 2 2 2 2 Instruction Description Rn add Rm, set the amount to Rn..(Rn, Rn add Rm and Carry, set the amount to Rn. (Rn Rn+Rm) Rn+Rm+C) Rn add Rm, only set Carry but don’t change the value of Rn and Rm. (Rn+Rm C?) Rn subduct Rm, set the difference to Rn. (Rn, Rn-Rm) Rn subduct Rm and Carry, set the difference to Rn. (Rn Rn-Rm-C) Rn subduct Rm, only set Carry but don’t change the value of Rn and Rm. (Rn-Rm C?) Rn logical AND Rm, set the solution to Rn. (Rn Rn AND Rm) Set the value of Rm to Rn. ( Rn Rm) 5. Sound & Melody Control Instruction Format LDSPADB Cn, Sn ﹔ LDSPADF LDMYAD PLAYSP GAIN PS : (1). Cn ﹕Code of Channel, n = 1A , 1B , 2A , 2B , 3A , 3B , 4A , 4B. (2). Sn ﹕Code of Sound,sort by sequence,n = 0 ~ 9999. (3). Mn ﹕Code of Melody Song, sort by sequence n = 0 ~ 9999. (4). Data : Code of Sound Sample Rate, the value is during 0 ~ 31, reference B.Sound Processor to get more description. (5). Reference C. Melody Processor to get more description of Tempo Code. (6). Volume is during 0 ~ 63,0 is mute,63 is MAX volume. TEMPO Cn, Sn ﹔ Mn ﹔ Rn ﹔ Rn ﹔ Cn, Data ﹔ Code 1n 9n CF CE 8E 8F Cycle 2 2 2 2 1 1 Bytes 4 4 4 3 2 2 Instruction Description Set the start address of Sound. Set the end address of Sound. Set the start address of Melody. Play Sound(PS4). Set Rn to Tempo value of Melody (PS5). Set Rn to the volume of output sound (PS6). 4 Ver1.1 INTEGRATED CIRCUITS INC. 6. Input & Output Data Instruction Format INPUT PA, Rn ﹔ INPUT INPUT OUT OUT OUT OUT OUT PS : PB, Rn ﹔ PC, Rn ﹔ PA, Rn ﹔ PB, Rn ﹔ PC, Rn ﹔ PD, Rn ﹔ PE, Rn ﹔ Code 80 81 82 88 89 8A 8B 8C Cycle 1 1 1 1 1 1 1 1 Bytes 2 2 2 2 2 2 2 2 SERIES VOICE OTP MODULE API4000M Instruction Description Set Data Port A to Rn.( Rn Set Data Port B to Rn. ( Rn Set Data Port C to Rn. ( Rn PA) PB) PC) Rn) Rn) Rn) Rn) Rn) Set the value of Rn to Data Port A. (PA Set the value of Rn to Data Port B. (PB Set the value of Rn to Data Port C. (PC Set the value of Rn to Data Port D. (PD Set the value of Rn to Data Port E. (PE (1). PA , PB , PC , PD , PE is Data Port A , B, C, D, E, Reference D. Data Port to get more description. 7. System Control Instruction Format CLINTR ﹔ INTRE ﹔ SHUTDN ﹔ Code C8 C9 CA Cycle 1 1 1 Bytes 1 1 1 Instruction Description Clear Interrupt Signal Make system can receive interrupt signal. System shutdown. PS : (1). Before executiving SHUTDN Instruction, be sure to executive INTRE Instruction first to assure system can be restarted after shutdown. B. Sound Processor Sound Processor of API4000M use 4 bits ADPCM construction, it has 4 Sound Channel can play music mixed by 4 different type sound.Sample Rate of Sound is during 4KHz ~ 32Khz, each Channel can has different Sample Rate.Each Channel has 2 group Address Register for Sound Data, each group Address Register has a Start Address Register and a End Address Register for Sound Data. Each Sound Channel can be Controlled by Instruction PLAYSP, or Controlled by Melody Processor.Before Play Sound, Address of Sound Data must be set first. The following is the description about setting with Channel, Address, and Sample Rate. 1. Channel : Cn is the no. of Channel in Instruction LDSPADB, LDSPADF, and PLAYSP. Each Channel has A and B 2 group, A and B can’t play together. The folloeing is the Table. Table B.1 Channel Group Cn A C1A CH1 B C1B A C2A CH2 B C2B A C3A CH3 B C3B A C4A CH4 B C4B 5 Ver1.1 INTEGRATED CIRCUITS INC. SERIES VOICE OTP MODULE API4000M 2. Address : Sn is the no. of Sound in Instruction LDSPADB and LDSPADF, which is mean the Start Address and End Address of Memory Sound Data. When Sound is Coding, compiler (API4000SE) will define Address of each Sound, the Address can be used when program is compiling. If you want to set Address of Sound, just choice the no. of Sound. 3. Sample Rate : Data in Instruction PLAYSP is mean Code of Sample Rate, each code is equivalent a Sample Rate. There is 32 type Sample Rate during 4KHz to 32KHz, there is a C.2 Pitch Table in C.Melody Processor. 4. e.g.﹕ LDSPADB C1A , S9 ; LDSPADF C1A , S9 ; PLAYSP C1A , 19 ; LDSPADB C2B , S21 ; LDSPADF C2B , S21 ; PLAYSP C2B , 19 ; LDSPADB C3A , S123 ; LDSPADF C3A , S123 ; PLAYSP C3A , 0 ; LDSPADB C4B , S888 ; LDSPADF C4B , S888 ; PLAYSP C4B , 0 ; /* Set CH1A to Start Address of Sound9 */ /* Set CH1A to End Address of Sound9 */ /* Play Sound9 on CH1, Sample Rate is 16KHz */ /* Set CH2B to Start Address of Sound21 */ /* Set CH2B to End Address of Sound21 */ /* Play Sound21 on CH2,Sample Rate is 16KHz */ /* Set CH3A to Start Address of Sound123 */ /* Set CH3A to End Address of Sound123 */ /* Play Sound123 on CH3, Sample Rate is 4KHz */ /* Set CH4B to Start Address of Sound888 */ /* Set CH4B to End Address of Sound888 */ /* Play Sound888 on CH4, Sample Rate is 4KHz */ C. Melody Processor Melody Processor inside API4000M use Wave Table construction to simulate the tone from musical instrument, It can coinstantaneous play 4 Channel. Each Channel has 2 banks Wave Table, A group is reference Address of treble tone, B group is reference Address of bass tone. treble tone range is during B3(71) ~ B4(83), reference value is B3(71); bass tone range is during E1(40) ~ A#3(70), reference value is A#2(58). Each Melody Note Data is in 2 byte form, 1st byte consists of 5bits Beat Data, 2bits Channel Data, and 1 bit Control Data, 2nd byte consists of 5bits Pitch Data, 1 bit Bank Data, and 2bits Control Data. Melody Processor can processor 32 type Beats, There is a Beat Table on Table C.1. All processible Pitch range is during E1(40) ~ B4(83), total 36 type Note, Table C.2 is a list about Pitch Data, Note, and Sample Rate. Tempo of Melody is set by Function TEMPO Rn, the value of Rn is from Code value of Tempo, Table C.3 is about their reference. Instruction LDMYAD Mn is used to set Start Address of Melody Data in Memory, Mn is the Code of Melody, As Melody compiling, compiler(API4000ME) will define Data Address of each Melody, Data Address can be use in coding. You can use Melody Code to set Address of Melody. Melody’s playing is controlled by Instruction OUT PE, Rn, There is description about how to control in D.Input & Output Data. Melody’s change instrument and end signal is defined in Melody Data, it will active 2 interrupt signal “Change Instrument” and “Song End”, if program detects such signal, it will do correspondent action. 6 Ver1.1 INTEGRATED CIRCUITS INC. C.1 Beat Table : NO. Beats/sec 0 1 2 3 4 5 6 7 C.2 Pitch Table : Pitch Code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 PS : Note Bank B — E1 F1 F#1 G1 G#1 A1 A#1 B1 C2 C#2 D2 D#2 E2 F2 F#2 Fs (KHz) 4.0 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.1 10.7 11.3 12.0 12.7 Pitch Code 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1/16 2/16 3/16 4/16 5/16 6/16 7/16 8/16 NO. 8 9 10 11 12 13 14 15 Beats/sec 9/16 10/16 11/16 12/16 13/16 14/16 15/16 16/16 NO. 16 17 18 19 20 21 22 23 SERIES VOICE OTP MODULE Beats/sec 18/16 20/16 22/16 24/16 26/16 28/16 30/16 32/16 NO. 24 25 26 27 28 29 30 31 Beats/sec 36/16 40/16 44/16 48/16 52/16 56/16 60/16 64/16 API4000M Note Bank B G2 G#2 A2 A#2 B2 C3 C#3 D3 D#3 E3 F3 F#3 G3 G#3 A3 A#3 Bank A — — — B3 C4 C#4 D4 D#4 E4 F4 F#4 G4 G#4 A4 A#4 B4 Fs (KHz) 13.5 14.3 15.1 16.0 17.0 18.0 19.1 20.2 21.4 22.7 24.0 25.4 27. 0 28.6 30.3 32.0 (1). Pitch Code : 21 , Note number of C3 = 60. (2). Bank A : treble tone; Bank B : bass tone. (3). Fs : Sample Rate when Oscillator Frequency of API4000M is 2816KHz. C.3 Tempo Table Tempo Code 234 234 224 233 217 232 206 231 198 230 191 229 184 228 177 227 172 226 166 225 161 224 156 223 Tempo 152 147 143 139 135 132 129 126 123 120 117 114 Code 222 221 220 219 218 217 216 215 214 213 212 211 Tempo 112 110 107 105 103 101 99 95 89 86 80 74 Code 210 209 208 207 206 205 204 202 198 196 192 186 Tempo 68 64 60 57 53 51 47 43 40 30 Code 180 176 170 166 158 154 146 136 126 86 PS : (1). The value of Tempo when Oscillator Frequency of API4000M is 2816KHz. 7 Ver1.1 INTEGRATED CIRCUITS INC. D. Input & Output Data SERIES VOICE OTP MODULE API4000M By the 2 Instruction INPUT and OUTPUT, Data can pass inside API4000M, or connect with outside. The following is the description about each Data Port’s act. 1. Input Data Port (1) PA ﹕Input Data Port A is a value consists of Input Pin PIO3 ~ PIO0 and PI3 ~ PI0, Following is their correspondent. PA bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 Input Pin PIO3 PIO2 PIO1 PIO0 PI3 PI2 PI1 PI0 PS ﹕If PIO3 ~ PIO0 or PI2 ~ PI0 are set to Out Pin, bit7 ~ bit4 or bit2 ~ bit0 will be Unknown State. (2) PB ﹕Input Data Port B can make Melody change Channel code of instrument and Instrument Code, Each bit of PB has following act. PB Item PS ﹕ (1). Inst4~Inst0 ﹕Code of Instrument, 0 ~ 31 total 32 type, set as Melody Compiling. (2). C1,C0 ﹕Code of Channel﹔ C1=1,C0=1 is CH1 ﹔ C1=0,C0=0 is CH2 ﹔ C1=0,C0=1 is CH3 ﹔ C1=1,C0=0 is CH4 ﹔ bit7 bit6 C1 bit5 C0 bit4 Inst4 bit3 Inst3 bit2 Inst2 bit1 Inst1 bit0 Inst0 (3) PC ﹕Input Data Port C is display End State of each channel, each pin of PC has following act. PC PS ﹕ bit7 Bit6 bit5 bit4 bit3 bit2 bit1 bit0 Item Sn4 Sn3 Sn2 Sn1 (1). Sn4 , Sn3 , Sn2 and Sn1 displayed Channel CH4 , CH3 , CH2 and CH1 if had happen Sound End, state 1 means Soind End. 2. Output Data Port (1) PA ﹕Output Data Port A consists of Output Pin PIO3 ~ PIO0 and PO3 ~ PO0, each bit of PA after API4000M power on, the initial state is 0, each pin of PA has following act. PA bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 PO0 Output Pin PIO3 PIO2 PIO1 PIO0 PO3 PO2 PO1 PS ﹕If PIO3 ~ PIO0 are set to Input Pin, bit7 ~ bit4 will not affect PIO3 ~ PIO0 of state. 8 Ver1.1 INTEGRATED CIRCUITS INC. SERIES VOICE OTP MODULE API4000M (2) PB ﹕Output Data Port B consists of Output Pin PI2 ~ PI0, each pin of PB has following act. PB bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 Output Pin PI2 PI1 PI0 PS ﹕If PI2 ~ PI0 are set to Input Pin, bit2 ~ bit0 will not affect PI2 ~ PI0 of state. (3) PC ﹕Output Data Port C can set Each Pin’s act of PIO3 ~ PIO0, Following is their correspondent. bit7 0 0 1 1 Bit3 0 0 1 bit6 0 1 0 1 bit2 0 1 0 PIO3 Pull-low Input Pin, no input trigger. Pull-low Input Pin, with input trigger. Floating Input Pin, no input trigger. Output Pin. PIO1 Pull-low Input Pin, no input trigger. Pull-low Input Pin, with input trigger. Floating Input Pin, no input trigger. bit5 bit4 0 0 1 1 0 1 0 1 PIO2 Pull-low Input Pin, no input trigger. Pull-low Input Pin, with input trigger. Floating Input Pin, no input trigger. Output Pin. PIO0 Pull-low Input Pin, no input trigger. Pull-low Input Pin, with input trigger. Floating Input Pin, no input trigger. Output Pin. bit1 bit0 0 0 1 0 1 0 1 1 1 Output Pin. 1 PS ﹕Each bit of PC after API4000M power on, initial state is 0. (4) PD ﹕Output Data Port D can choice Data Bank, set Operate Voltage, set each pin of PO3 ~ PO0 and PI3 ~ PI0 function, following is their correspondent. (a) (b) (c) (d) (e) (f) (g) bit7 not use, bit6 must set to 0. bit5 = 0, Operate Voltage is 4.5V﹔bit5 =1, Operate Voltage is 3.0V. bit4 = 0, disable PO3 ~ PO0 each Pin’s output﹔bit4 = 1, enable PO3 ~ PO0 each Pin’s output. bit3 = 0, set PI2 ~ PI0 to Input Pin ﹔bit3 = 1, set PI2 ~ PI0 to Output Pin. bit2 = 0 set PI3 to Pull-low Input Pin ﹔bit2 = 1 set PI3 to Floating Input Pin. bit1 = 0 set PI2 ~ PI0 to Pull-low Pin ﹔bit1 = 1 set PI2 ~ PI0 to Floating Pin. bit0 = 0 set Data Bank to group A of 16 registers ﹔bit0 = 1 set Data Bank to group B of 16 registers. (h) Each bit of PD after API4000M power on, initial state is 0. (5) PE ﹕Output Data Port E can set Sound and Melody’s operate mode, the following is description. (a) bit7 must set 0. (b) bit6 = 0, Sound Processor Off ﹔bit6 = 1, Sound Processor On. (c) bit5 = 0, Melody Off ﹔bit5 = 1, Melody Start and On. (d) bit4 = 0,no action ﹔bit4 = 1,Off Melody Channels. (e) bit3 = 0, CH4 is Sound Mode ﹔bit3 = 1, CH4 is Melody Mode. (f) bit2 = 0, CH3 is Sound Mode ﹔bit2 = 1, CH3 is Melody Mode. (g) bit1 = 0, CH2 is Sound Mode ﹔bit1 = 1, CH2 is Melody Mode. (h) bit0 = 0, CH1 is Sound Mode ﹔bit0 = 1, CH1 is Melody Mode. (i) After API4000M shut down, Each bit of PE will reset to 0. 9 Ver1.1 INTEGRATED CIRCUITS INC. E. Memory Data Structure SERIES VOICE OTP MODULE API4000M Program Data, Melody Data, Sound Data of API4000M all input from outside, Each group Data are 8 bits, Input from 8 Memory Data Input Port D7 ~ D0. API4000M can direct control 24bits Memory Address, output from 24 Memory Address Output Port A23 ~ A0. Data in Memory is in order of Program Data, Melody Data, Sound Data. Program Data’s Start Address is 000000, Max. Address is 00FFFF, Program Data has max. 64K Bytes. Melody Data’s Start Address is continue from Program Data’s End Address, Sound Data’s Start Address is continue from Melody Data’s End Address, Highest Address is FFFFFF. PROGRAM GUID API4000M is controlled by Program to Play Sound or Play Melody, this chapter will descript how to write a Program. A. Initial State After API4000M Power On, or wake up again after Shut Down, Program Data Address of API4000M is set on Address 000000. You can use instruction OUTPC, OUTPD in the program’s first to set Pin act of PI3 ~ PI0, PIO3 ~ PIO0, and PO3 ~ PO0. Every register in Data Bank after Power On has random initial value, but Shut Down won’t change the value. B. Play Sound Before Playing Sound, Start Address and End Address of Sound Data which would be played must set on the Channel want Play Sound. Use Instruction LDSPADB and LDSPADF set Address of Sound Data. Otherwise, the Channel must be set to Sound Mode by Data Port PE, Sound Processor must be set on, and use Instruction CLINTR to clear residual INTR3 interrupt signal . Then use Instruction PLAYSP to begin playing sound, use INTR3 to detect interrupt signal, and use Instruction INPUT PC to detect the Sound had play over or not. The channel who doesn’t play sound must be set to Melody Mode in Data Port PE, avoid mistake Sound End interrupt signal; exercise Instruction CLINTR, or set Sound Processor to OFF, will clear interrupt signal INTR3. C. Play Melody Before Play Melody, except set Sound Data Address to decide instrument, Address of Melody Data also must be set by Instruction LDMYAD, and set value of Melody Tempo, then use Instruction OUT PE set the channel would play to Melody Mode, set Sound Processor ON, trigger to play Melody. When Melody playing, if the interrupt signal INTR4(Change Instrument) be detected, use Instruction INPUT PB to decision which channel need change instrument, reset trible/bass tone reference Sound Data Address of the channel directly. Melody play over will send a interrupt signal INTR2(Song End), If you want pause or stop play Melody play, use Instruction OUT PE to set Melody to OFF. 10 Ver1.1 INTEGRATED CIRCUITS INC. D. External Interface SERIES VOICE OTP MODULE API4000M PI3 ~ PI0 , PIO3 ~ PIO0 , and PO3 ~ PO0 is the link for API4000M connecting with outside, Instruction INPUT PA, OUT PA, or OUT PB, can input or output Data. PI3 , or PI2 ~ PI0 that set to Input Pin, or PIO3 ~ PIO0 of Input Pin set with Trigger has any pin is High Level, there will send a interrupt signal INTR1(Key In), and Wake Up API4000M in Shut Down. Before exercising Instruction SHUTDN, must exercise Instruction INTRE first, then API4000M can Wake Up again. E. Sample Program MOVD R2 , 85 ; OUT PC , R2 ; MOVD R5 , 50 ; GAIN R5 ; LDSPADB C1A , S9 ; LDSPADF C1A , S9 ; MOVD R3 , 78 ; OUT PE , R3 ; CLINTR ; PLAYSP C1A , 19 ; P1: JUMP JUMP P2: MOVD R3 , 15 ; OUT PE , R3 ; LDSPADB C1B , S11 ; LDSPADF C1B, S11 ; LDSPADB C1A , S12 ; LDSPADF C1A , S12 ; LDSPADB C2B , S11 ; LDSPADF C2B , S11 ; LDSPADB C2A , S12 ; LDSPADF C2A , S12 ; LDSPADB C3B , S13 ; LDSPADF C3B , S13 ; LDSPADB C3A , S14 ; LDSPADF C3A , S14 ; LDSPADB C4B , S15 ; LDSPADF C4B , S15 ; LDSPADB C4A , S16 ; LDSPADF C4A , S16 ; LDMYAD M0 ; /* R3 = 00001111 */ /* Set CH1 = Melody Mode, Sound Processor = OFF */ /* Set Start Address of Sound11 on CH1B */ /* Set End Address of Sound11 on CH1B */ /* Set Start Address of Sound12 on CH1A */ /* Set End Address of Sound12 on CH1A */ /* Set Start Address of Sound11 on CH2B */ /* Set End Address of Sound11 on CH2B */ /* Set Start Address of Sound12 on CH2A */ /* Set End Address of Sound12 on CH2A */ /* Set Start Address of Sound13 on CH3B */ /* Set End Address of Sound13 on CH3B */ /* Set Start Address of Sound14 on CH3A */ /* Set End Address of Sound14 on CH3A */ /* Set Start Address of Sound15 on CH4B */ /* Set End Address of Sound15 on CH4B */ /* Set Start Address of Sound16 on CH4A */ /* Set End Address of Sound16 on CH4A */ /* Set Start Address of Melody Song 0 */ INTR3 , P2 ; ADDR , P1 ; /* if Sound End go to P2 */ /* go to P1 */ /* R2 = 01010101 */ /* Set PIO3 ~ PIO0 to Trigger Input Pins */ /* R5 = 50 */ /* Set volume Level to 50 */ /* Set Start Address of Sound9 on CH1A */ /* Set End Address of Sound9 on CH1A */ /* R3 = 01001110 */ /* Set CH1 = Sound Mode, Sound Processor = ON */ /* Cleat interrupt signal INTR */ /* Sample Rate 16KHz , Play Sound9 on CH1 */ 11 Ver1.1 INTEGRATED CIRCUITS INC. MOVD R7 , 204 ; TEMPO R7 ; MOVD R0 , 111 ; OUT PE , R0 ; P5: JUMP JUMP JUMP JUMP P20: INPUT PB , R8 ; CLINTR ; ADDC R8 , 224 ; JUMP CO0 , P22 ; ADDC R8 , 192 ; JUMP CO0 , P23 ; ADDC R8 , 160 ; JUMP CO0 , P24 ; P21: INTR1 , P40 ; INTR2 , P30 ; INTR4 , P20 ; ADDR , P5 ; SERIES VOICE OTP MODULE API4000M /* R7 = 204 */ /* Set Tempo = 99 */ /* R0 = 01101111 */ /* SetSound Processor = ON,Melody = ON,CH4 ~ CH1 to Melody Mode */ /* if Key In go to P40 */ /* if Song End go to P30 */ /* if Change Instrument go to P20 */ /* go to P5 */ /* read data about changing instrument */ /* clear INTR4 */ /* if R8 < 32 */ /* if CH2 go to P22 */ /* if R8 < 64 */ /* if CH3 go to P23 */ /* if R8 < 96 */ /* if CH4 go to P24 */ LDSPADB C1B , S21 ; /* Set Start Address of Sound21 on CH1B */ LDSPADF C1B , S21 ; /* Set End Address of Sound21 on CH1B */ LDSPADB C1A , S22 ; /* Set Start Address of Sound22 on CH1A */ LDSPADF C1A , S22 ; /* Set End Address of Sound22 on CH1A */ JUMP ADDR , P5 ; /* go to P5 */ P22: LDSPADB C2B , S31 ; /* Set Start Address of Sound31 on CH2B */ LDSPADF C2B , S31 ; /* Set End Address of Sound31 on CH2B */ LDSPADB C2A , S32 ; /* Set Start Address of Sound32 on CH2A */ LDSPADF C2A , S32 ; /* Set End Address of Sound32 on CH2A */ JUMP ADDR , P5 ; /* go to P5 */ P23: LDSPADB C3B , S33 ; /* Set Start Address of Sound33 on CH3B */ LDSPADF C3B , S33 ; /* Set End Address of Sound33 on CH3B */ LDSPADB C3A , S34 ; /* Set Start Address of Sound34 on CH3A */ LDSPADF C3A , S34 ; /* Set End Address of Sound34 on CH3A */ JUMP ADDR , P5 ; /* go to P5 */ P24: LDSPADB C4B , S25 ; /* Set Start Address of Sound25 on CH4B */ LDSPADF C4B , S25 ; /* Set End Address of Sound25 on CH4B */ LDSPADB C4A , S26 ; /* Set Start Address of Sound26 on CH4A */ LDSPADF C4A , S26 ; /* Set End Address of Sound26 on CH4A */ JUMP ADDR , P5 ; /* go to P5 */ 12 Ver1.1 INTEGRATED CIRCUITS INC. P30: MOVD R0 , 15 ; OUT PE , R0 ; CLINTR ; JUMP ADDR , P50 ; P40: INPUT PA , R12 ; ADDC R12 , 254 ; JUMP CO0 , P42 ; P41: JUMP JUMP P42: JUMP INTR1 , P42 ; MOVD R0 , 15 ; OUT PE , R0 ; P50: INTRE ; SHUTDN ; END ; INTR1 , P41 ; ADDR , P5 ; /* if Key In go to P41 */ /* go to P5 */ /* read Input Port A data */ /* if R12 < 2 */ /* if PI0 = 1 go to P42 */ SERIES VOICE OTP MODULE API4000M /* R0 = 00001111 */ /* Set Sound Processor = OFF, Melody = OFF */ /* clear INTR2 */ /* go to P50 */ /* if Key In go to P42 */ /* R0 = 00001111 */ /* Set Sound Processor = OFF, Melody = OFF */ /* enable INTR signal */ /* Shut Down API4000M */ /* End of Program , END must put in the end of program */ Pin-1 VCC-3V Pin-10 VCC4V5 Pin-2 PI2 Pin-11 PI3 Pin-3 PI0 Pin-12 PI1 Pin-4 PIO2 Pin-13 PIO3 Pin-5 PIO0 Pin-14 PIO1 Pin-6 PO2 Pin-15 PO3 Pin-7 PO0 Pin-16 PO1 Pin-8 SPK1 Pin-17 SPK2 Pin-9 GND Pin-8 GND 13 Ver1.1 INTEGRATED CIRCUITS INC. SERIES VOICE OTP MODULE API4000M TYPICAL APPLICATION CIRCUIT 14 Ver1.1 INTEGRATED CIRCUITS INC. SERIES VOICE OTP MODULE API4000M API4000 SSOP-56 PIN(300MIL) PACKAGE : 15 Ver1.1
API4000M8 价格&库存

很抱歉,暂时无法提供与“API4000M8”相匹配的价格&库存,您可以联系我们找货

免费人工找货