ML63295A User’s Manual
Chapter 12
Melody Driver (MELODY)
12 – 3
bit 3: MSF
This flag indicates the melody output status.
When an MSA instruction starts the melody, MSF is set to “1”. After output of the last melody
data (END bit is “1”), MSF is cleared to “0”.
Setting MSF to “0” during melody output will forcibly stop the melody output. If forcibly stopped,
the melody output cannot be restarted at the address at which it was stopped.
At system reset, MSF is cleared to “0”.
Note:
If MSF (bit 3 of MDCON) is set to “0” to stop melody output forcibly, it is required to set the stop address on the
ROM table to the end-data address (8000H).
In this case, set MSF to “0” after writing the melody end data
that consists of two words of melody (silence with the END bit being “1”) data.
If this programming is not
executed, melody output may not be stopped even if MSF is set to “0”.
Example programming is shown
below.
;*Program part***********
DI
; 0. Disable master interrupt (MIE).
MSA
MDSTOP_DATA
; 1. Write melody end data to the melody circuit.
MOV A, #0
; 2. Set the MSF to “0”.
MOV MDCON,A
;
MOV A, #1101b
; 3. Clear melody end interrupt request (QMD).
AND
IRQ0, A
;
EI
; 4. Enable master interrupt (MIE).
;*ROM table data part****
;*Provide two words of melody data so that a melody will always be terminated even if a melody
;*request is issued twice.
MDSTOP_DATA:
DW
8000H
; Silence data 1
DW
8000H
; Silence data 2
;************************
In the EASE63180 Emulator, melody output will be stopped only by setting MSF to “0”; writing melody end data
is not needed.
bit 2: EMBD
This bit turns the buzzer output ON or OFF.
At system reset, EMBD is cleared to “0” and buzzer output is turned OFF.
In the single tone output mode, setting EMBD to “1” turns ON the buzzer output. After the
second falling edge of the 32 Hz output, EMBD is cleared to “0” and buzzer output is turned OFF.
If melody output is started during buzzer output, EMBD is cleared to “0” and the buzzer output is
turned OFF.
!