Disklavier
MX100B
Here is the results of removing the CPU and probing the address
and data buss to control all the I/O on the main controller.
The
objective was to replace the controller with a raspberry pi using the MIDI buss
as a communications buss and run midi from the PI to the piano.
Address Bus
Master List
|
Address |
Read/ Write |
Control |
Valid Address |
|
10000XXX |
Write |
7 Segment LED Control |
80h – 87h |
|
10001XXX |
Write |
Led ON/OFF
(Vol, Tempo, Trans, Repeat, Record) |
88h – 8Fh |
|
10010XXX |
Write |
Led ON/OFF
(Left/Right - Red/Green, Play) |
90h – 97h |
|
10011XXX |
Write |
Led ON/OFF
( -4 to -10 ) |
98h – 9Fh |
|
10100XXX |
Write |
Led ON/OFF
(-0 to -3, Func, Metronome, Disk |
A0h – A7h |
|
10101XXX |
|
|
A8h – AFh |
|
10110XXX |
Write |
Button Column Select |
B0h – B7h |
|
10111XXX |
Read |
Button Pushed Row read data |
B8h – BFh |
|
11000XXX |
Read |
Remote Control |
C0h – C7h |
|
11001XXX |
Read |
Rotary dial and power status register read |
C8h – CFh |
|
11010XXX |
Write |
Clear Rotary dial and power status register |
D0h – D7h |
|
11011XXX |
|
|
D8h – DFh |
|
11100XXX |
|
|
E0h – E7h |
|
11101XX0 |
R/W |
Send a command to LCD |
E8h, EAh,ECh,EEh |
|
11101XX1 |
R/W |
Send data to LCD |
E9h,EBh,EDh,EFh |
|
11110XXX |
Write |
Speaker |
F0h – F7h |
|
11111XXX |
|
|
F8h – FFh |
Button pushed logic
Read the data to get the key pushed
|
A7-A3 = 10111XXX |
||
|
ROW |
DATA |
Binary |
|
SRX-0 |
01h |
0000 0001 |
|
SRX-1 |
02h |
0000 0010 |
|
SRX-2 |
04h |
0000 0100 |
|
SRX-3 |
08h |
0000 1000 |
|
SRX-4 |
10h |
0001 0000 |
|
SRX-5 |
20h |
0010 0000 |
|
SRX-6 |
40h |
0100 0000 |
|
SRX-7 |
80h |
1000 0000 |
Write the data to select the Column
|
A7-A3 = 10110XXX |
||
|
COL |
DATA |
Binary |
|
SWX-0 |
01h |
0000 0001 |
|
SWX-1 |
02h |
0000 0010 |
|
SWX-2 |
04h |
0000 0100 |
Example Send data 02h to address B0h to set SWX-1 High, then read data from address B8h. If the metronome was pushed the data would be 01h
|
SWX-0 01h |
SWX-1 02h |
SWX-2 04h |
|
|
SRX-0 01h |
disk_pushed() – DISK |
metronome_pushed() – METRONOME |
function_pushed() – FUNC/EDIT |
|
SRX-1 02h |
move_left_pushed() - ï |
move_right_pushed() - ð |
enter_pushed() – ENTER |
|
SRX-2 04h |
no_pushed() - -/NO |
zero_pushed() - 0 |
yes_pushed() - +/YES |
|
SRX-3 |
--------------------------- |
--------------------------------- |
---------------------------- |
|
SRX-4 10h |
tempo_pushed() - TEMPO |
right_pushed() – R |
rev_pushed() - | |
|
SRX-5 20h |
transpose_pushed() - TRANSPOSE |
record_pushed() – RECORD |
play_pushed() - PLAY |
|
SRX-6 40h |
repeat_pushed() - REPEAT |
------------------------------ |
fwd_pushed() - | |
|
SRX-7 80h |
volume_pushed() - VOLUME |
Left_pushed() - L |
stop_pushed() - STOP |
LED SET LOGIC
|
A7-A3 set to 10010XXX and write Data |
|
|
DATA |
Action |
|
01h |
Turn “L” LED Green |
|
02h |
Turn “L” LED Red |
|
04h |
Turn “R” LED Green |
|
08h |
Turn “R” LED Red |
|
10h |
Turn “PLAY” LED Green |
|
A7-A3 set to 10011XXX and write Data |
|
|
DATA |
Action |
|
01h |
Turn “-10” LED Green |
|
02h |
Turn “-9” LED Green |
|
04h |
Turn “-8” LED Green |
|
08h |
Turn “-7” LED Green |
|
10h |
Turn “-6” LED Green |
|
20h |
Turn “-5” LED Green |
|
40h |
Turn “-4” LED Green |
|
A7-A3 set to 10100XXX and write Data |
|
|
DATA |
Action |
|
01h |
Turn “-3” LED Green |
|
02h |
Turn “-2” LED Green |
|
04h |
Turn “-1” LED Green |
|
08h |
Turn “-0” LED Green |
|
10h |
Turn “FUNC/EDIT” LED Green |
|
20h |
Turn “METRONONE” LED Green |
|
40h |
Turn “DISK” LED Green |
|
A7-A3 set to 10001XXX and write Data |
|
|
DATA |
Action |
|
01h |
Turn “VOLUME” LED Green |
|
02h |
Turn “TRANSPOSE” LED Green |
|
04h |
Turn “TEMPO” LED Green |
|
08h |
Turn “REPEAT” LED Green |
|
10h |
Turn “RECORD” LED Green |
Remote Control
Set A7-A3 to 11000XXX and reading the DATA bus provides the hex codes below.
Seven Segment Led.
|
A7-A3 = 10000XXX and write data to databuss |
|||
|
High Byte |
DATA |
LOW
Byte |
DATA |
|
1111 |
Clear LSB |
1111 |
Clear MSB |
|
0001 |
Set LSB to “1” |
0001 |
Set MSB to “1” |
|
0010 |
Set LSB to “2” |
0010 |
Set MSB to “2” |
|
0011 |
Set LSB to “3” |
0011 |
Set MSB to “3” |
|
0100 |
Set LSB to “4” |
0100 |
Set MSB to “4” |
|
0101 |
Set LSB to “5” |
0101 |
Set MSB to “5” |
|
0110 |
Set LSB to “6” |
0110 |
Set MSB to “6” |
|
0111 |
Set LSB to “7” |
0111 |
Set MSB to “7” |
|
1000 |
Set LSB to “8” |
1000 |
Set MSB to “8” |
|
1001 |
Set LSB to “9” |
1001 |
Set MSB to “9” |
Liquid Cristal Display
Address
the LCD set A7-A6 to 11101XXX
It
is a two line by 24 columns LCD
A0
is RS on the LCD so:
·
To send a command set A0 – LOW
·
To send data set A) - High
The LCD R/ is tied to
Strobe Enable high to write to the LCD.
Speaker
Setting Address lines A7-A3 to 11110XXX and writing data will cause the speaker to beep.
|
DATA SENT |
|
|||||||
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
Audio off |
|
0 |
0 |
0 |
1 |
0 |
0 |
0 |
0 |
|
|
0 |
0 |
0 |
0 |
0 |
1 |
|
|
|
|
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
Rotary Dial
The Rotary dial uses two addresses: one writes to clear the dial register by sending data 02h (0000 0010) to Address bits A7 to A3 (11010XXX) and then 80h to the same address.
Once cleared you can read from address (11001) the data indicates the following:
|
DATA Read |
Dial |
PWR |
|
00h (0000 0000) |
No Change |
OFF |
|
01h (0000 0001) |
Moved CW |
OFF |
|
03h (0000 0011) |
Moved CCW |
OFF |
|
80h (1000 0000) |
No Change |
ON |
|
81h (1000 0001) |
Moved CW |
ON |
|
83h (1000 0011) |
Moved CCW |
ON |
Once read the dial needs to filter out 80h for no change power on.
|
Key |
Init Action |
Play_midi |
Rec_midi |
Sub Menu |
|
Play/Pause |
If(disk) play_midi |
Play -> Pause -> Play |
Start_pause Record |
|
|
Rec |
If(disk) record_midi |
Goto song start/set for duet record |
Set up for record |
|
|
Stop |
|
goto Init_Action |
Stop and save (default name) |
Exit sub menu |
|
Transpose |
|
Link rotery knob to Transpose |
|
|
|
Volume |
|
Link rotery knob to Volume |
|
|
|
Tempo |
|
Link rotery knob to Tempo |
|
|
|
Metronome |
Select Metronone Link Rotery |
Link rotery knob to Metronome |
|
|
|
Rotary Knob |
Select midi song from dir |
Link to/Trans/Vol/Tem/Met |
Edit name letter select |
|
|
+ YES |
If on closed folder open folder |
Rotery Sel + |
Move right (char enter) |
Turn item on |
|
0 |
go to root top of directory |
Rotery Sel to 0 position |
|
Item to default |
|
- NO |
If on open folder close folder |
Rotery Sel - |
Move left (char delete) |
Turn item off |
|
Part Sel
L |
|
Set start marker |
Move left one char (non destructive) |
|
|
Part Sel
R |
|
set end marker then loop |
Move Right one char (non destructive) |
|
|
Func/Edit |
Sub Menu |
|
if not play edit name |
edit exit sub menu |
|
Enter |
Start Metronome |
|
Save name exit name edit |
Save selection |
|
|
next directory entry |
Move to start of next Song |
|
|
|
|
last directory entry |
Move to start of Song |
|
|
|
|
go to top of directory |
Move to start of next Song |
|
|
|
|
goto bottom of directory |
Move to start of last song |
|
|
|
DISK |
Sub Menu for disk |
|
|
|
|
Repeat |
|
Song end = Song star |
|
|
|
DISK SUB |
|
|
Func/Edit |
Format disk |
|
Rotary Knob |
/Format/Erase disk/Erase Song/ |
|
Enter |
Select displayed function |
|
|
|
|
Metronome SUB |
Action |
|
Enter |
Start |
|
Rotary Knob |
Tempo change |
|
+ Yes |
Tempo Up |
|
- No |
Tempo Down |
|
0 |
Tempo to 120 bpm |
Status
7 – End Flag – high when data is sent
6 – EIE –End interrupt Enable – 1 is IE
5 – RE – Receive Enable – 1 = Rx
3 not used
2-0 – speed select
(00010110) -> 16h to address 0ah
(10101010) -> AAh to
address 0Bh
TX/RX
7 – End Flag – high when data is sent
6 – EIE –End interrupt Enable – 1 is IE
5 – RE – Receive Enable – 1 = Rx
4 – TE – Transmit Enable 1 = Tx , reset = 0
2-0 – speed select
Also the original remote blocked 00 and FF
on reading remote key hit. Need to probe
CPU pin 51 for transition high to low.
The Remote control requires a low on CPU
P51 to enable it.
Serial to Pi uses P48 (TXA0) and 49 (RXA0)
TDR0 – TX data Reg (put data here)
TSR0 – TX shift Reg
RDR0 – RX data Reg (get data here)
RSRO – RX Shift reg
CNTLAO – Cont reg A (RTS0)
CNTLB0 - Cont Reg B (CTS0)
STAT0 – Status Reg (DCD0)
7 – Rx reg full – clear by read RDR0
RX data à RSR0 à RDR0 à data in
6- Overrun RDR0
5- Parity error
4 – Framing Error
3 – RX int EN – (turn on to start int)
2 – DCD0 – P47 on CPU – set as DREQ0 on yamaha.
1 – TX data reg empty – read this to send more data
0 – TX INT EN – Set this to enable tx interrupt
Data out àTDR0 àTSR0 à TX data
READ (STAT0 & 0x80) RX Reg full
READ (STAT0 & 0x02) TX Reg Full
Write (STAT0 = 0x09) enable TX and RX interrupt
|
0 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
|
|
R |
T |
R |
? |
8 |
P |
1 |
|
|
X |
X |
T |
|
B |
A |
S |
|
|
|
|
S |
|
I |
R |
T |
|
|
E |
E |
|
|
T |
I |
O |
|
|
N |
N |
|
|
|
T |
P |
|
|
|
|
|
|
|
Y |
|
CNTLA0 = 66H
7 – Multi processor (set to 0)
6 – RX enable (set to 1)
5 – TX enable (set to 1)
4 – TRS0 - (set to X)
3 – MPBR/EFR (set to X)
2 – 0 Data Format 8E1 = 110 or 0x07
|
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
|
|
/ |
e |
/ |
/ |
/ |
/ |
|
|
|
1 |
v |
1 |
1 |
1 |
1 |
|
|
|
0 |
e |
6 |
|
|
|
|
|
|
|
n |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p |
|
|
|
|
CNTLB0 = 00h for 62.5 Kbps
7 – Multi Pro (set to 0)
6 – Multi Mode (set to
5 – CTS/PS (pre scale 10 or 30)
4 – Parity E/O (set to 0 even)
3 – Divide Ratio (0=16, 1 = 64)
2-0 – Speed select (
Void tx_IRQ(void){
If(!tx_que_empty()){
TDR0 = TX_que_Data();
}
}
Void tx_que_init(){
}
1n4148 100 159mA 500 300 1.0v 10ma 25 20 4.0