Api4000m – Rainbow Electronics API4000M User Manual
Page 11

INTEGRATED
API4000M
SERIES
CIRCUITS INC. VOICE OTP MODULE
11
D. External Interface
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 ; /* R2 = 01010101 */
OUT PC , R2 ; /* Set PIO3 ~ PIO0 to Trigger Input Pins */
MOVD R5 , 50 ; /* R5 = 50 */
GAIN R5 ; /* Set volume Level to 50 */
LDSPADB C1A , S9 ; /* Set Start Address of Sound9 on CH1A */
LDSPADF C1A , S9 ; /* Set End Address of Sound9 on CH1A */
MOVD R3 , 78 ; /* R3 = 01001110 */
OUT PE , R3 ; /* Set CH1 = Sound Mode, Sound Processor = ON */
CLINTR ; /* Cleat interrupt signal INTR */
PLAYSP C1A , 19 ; /* Sample Rate 16KHz , Play Sound9 on CH1 */
P1:
JUMP INTR3 , P2 ; /* if Sound End go to P2 */
JUMP ADDR , P1 ; /* go to P1 */
P2:
MOVD R3 , 15 ; /* R3 = 00001111 */
OUT PE , R3 ; /* Set CH1 = Melody Mode, Sound Processor = OFF */
LDSPADB C1B , S11 ; /* Set Start Address of Sound11 on CH1B */
LDSPADF C1B, S11 ; /* Set End Address of Sound11 on CH1B */
LDSPADB C1A , S12 ; /* Set Start Address of Sound12 on CH1A */
LDSPADF C1A , S12 ; /* Set End Address of Sound12 on CH1A */
LDSPADB C2B , S11 ; /* Set Start Address of Sound11 on CH2B */
LDSPADF C2B , S11 ; /* Set End Address of Sound11 on CH2B */
LDSPADB C2A , S12 ; /* Set Start Address of Sound12 on CH2A */
LDSPADF C2A , S12 ; /* Set End Address of Sound12 on CH2A */
LDSPADB C3B , S13 ; /* Set Start Address of Sound13 on CH3B */
LDSPADF C3B , S13 ; /* Set End Address of Sound13 on CH3B */
LDSPADB C3A , S14 ; /* Set Start Address of Sound14 on CH3A */
LDSPADF C3A , S14 ; /* Set End Address of Sound14 on CH3A */
LDSPADB C4B , S15 ; /* Set Start Address of Sound15 on CH4B */
LDSPADF C4B , S15 ; /* Set End Address of Sound15 on CH4B */
LDSPADB C4A , S16 ; /* Set Start Address of Sound16 on CH4A */
LDSPADF C4A , S16 ; /* Set End Address of Sound16 on CH4A */
LDMYAD M0 ; /* Set Start Address of Melody Song 0 */