Previous Thread
Next Thread
Print Thread
Page 1 of 4 1 2 3 4
Joined: Oct 2002
Posts: 1,017
Senior Member
OP Offline
Senior Member
Joined: Oct 2002
Posts: 1,017
Today I was reading the Casper Electronics website, browsing some of the circuit-bent projects, and ran across a page on the Casio SA series of keyboards:

What interested me was the following line:

There will be an Amplifier chip ( No AN8053 ) common across the SA series and a mask programmed CPU which will be made by OKI and have the part No M6387-xx where xx is the variant for the specific keyboard it is installed in, in the case of the SA-5 it is M6387-16

Could this mean that there's something on those crappy little keyboards that can be decapped, dumped, and subsequently emulated?

Joined: Oct 2006
Posts: 1,017
Likes: 21
Very Senior Member
Very Senior Member
Joined: Oct 2006
Posts: 1,017
Likes: 21
Yeah, synthesizer emulation is something I really hope to see happen. There are a few freeware projects (implemented as VST files sometimes), but nothing open-source. Also, a lot of them are based on audio perception - simulation - rather than emulation. Maybe Arbee can back me up on this.

This is probably the biggest GPL project:

Mind you, I haven't looked into it for years and years.

- Stiletto

Joined: Jan 2021
Posts: 138
Likes: 3
Senior Member
Senior Member
Joined: Jan 2021
Posts: 138
Likes: 3
Casio SA-series hardware is a softsynth on a chip. Long ago DTech mentioned that he had decapped the microcontroller but couldn't understand how it works. I have done some work to dig through the patents and analyze the pinout of the thing, This is an unfinished analysis I wrote for my website:

The classic Casio SA-series hardware is based on the single chip CPU "OKI M6387-xx" (where "xx" indicates the software number of the internal ROM). Although DIL shaped, its 30 pins are narrower and don't fit into regular DIL sockets (some websites refer this "SDIL"). It is hard to find info about this chip, but it appears to be a 4bit RISC microcontroller crystal clocked at 21.725 MHz. There is likely DRAM in it, because it can not be underclocked very much without crashing. Thus although these keyboards are popular circuit-bending victims, on the digital side there is beside known matrix eastereggs not much more to explore than semi-random shitshots. (It has no exposed data bus to play with).

The classic SA-series supports only 32 keys, but a 49 keys matrix was used in the technically very similar MA- and CA-series keyboards of its era (but not in the newer MA-150/ MA-170). Some of these (e.g. MA-130) have the same CPU. All keyboards with polyphony >2 notes contain matrix diodes and pulldown resistor arrays at the input lines. Because the same CPU is built into 2 and 4 note polyphonic keyboards, 2 connected pins tell it how much polyphony to use.

The sound engine is mono and uses a 4 note polyphonic wavetable sound generator with each voice based 2 mixed low-res loop samples with independent, partly very complex algorithmic volume and pitch envelopes (possibly program loop synthesis) and modulations. In the MA-130 one subvoice can be muted to achieve 8 instead of 4 note polyphony, thus internally it has at least 8 sound channels. The digital volume control seems to be implemented in software by crude changes of the envelope start points, which not only steals a lot of bit resolution but also speeds up the cycling tempo of complex envelope patterns, which makes me conclude that instead of using an independent timer register, the envelope simply switches to the next step once its volume register is counting down to zero. I yet had no chance to look into the machine code, but it seems to be quite a miracle of minimalistic efficient hardware design. I think the M6387 has it in itself to be a true classic. When you listen to it first, you may ask why it can't do certain things too well, but once it is fully deciphered, it will likely turn into a big surprise how it can do so many things at all. Like with Atari VCS2600 I expect the underlying hardware to be incredible tiny.

The case bottom of my Casio SA-41 lists the US patents 4121284, 4371923 and 4942516, those however only refer to third party inventions about very generic principles of small microcomputers (key debouncing, multitasking, integrated I/O etc.) and may be rather listed as a warning that it is patented, while enshrouding the inner working by not telling competitors where to search for the important parts.

the Casio softsynth on a chip

In fact, the Casio "PCM" sound engine is apparently described quite detailedly in the US patent 5319151; it is based on a highly complex softsynth with many algorithms those can perform PCM, DPCM, FM and TM (triangular wave modulation) synthesis with sophisticated envelopes. This rather confusing 121 page tome of a patent text however is ambiguous, because it covers plenty of different implementations those e.g. can employ different counts of chip-internal sub-CPU cores for sound generation in higher grade instruments. The SA-series is surely the cheapest described "First" or "Second Embodiment" which has none. The algorithms for this version even describe how shorter tasks are stuffed with blank "dummy commands" to keep the timing in sync when different sounds would need different computing time. It works indeed very VCS2600-like - a marvel of freakish realtime programming made from one big loop (plus in "First Embodiment" one timer IRQ to compute waveforms and fill the DAC output FIFO; the "Second" does even this during dummy commands).

The interpolation method with that Casio smoothly blends between wavetable sections is described in the US patent 4442745 "Long duration aperiodic musical waveform generator" It plays sections of compacted samples back and forward to implement things like long decaying cymbals. US patent 4958552 explains algorithms how envelope data is extracted from natural instrument recordings and applied on loop samples as a approximated segmented functions. The original envelope may be removed from the stored loop sample by a waveform normalizer (US patent 4691608). Most important is that these chained envelopes can have basically any length and have (unlike e.g. ADSR) no fixed count of steps. Combined with crossfading between adjacent loop samples this permits very flexible sound definition.

Triangular wave modulation (US patent 5164530) is an FM-like Casio speciality that generates waveforms by modulating a monotonous carrier function with a sine (or other) wave - decoding the signal by mirroring it at a triangular wave. With the same count of operators (here only 2?) the produced waveform has higher harmonics than normal FM because at high modulation the wave peaks fold back into the opposite direction. Without modulation it outputs a sine wave and so can nicely blend between very dull and bright timbres. The carrier waveform stands in ROM and so can be switched between a variety of timbres. Like with FM, operators can be combined in various ways.

The US patent 5319151 "Data processing apparatus outputting waveform data in a certain interval" mentions for the "First Embodiment" that the chip size is only 5x5mm, a program word has 28 bits (including lower potion of next address) and these further hardware specs:

"With regard to the circuit scale and the operation time of the specific embodiment (PCM sound source system capable of producing eight polyphonic sounds) the control ROM has a size of 112K bits, RAM 445.4K bits and the control data/waveform ROM (for 100 timbres) 508K bits; one machine cycle is about 276 nanoseconds with a maximum number of cycles of the interrupt program when invoked being about 150; and the executing period of the interrupting process (tone output sampling period) is about 47 microseconds."
Expressed in KBytes this would mean 55.7KB RAM, 14KB program ROM and 63.5KB sound ROM, which isn't far away from a Commodore C64 with large ROM cartridge. Said CPU speed would be about 3.6 MIPS.

Interesting is that OKI made a general midi sound IC ML2860 (32 note polyphonic ADPCM) to play high quality ring tones in mobile phones, but the datasheet from 2002 contains a very strange note: "Please appreciate that ML2860 is not offered for musical instrument and toy applications, such as keyboards." This suggests that OKI licensed an efficient sound synthesis engine (possibly even surplus ICs) from Casio keyboards, but had to sign an agreement not to use it in competitive products against Casio.
The only M6387 based keyboard with MIDI (out) is the GZ-5, but it was crippled to only 10 preset sounds and no rhythm (likely to save ROM space to make the midi implementation fit). Many keyboards with M6387 CPU were initially released with a current pop song as the demo, and once the song wasn't popular anymore, they were re-released (to save royalties?) with more generic demos.

pinout M6387

The "OKI M6387-xx" (30 pin SDIL, "xx" = software number of internal ROM) is the CPU of small polyphonic Casio keyboards. Technically it is a sophisticated softsynth on a chip with many algorithms (wavetable and FM variants, program loop synthesis?), complex envelopes and up to 8 note internal polyphony. It has only 1 sound output with internal DAC and supports a keyboard matrix with up to 12 outputs and 8 inputs.
I first had compared many keyboard PCBs and finally found the real thing in SA-series service manuals. Strange is that many PCB layouts look like when a (prototype?) version with 34 pins exists, where the additional 4 outer pins are simply connected with the regular corner pins. The clock rate 21.725 MHz is the same like with NEC 938GD in MT-540; also some pin names are similar, which hints that it might be based on it. Interesting is that the apparent GND pins 1 and 2 are genuinely test pins, those may help to read out the internal rom, connect external memory or even make it communicate with an external computer or microcontroller for editing synth parameters or playing midi data. Pin 4 is the filtered analogue power supply, which is wired through [a diode || 100 Ohm] to +5V and to a 100µF filter capacitor against GND. Also analogue GND can be wired independently to reduce crosstalk interferences.

The versions of "OKI M6387-xx" ("xx" = software number of internal ROM) strongly differ in demo songs, supported keyboard length and partly sound set.

software number	hardware class	notes & features

01	SA-1	32 keys, 100 sounds, 29 rhythms+13 fixed accomp., demo "Wake Me Up"
01B	SA-20	dto. (bugfix release?)
03	SA-7	like 11(?) with demo "Classical Medley"
04	MA-120	49 keys, 100 sounds & 100 rhythms, demo "Together Forever"
11	SA-21	01 successor with 5 drumpads, 5 demos
13	MA-130	like 04 with demo "Classical Medley"
16	SA-35	32 keys, changed sound set & rhythms, 10 demos
22	SA-40	32 keys, only 8 sounds, no rhythm, dial controller, 6 demos
31	SA-41	like 11 with changed 5 demos (3 Hindi songs)
A23	GZ-5	32 keys, midi-out, only 10 sounds, no rhythm, no demo
A28	SA-65	37 keys, 30 rhythms, lcd port, 10 demos

Despite commercial IC vendor websites seem to offer them (who can say this about a Yongmei?!), I find absolutely no technical info about the M6387 (except that they often confuse it with Mitsubishi transistors). Unlike for other OKI ICs they have neither datasheets nor official pinouts, nor I found a generic OKI microcontroller with same package and matching pinout. But the OKI M6388 is a 4bit ADPCM voice recorder IC, and OKI made plenty of other ADPCM sound ICs (e.g. for speech synthesis). From what I read in such datasheets, their test pins often respond to something like 3 different voltages (between 0 and 5V) to select test modes, which might be useful to dump the internal ROM (likely complicated - I haven't tried yet and a better hacker than me failed). But datasheets don't tell more about it; I found only some references to a proprietary OKI chip development system µPLAT.

This pinout is based on various Casio SA-series service manuals and own examination.

pin	name	purpose

1	TEST2	test pin (wired to GND)
2	TEST1	test pin (wired to GND)
3	/RESET	reset
4	AVDD 	analogue supply voltage +5V
5	OUT 	sound out
6	AGND	analogue ground
7	GND	ground
8	COSI	crystal in | clock in (21.725 MHz)
9	COSO	crystal out
10	VDD	supply voltage +5V
11	KI0	key matrix in
12	KI1	key matrix in
13	KI2	key matrix in
14	KI3	key matrix in
15	KI4	key matrix in
16	KI5	key matrix in
17	KI6	key matrix in
18	KI7	key matrix in
19	KO11	key matrix out | NC
20	KO10	key matrix out | NC
21	KO9	key matrix out | NC
22	KO8	key matrix out | NC
23	KO7	key matrix out | POLY
24	KO6	key matrix out
25	KO5	key matrix out
26	KO4	key matrix out
27	KO3	key matrix out
28	KO2	key matrix out
29	KO1	key matrix out
30	KO0	key matrix out

The keyboard matrix inputs are active-high (react on +Vs aka VDD). The count of active KO lines depends on the software number, thus higher KO lines may be unused (NC) in certain CPU versions. SA-series only have 7 or 8, but I found 10 in the MA-130. My only keyboards using all KO lines are GZ-5 and SA-65. Both have a more complex discrete clock oscillator with COS0 unused. GZ-5 uses KO11 for MIDI-out and the rest for keyboard matrix. SA-65 uses KO8..KO11 to communicate with its LCD display controller IC "KS0035". Unusual is that the SA-series (and GZ-5) has its piano keyboard matrix grouped by 8 while those of most Casios are grouped by 6 (i.e. 2 per octave).

upgrade polyphony:

In 32 keys instruments (except SA-40), during startup (power-on reset) the M6387 CPU pulls KO7 (pin 23) high while it polls KI7 (pin 18). If both pins are connected, it will detect this pulse and enable higher polyphony; else it will limit polyphony to 2 notes. Then it sets KO7 low again to avoid blocking the input.

Thus to enable higher polyphony, you have to connect pin 23 with pin 8 (permanently or only at boot time). In keyboard models those use KO7 also for the key matrix (if yes, you will hear a beep when you hold an 1k resistor between pin 5 and 23) you need to connect them through a diode to avoid matrix bugs. In keyboards those don't, you can simply connect them directly.

However to prevent polyphony bugs, for polyphony >2 notes, a diode needs to be wired in series with each key (from an output to an input). This upgrade would be mechanically very difficult (involving trace cutting and likely SMD diodes) because small SA-series keyboards use a narrow multi-layer PCB with carbon trace contacts, where 32 additional diodes are very hard to fit (unless you anyway install an external keys PCB or MIDI kit). Thus in practise this is not worth the effort, because the corresponding midsize models with higher polyphony are quite cheap and easy to find on eBay.

If you like, of course you can also do the opposite and install a switch into a given connection between pin 23 and pin 8 to reduce the polyphony to 2 and though make melodies thinner. To test if your version supports it, simply short pin 23 with GND during power on; it will suppress said pulse and so switch to 2-note polyphony. (Don't do this regularly; the overload may harm the KO7 output, thus better cut the connection between 8 and 23 and replace it with a switch.)

advanced successors

In keyboards with key lighting or ROM-Pack support (like ML-2, PT-88, CT-840) SMD variants of the M6387 were used to permit higher pin count.

OKI M6521

The "OKI M6521-xx" is a 60 pin SMD variant of the M6387 that (unlike older Casio keyboards) supports a matrix of key lighting LEDs without the need of driver transistors and can control a ROM-Pack port. Without a ROM-Pack connected, the key lighting apparently uses demo songs from its internal ROM. Like M6387 it is clocked at 21.725 MHz.

OKI M6567

The "OKI M6567-xx" is an 80 pin SMD variant of the M6521 with even more pins, that is clocked twice as high (43.45 MHz) to support double polyphony (8/16 notes), a chord sequencer (100 chords) and LCD display. It was used e.g. in CT-840.


Joined: Jun 2011
Posts: 25
Joined: Jun 2011
Posts: 25
I don't know if it's relevant or not but I did dump my Casio MT-540 a long while ago. It had a 256k and a 512k rom chip, and oddly enough the latter was empty.

Joined: Dec 2015
Posts: 151
Likes: 3
AJR Online Content
Senior Member
Online Content
Senior Member
Joined: Dec 2015
Posts: 151
Likes: 3
On the related subject of the Casio SK-1 and its kin, I believe the CPU architecture assumed to be hidden within their MSM6283-xx SoCs has yet to be determined. The external mask ROMs in these keyboards can be dumped more easily, but the dumps contain mostly samples and no apparent program code. Oki is known to have developed an original 8-bit microcontroller architecture (which is less well documented in available databooks than their 4-bit MCUs) as well as licensing Intel's 80C51 series, so what they used here is far from obvious.

Joined: Jan 2012
Posts: 1,165
Likes: 10
Very Senior Member
Very Senior Member
Joined: Jan 2012
Posts: 1,165
Likes: 10
@AJR I have a SK-1 ... if something can be figured out about the CPU architecture by tracing the pinout or other non-destructive means, give me a shout. Just found there's a MIDI add-on to breathe in a new life into the old thing.

NCR DMV- DEC Rainbow- Siemens PCD- ITT 3030-Oly People- Acorn A5000- Olivetti M20
Joined: Feb 2004
Posts: 2,448
Likes: 152
Very Senior Member
Very Senior Member
Joined: Feb 2004
Posts: 2,448
Likes: 152
Tracing isn’t going to help. I have the service manual with the schematic. The external ROM just contains samples and some kind of bytecode. All the interesting stuff is inside the SoC.

Joined: Jan 2021
Posts: 138
Likes: 3
Senior Member
Senior Member
Joined: Jan 2021
Posts: 138
Likes: 3
AFAIK the Casio SK-1 CPU already has been decapped. Photos are online somewhere (don't remember).

I have dumped the roms of MT-540 and relatives (MT-240, MT-640 etc.). I downloaded all SK-series roms (and dumped the missing ones). The only still undumped one is the oriental keyboard Casio SK-8A.

The MT-540 is a highend variant of SA-series hardware. This is my unfinished analyisis of it.

The hardware of the Casio MT-540 is based on the CPU "NEC D938GD" with 2 attached ROMs (256KB + 512KB). The cheaper Casio MT-240 looks almost exactly like the MT-540, but has empty solder holes instead of the 2nd ROM "NEC D23C2000AC-1 501". Also the preset sound order is partly changed, which may be implemented by some different jumpers or diodes on the control panel PCB. By installing an EPROM copy of both MT-540 ROMs, it would be likely possible to upgrade the MT-240 (and other keyboards in its hardware class) with the sound effects of the MT-540, however it is not really worth the effort since the real MT-540 is not that rare. The Casio MT-640 (6 orange rubber drum pads, 4 sound effect pads, built-in subwoofer) is based on the same hardware class; despite the PCB layout differs (with 2nd amp IC for additional bass speaker) it has the same 2 ROM types with different contents. The ROM samples are uncompressed 16 bit (roughly 22 kHz).

This sound synthesis engine was referred in a prospect of Casio MT-640 as the "CD sound source" (named after the 16 bit sample resolution of Compact Disc??) "based on the latest in 12-bit PCM technology" (despite the ROM contents is actually 16 bit - I dumped it) and it mentions "multi-point sampling technology". The prospect "Casio hat den Sound" of 1988/89 mentions CD sound source in many related keyboards. The sound generation is apparently based on a highly complex softsynth with many algorithms those can perform PCM, DPCM, FM and TM (triangular wave modulation) synthesis with sophisticated envelopes. The Casio PCM system algorithms are described in the US patent 5319151. This rather confusing 121 page tome however covers plenty of different implementations those e.g. can employ different counts of chip-internal sub-CPU cores for sound generation, which makes it quite ambiguous. I expect that the MT-540 hardware family has at least one of these, while the cheap sounding classic SA-series has none.

The interpolation method with that Casio smoothly blends between wavetable sections is described in the US patent 4442745 "Long duration aperiodic musical waveform generator" It plays sections of compacted samples back and forward to implement things like long decaying cymbals. US patent 4958552 explains algorithms how envelope data is extracted from natural instrument recordings and applied on loop samples as a approximated segmented functions. The original envelope may be removed from the stored loop sample by a waveform normalizer (US patent 4691608). Most important is that these chained envelopes can have basically any length and have (unlike e.g. ADSR) no fixed count of steps. Combined with crossfading between adjacent loop samples this permits very flexible sound definition.

Triangular wave modulation (US patent 5164530) is an FM-like Casio speciality that generates waveforms by modulating a monotonous carrier function with a sine (or other) wave - decoding the signal by mirroring it at a triangular wave. With the same count of operators (here only 2?) the produced waveform has higher harmonics than normal FM because at high modulation the wave peaks fold back into the opposite direction. Without modulation it outputs a sine wave and so can nicely blend between very dull and bright timbres. The carrier waveform stands in ROM and so can be switched between a variety of timbres. Like with FM, operators can be combined in various ways.

The ambient sound effect algorithm (including envelope and sequence patterns) is detailedly described in the EU patent 0322871B1. It employs a lot of envelope tricks to simulate stereo panning, and loops samples (e.g. "brook") on both stereo channels at slightly different frequency to obscure the loop point. Important is particularly that there seem to be no genuinely random based elements involved, but only varying combinations of preprogrammed sequences.

pinout D938GD

The "NEC D938GD xxx" CPU (120 pin SMD, pins count counterclockwise, xxx = software number of internal ROM) was Casio's first keyboard CPU with fully digital sound envelope processing and mixing. All volume controls of individual sound channels (rhythm, accompaniment etc.) are digital. The digital audio {melody, chord, bass, percussion} is output as multiplexed serial data for left & right channel to an external 16 bit DAC (Sanyo LC7880). (The bass amp in MT-640 has no separate channel, but simply extracts the bass through an analogue lowpass filter.) The external RAM "NEC D4364C" seems to be optional (only used for sequencer) because Casio DM-100 lacks it. Sequencer RAM and LED lines are multiplexed with the keyboard matrix. The CPU has 3 ADC inputs for reading analogue signals (not used in MT-540).

The CPU needs an external 16bit ROM for wavetable samples and data. Despite this it also has also internal ROM, which seems to contain things like basic key matrix and user interface behaviour (those stay present even with external ROM removed). This pinout was based on the service manuals of Casio DM-100 and Hohner PSK50.

My MT-540 and MT-640 have D938GD software number "005", my MT-240 has "002". Also Hohner PSK-55 (aka Casio CT-650) schematics shows "005". The service manuals of Casio MT-540, CT-660, DM-100 and Hohner PSK50 mention "001" and of MT-640 mentions "002", thus they may be unimportant minor revision numbers or even specify electrical properties like the minimum operating voltage (+5.7V in MT-640, +5.9V in others).

pin	name	purpose

1	VDD2	supply voltage +5.9V (when power on)
2	/POFF	power off signal out (transistor switches VDD2)
3	TEST1	(wired to VDD1) | ?
4	TEST2	(wired to VDD1) | ?
5	RESET1	reset
6	MI	power on trigger in
7	TCLK	(wired to VDD1)
8	COSI	crystal in | clock in (21.7248 MHz)
9	COSO	crystal out
10	VDD1	supply voltage +5.9V (always on)
11	MPG	4MHz clock out (unbuffered)
12	GND	ground
13	MOSI	midi & rhythm tempo crystal in | clock in (4MHz)
14	MOSO	midi & rhythm tempo crystal out
15	INTF	 
16	INT4	(wired to VDD1)
17	MOUT	midi-out
18	MIN	midi-in
19	KO0	LED latch clock out
20	KO1	LED latch clock out
21	KO2	LED drive signal out (hold on/off)
22	KO3	LED drive signal out (tone bank)
23	KI8	key matrix in
24	KI7	key matrix in
25	KI6	key matrix in
26	KI5	key matrix in
27	KI4	key matrix in
28	KI3	key matrix in
29	KI2	key matrix in
30	KI1	key matrix in
31	KO22	auto power-off out APO
32	KO21	key matrix out
33	KO20	key matrix out
34	KO19	key matrix out
35	KO18	key matrix out
36	KO17	key matrix out
37	KO16	key matrix out, ram address A12
38	KO15	key matrix out, ram address A11
39	KO14	key matrix out, ram address A10
40	KO13	key matrix out, ram address A9
41	KO12	key matrix out, ram address A8
42	KO11	key matrix out, ram address A7
43	KO10	key matrix out, ram address A6
44	KO9	key matrix out, ram address A5
45	KO8	key matrix out, ram address A4
46	KO7	key matrix out, ram address A3
47	KO6	key matrix out, ram address A2
48	KO5	key matrix out, ram address A1
49	KO4	key matrix out, ram address A0
50	/WE1	ram write enable
51	/OE1	ram output enable
52	/CE1	ram chip enable
53	D0	ram data
54	D1	ram data
55	D2	ram data
56	D3	ram data 
57	D4	ram data
58	D5	ram data 
59	D6	ram data
60	D7	ram data 
pin	name	purpose
61	IO0	rom data in
62	IO1	rom data in
63	IO2	rom data in
64	IO3	rom data in
65	IO4	rom data in
66	IO5	rom data in
67	IO6	rom data in
68	IO7	rom data in
69	IO8	rom data in
70	IO9	rom data in
71	IO10	rom data in
72	IO11	rom data in
73	IO12	rom data in
74	IO13	rom data in
75	IO14	rom data in
76	IO15	rom data in
77	BSEL	(wired to GND)
78	AR0	rom address bus
79	AR1	rom address bus 
80	AR2	rom address bus
81	AR3	rom address bus
82	AR4	rom address bus
83	AR5	rom address bus
84	AR6	rom address bus
85	AR7	rom address bus
86	AR8	rom address bus
87	AR9	rom address bus
88	AR10	rom address bus
89	AR11	rom address bus
90	AR12	rom address bus
91	AR13	rom address bus
92	AR14	rom address bus
93	AR15	rom address bus
94	AR16	rom address bus
95	AR17	rom address bus
96	AR18	rom chip enable /CE
97	AR19	 
98	AR20	 
99	AR21	 
100	/CE	rom data out enable
101	/OE	 
102	/WE	 
103	/CEP	 
104	RFSH	 
105	MCLK	main clock test out (2.7156MHz = 1/8 of 2.17248MHz)
106	SWD4	 
107	BCLK	DAC bit clock out
108	SWD3	 
109	SWD1 (DATA)	serial digital audio data out (16 bit multiplexed left & right channel)
110	SWD2	 
111	WCLK1	DAC word clock out
112	LRCK	DAC left /right channel separation signal
113	STEST 	(wired to VDD1) | ?
114	VRT	ADC high level reference voltage (connect to DVDD +5V)
115	ADVDD	ADC supply voltage +5V
116	Vin0	ADC analogue input (not used)
117	Vin1	ADC analogue input (not used)
118	Vin2	ADC analogue input (not used)
119	ADGND	ADC ground
120	VRB	ADC low level reference voltage

The Casio MT-750 has a very similar looking CPU "NEC D937GD 003". It supports a 3 digit LED display and pitchbend wheel (fed into all 3 'Vin' lines shorted together). The MT-750 has 220 preset sounds (partly resembling SA-series) stored in an 1MB ROM. Unlike MT-540 variants, the ROM content is scrambled by swapped address lines. It is unknown whether Casio did this as a crude copy protection or to simplify PCB layout.

A successor was the "NEC D939GD 010" (160 pin SMD, 20 MHz, "IXA Sound Source" synthesis engine) found in Casio CTK-1000 from 1993, which how ever interfaces velocity sensitive keys and parts of the control panel through 2 external large ICs and uses most of its 160 pins to access SRAM, DRAM and 2MB ROM simultaneously (no shared bus) to increase throughput per clock cycle.

ROM hacking?

The MT-540 contains 2 16bit ROMs with all important pins wired parallel except A17. At the HN62404P also the BYTE pin 31 (the other ROM lacks it) is wired to +5V to prevent 8bit mode. Despite both pinouts are like an eprom 27C400, the HN62404P contains here a little trick that makes it appear empty (all #FF) when read in an eprommer, namely the OE/ pin is inverted and thus needs +5V instead of 0V to output data. (In an adapter I bent it away and connected it with Vdd to do this.) Likely this was done to simplify multiplexing by toggling between both roms through the OE/ line (but it also might have been a stupid copy protection attempt). With HN62404P removed, the MT-540 still boots properly, but lacks the piano and effect sounds (there are also some popping glitch noises), which shows that the operating system and most samples are in the smaller 2nd ROM D23C2000AC-1 (without that it can not run at all). I later verified this in MT-540 service manual. I compared a Casio CSM-1 rom dump with my MT-540 roms and they are identical.

In opposite to this, the Casio MT-240 contains a "HN62404P D27" as its only ROM (can not run when removed), and the OE/ pin of this one behaves normal (not inverted). The same ROM was also used for the lower keyboard of Casio DM-100 and in Hohner PSK50 (seen in service manual). Hohner PSK55 (seen in schematics) has a "HN62404P H84" instead. (According to parts list in service manuals, the software number seems to be the lower 3 digits.)

Although I haven't done this, I think it may be possible to upgrade the MT-240 (and related keyboards) with MT-540 sounds. For this you would need to copy both MT-540 ROMs on each a 27C400 eprom. Desolder the MT-240 ROM and install a 40 pin DIL IC sockets in its place and another one in the 2 unlabelled hole rows next to it. Install 2 short wire bridges in the empty hole pairs between both sockets and above the empty one. A little complicated is that you need to cut the OE/ line to pin 12 of the HN62404P socket and invert it (using a CMOS inverter IC or transistor). Connect the inverted OE/ to pin 12 of the HN62404P socket and the uninverted OE/ to pin 12 of the unlabelled socket. The eprom with the contents of the MT-540 HN62404P (software number G93) is inserted instead of the old HN62404P, and the eprom with D23C2000AC-1 content into the unlabelled socket (both facing to the same direction, i.e. notch facing at PCB rim).

And of course you need to add the missing effect pads and switches to the keyboard matrix.

If you want to keep also the old behaviour, you may additionally solder the original HN62404P piggyback onto the new eprom in its place (wire its /OE line uninverted). Disconnect the /CE input (pin 10) and install a switch that connects either the upper (old) or the 2 lower (new) ROMs with the /CE output of the CPU. Add a pullup resistor (about 10 kOhm?) against +5V at both banks to disable the unused bank. (Flip the switch with the keyboard powered off, else it may crash, which may be suited for shitshot.)

A mechanically simpler variant to avoid the piggyback soldering would be to use a larger capacity eprom (27C800?) with 42 pins (lower pins are the same pinout) and burn additionally the content of the old ROM into the upper half. Connect the switch output at the A18 address line to switch between both banks. It may even be possible to use only a single eprom with enough capacity (27C160) by burning the D23C2000AC-1 contents into an additional bank and connecting /OE only(?) to A19 to simulate the multiplexing. But this is all theory; I haven't done any of these and can not promise that it works.

Many of these mods may also function with Casio MT-640. According to its manual it e.g. has 10 additional preset sounds through MIDI, those likely also exist as matrix eastereggs. Its 2 ROMs are "NEC D23C2000AC-1 503" and "HN62404P Z29", those might be also addable as a bank switch mod fot MT-240.

I haven't tested this, so I don't know if e.g. the different software numbers of the D938GD CPUs may prevent it.


Joined: Jan 2021
Posts: 138
Likes: 3
Senior Member
Senior Member
Joined: Jan 2021
Posts: 138
Likes: 3
I read people are working on Casio keyboard emulation. Here is a list of Casio & Yamaha patent numbers and their meanings I had identified. (Websearch the patent numbers to read the texts.)


1000p digital tuning control_US4484506.pdf
1000p envelope control system_US4453440.pdf
1000p tone colour setting_US4538495.pdf
accompaniment algorithm_US5003860.pdf
accompaniment ending_US4646610.pdf
accompaniment (multitimbrale)_US4282788.pdf
accompaniment principal tone recognition_US4896576.pdf
accomp+rhythm (programmable fill-ins)_US4344345.pdf
any key play_US5085117.pdf
Automatic composer_EP0288800A2.pdf
automatic composer with input motif_US4926737.pdf
automatic melody composer_US5375501.pdf
automatic realtime composer_US5451709.pdf
autoplay&accomp with image display_US5391828.pdf
autoplay note duration (midi)_US4662261.pdf
autoplay to cdrom_US5138925.pdf
autoplay to cd_US5313011.pdf
autoplay with image display_US5453568.pdf
barcode rhythm_US4464966.pdf
beat detector (tempo control)_US5256832.pdf
case construction_US5164528.pdf
chord play key recognition_US4499807.pdf
chord progression algorithm_US5052267.pdf
chord progression recognition_US5218153.pdf
chord progression recognition_US5302777.pdf
chord progression tonality_US5179241.pdf
chord rhythm recognition_US4656911.pdf
combined tone generator_US5340938.pdf
composing algorithm (fugue etc.)_US5235125.pdf
CPU controlled instrument (organ_q)_US4502359.pdf
CT-201 demo note & layering generator_US4387619.pdf
CT-201 key sound select & generator_US4348932.pdf
CT-201 tone bank & tone memory_US4283983.pdf
CT-7000 stereo panning_US4577540.pdf
CT-701 barcode keyboard_US4422361.pdf
CT-701 barcode keylighting_US4437378.pdf
CT-701 CPU controlled instrument_US4534257.pdf
CT-701 sequencer autoplay_US4876938.pdf
CT-701 sequencer edit_US4622879.pdf
delay trigger function_US4901616.pdf
DG-20 construction_US5072643.pdf
DG-20 electronic stringed instrument_US4817484.pdf
DG-20 electronic stringed instrument_US5113742.pdf
DG-20_envelope follower instrument_US5147970.pdf
DG-20 input pitch processing_EP0493374A2.pdf
DG-20 pitch extraction_US5018428.pdf
DG-20 string vibration sensor_US5014588.pdf
DH-100 air flow response instrument_US4915008.pdf
DH-100 pitch alteration_US4939975.pdf
DH-100 pitch data delay_US4919032.pdf
DH-100 timbre switching_US5069106.pdf
digital cutoff filter_US5140541.pdf
digital cutoff filter_US5255215.pdf
digital cutoff gain filter_US5270954.pdf
digital instrument architecture_US4437377.pdf
digital pitch shifter_US5367118.pdf
digital resonance filter_US4489391.pdf
digital variable filter_US5157623.pdf
dsp program load (sample-clocked)_US5590364.pdf
effect addition apparatus_US4998281.pdf
effect combination algorithm (compiler-like)_US5410603.pdf
electronic drumkit_US4781097.pdf
electronic drumkit_US5009146.pdf
electronic drum_US4947725.pdf
electronic mouth organ (harmonica)_US4566363.pdf
electronic mouth organ (harmonica)_US4619175.pdf
electronic musical instrument_US4419919.pdf
electronic trombone_US5149904.pdf
Envelope control (exponential)_US4426904.pdf
envelope control (exponential)_US4426904.txt
envelope generator (sine components)_US4961364.pdf
envelope mandolin ring_US4537110.pdf
fast keyboard matrix_US5151554.pdf
foreign_Computerized system (key debounce etc.)_US4121284.htm
foreign_Computer system architecture_US4371923.htm
foreign_Single chip computer architecture_US4942516.htm
FZ-1 sampling waveforms_US5371315.pdf
FZ-1 wavetable generator_US5123322.pdf
FZ-8M midi expander (play modes)_US5206446.pdf
improved input device (overlay+LCD)_US4440057.pdf
input pitch recognition_US4924746.pdf
instrument with data modification_US4920850.pdf
karaoke tempo_US5272273.pdf
keyboard construction (plastic case)_US5164528.pdf
key scaling_US4854209.pdf
KX-101 datasette random_US4656535.pdf
KX-101 datasette_US4615024.pdf
LED matrix drive control_US4422365.pdf
Long duration aperiodic waveform generator_US4442745.pdf
melody analyzer_US5088380.pdf
melody guide tempo recognition_US4651612.pdf
mesh pattern music algorithm (QR code)_US5042079.pdf
mesh pattern music algorithm (QR code)_US5591957.pdf
modulation effect (delay LFO)_US5243658.pdf
MT-40 accompaniment (bass pattern generator)_US4561338.pdf
MT-540 effect tone generator_EP0322871B1.htm
MT-540 effect tone generator_EP0322871B1.pdf
MT-65_accompaniment switches_US4624170.pdf
MT-65 tone generator_US4590838.pdf
MT-750 tone mix synth_US5044251.pdf
MT-750 tone mix synth_US5177314.pdf
one-key-play accompaniment timing_US4630518.pdf
panning (group control)_US5127306.pdf
PCM extracting envelope data_US4958552.pdf
PCM Musical waveform generator_US5103711.htm
PCM Musical waveform generator_US5103711.pdf
PCM polyphony multitasking_US5442125.pdf
PCM tone generator (delay+autoreset)_US5283386.pdf
PCM tone waveform algorithm_EP0463411A2.pdf
PCM waveform compression (better ADPCM)_US5323154.pdf
PCM waveform processing (softsynth)_US5319151.pdf
PCM waveform processing (with effects)_US5283387.pdf
PCM with sub-CPUs+effects_US5541360.pdf
PCM with sub-CPUs (softsynth)_US5200564.pdf
PCM with sub-CPUs (softsynth)_US5584034.pdf
PD electronic musical instrument_USRE34481.pdf
PD musical instrument (triangular modulation)_US5164530.htm
PD musical instrument (triangular modulation)_US5164530.pdf
PD musical instrument (triangular modulation)_US5268528.pdf
PD noise modulation cymbal generator_US4656428.pdf
PD user presets_US5040448.pdf
PD waveform frequency generator (window function)_US4658691.pdf
PD waveform generator (only 1 line)_US5038661.pdf
pedal tone control_US4909119.pdf
percussion stick instrument_US4995294.pdf
percussion waveform+envelope_US4586416.pdf
piano pedal effects_EP0312062B1.htm
pitchbend smooth timbre change (splitzone crossfade)_US5069105.pdf
polyphonic instrument (scheduler)_US5007323.pdf
polyphonic instrument (scheduler)_US5054358.pdf
power saving_US4419917.pdf
Programmable voice memory (Allen)_US4147083.htm
PT-30 chord buttons_US4539882.pdf
PT-30 datasette sequencer_US4614983.pdf
PT-30 sequencer edit_US4633751.pdf
Ralph Deutsch_Computor Organ (Allen)_US3809786.pdf
Ralph Deutsch_Polyphonic tone synthesizer_US4085644.pdf
random LFO modulations_US5298676.pdf
RAP-10 case design_USD342274.pdf
resampling synth (effector)_US4864625.pdf
resampling synth (effector)_US5050216.pdf
resampling synth_US5025700.pdf
resampling synth_US5136912.pdf
rhythm intro-fill-in_US4643068.pdf
rhythm programming_US4481853.pdf
rhythm tempo compensation_US4674384.pdf
ROM-Pack+key lighting_US4694723.pdf
ROM-Pack sequencer_US4624171.pdf
ROM-Pack sequencer_USRE33607.pdf
SA-40 dial controlled autoplay_US5350882.pdf
sample rom-ram transfer_US4785707.pdf
sequencer algorithm (data format)_US5672837.pdf
sequencer autoplay algorithm_US4602546.pdf
sequencer autoplay chord algorithm_US4655112.pdf
sequencer autoplay loop point_US4662262.pdf
sequencer autoplay rhythm algorithm_US4683794.pdf
sequencer autoplay to cdrom (sound+pictures)_US5397853.pdf
sequencer autoplay to cdrom_US5189237.pdf
sequencer autoplay to cd_US5299181.pdf
sequencer conductor baton_US4341140.pdf
sequencer keyboard (any key play section)_US4522100.pdf
sequencer keyboard (any key play section)_US4594931.pdf
sequencer keyboard (keysplit,any key play)_US4476766.pdf
sequencer keyboard (volume any key play section)_US4361067.htm
sequencer keyboard (volume any key play section)_US4361067.pdf
sequencer natural autoplay (note correction)_US5254803.pdf
sequencer PDA (write recognition)_US5665927.pdf
sequencer rhythm+melody sync algorithm_US4742748.pdf
SK-1 sampling_US4667556.pdf
sound generation package (expansion cards)_US5020410.pdf
Sound generator US patent 4590838.txt
sound source (polyphony scheduler)_US5025701.pdf
SS-1 SoundStick_US5157213.pdf
SS-1 SoundStick_US5350881.pdf
stereo symphonic (panning)_US4648115.pdf
SuperDrums drumpad keyboard_US4757736.pdf
SuperDrums drumpad keyboard_US4972755.pdf
SuperDrums rhythm tracks_US4685370.pdf
Symphonytron hybrid instrument_US4617851.pdf
Symphonytron hybrid instrument_US4635519.pdf
Symphonytron Music playing system (CIDI_q)_US4700604.pdf
synchro start_US4413543.pdf
tone data compressing (upper DAC bit shift)_US4414878.pdf
tone generation (interpolating)_US4479411.pdf
tone parameter control_US5010801.pdf
tone scale generator_US4332181.pdf
toy keyboard with floating ball_US5381719.pdf
transform musical notes_US4664010.pdf
transpose to cd_US5159141.pdf
VA-10 dual-effect keyboard_US5463691.pdf
VA-10 modulation with voice_US5157215.pdf
VA-10 note detection_US5202528.pdf
VA-10 pitch extraction (zero-point detection) US5349130.pdf
VA-10_q melody analyzer (accompaniment)_US5510572.pdf
VA-10 voice controlled instrument_US4633748.pdf
variable length data processing_US4975835.pdf
velocity envelope generator_US4655114.pdf
velocity glide effect_US4699037.pdf
velocity instrument_US4599930.pdf
velocity instrument_US4875400.pdf
velocity instrument_US5018430.pdf
velocity (multiplexed)_US4506581.pdf
velocity (nonlinear DAC)_US4627325.pdf
velocity portamento_US4700605.pdf
VL-1 rhythm_US4478123.pdf
VL-1 sequencer_US4448104.pdf
VL-1 tone generating function_US4475429.pdf
waveform compression (from DAT)_US5329062.pdf
waveform compression pitch extraction_US5018427.pdf
waveform data generator_US4612839.pdf
waveform data read signal_US4563932.pdf
waveform DC removal_US4538496.pdf
waveform dual-port ram_US4805509.pdf
waveform generator (breath input)_US5018429.pdf
waveform info generator_US4562763.pdf
waveform interpolation (sine lookup)_US4718030.pdf
waveform normalizer_US4691608.pdf
ZZ-1 sampling instrument (touch response)_US5160798.pdf
ZZ-1 sampling instrument_US4681008.pdf

And this is Yamaha:

accompaniment bass+chord_US4184401.pdf
accompaniment (manual+automatic)_US4339978.pdf
antialiased resampling_US4701956.pdf
antialiasing waveform_US4942799.pdf
automatic composer_US4399731.pdf
Automatic performance device_US4307644.htm
combined tone generator (FM+PCM)_US5094136.pdf
combined tone generator (FM+PCM)_US5354948.pdf
Computerized music apparatus (modular SW)_EP0730260B1.htm
digital effect device_US4472993.pdf
digital filter_US4554858.pdf
digital instrument_US4351220.pdf
digitally calculating harmonics_US4132140.pdf
dual static waveform_US4635520.pdf
dual waveform generator_US4890527.pdf
Electronic musical instrument_USRE30834.pdf
Elektronisches musikinstrument_DE2202658A1.htm
equally spaced binary note codes_US4351212.pdf
FM modulation operation_US4766795.pdf
FM tone generator_US4253367.pdf
foreign_emulate FM sound IC_US6051772.html
foreign_emulate FM sound IC_US6051772.pdf
foreign_tone generator (digital portamento)_US4198892.pdf
harmonic synthesis (coefficient samples)_US4646612.pdf
harmonic synthesis instrument_US4256004.pdf
harmonic synthesis instrument_US4386547.pdf
HS-500_instrument with games_US4453439.pdf
HS-500_musical quiz_US4781099.pdf
IC testing_US5793219.pdf
instrument with cpu_USRE31004.pdf
instrument with digital filter_US4841828.htm
keyboard percussion accents_US4704932.pdf
key code data generator_US4228712.pdf
MP-1 score printer algorithm_US4485716.pdf
multi-CPU RAM access_US5376750.pdf
multiplex notes&voices in e-organ_US3610799.pdf
Musical tone synth (sound IC with DMA)_US5200565.pdf
partial synthesis instrument_US4257303.pdf
partial synthesis instrument_US4343218.pdf
Performance data processing_US4602544.pdf
physical modelling (conversion tables)_US5286914.pdf
Playcard algorithm (start point)_US4454797.pdf
Playcard algorithm_US4466324.pdf
Playcard algorithm with subroutines_US4387620.pdf
Playcard chord data US4587878.pdf
Playcard_note lengths zip_US4406203.pdf
Playcard slot_US4413545.pdf
Playcard system_US5144875.pdf
play training system_US4378720.pdf
polyphony channel dynamic allocation_US5119710.htm
PSS-104_function cards_US5300723.pdf
PSS-110_speaking instrument_US4733591.pdf
sampling instrument_US4696214.pdf
sampling tone generator_US4947723.pdf
sequencer (playback)_US4417494.pdf
sequencer tempo control_US4432266.pdf
sequencer tempo follow-up_US4402244.pdf
single chip CPU with DSP_US5567900.pdf
slur effect (portamento)_US4920851.pdf
special tone generator_US4402245.pdf
tone forming apparatus (toys_q)_EP0410475B1.pdf
tone generator (dual static waveform_q)_EP0167847B1.pdf
tone generator_(dual waveform) EP0174547B1.pdf
tone wave generator_US4179972.htm
touch response algorithm (velocity)_US4972753.htm
toy instrument blocks_US4936185.pdf
wave computation (softsynth_q)_US4616546.pdf
waveform compression_US4916996.pdf
waveform crossfade instrument_US4138915.pdf
waveform memory tone generator_US4377960.pdf
waveform mixing_US4227435.htm
waveform stereo effect_US5099739.pdf
waveshape generator (additive)_US3823390.pdf
waveshape generator (linear interpolating)_US4036096.pdf
waveshape memory instrument_US4133242.pdf
waveshape memory_US4974485.pdf
wavetable attack sample_US4706537.pdf
wavetable generator (random)_US4785702.pdf
wavetable generator_US4584921.pdf
wavetable (random percussion start)_US4524666.pdf
wavetable synth (user programmable)_US4461199.pdf

                        MAY THE SOFTWARE BE WITH YOU!

I                  CYBERYOGI Christian Oliver(=CO=) Windler                  I
I         (teachmaster of LOGOLOGIE - the first cyberage-religion!)          I
I                                      !                                     I

Last edited by =CO=Windler; 09/16/21 04:54 AM.


Joined: Jan 2021
Posts: 48
Likes: 28
Joined: Jan 2021
Posts: 48
Likes: 28
I happened to pick up a CTK-2100 (circa 2009) at a thrift store this week, so at some point I plan to dump and dissect it like I did with the 551.

I haven't opened it up yet, but I believe the hardware is the same as the visually-near-identical CTK-2000 (service manual here). The CPU is a "uPD800468P", another custom all-in-one thing. No idea yet how similar it is to the 551's GT913 (or the earlier/later uPD912 and uPD914 used in similar models from the same era), or if it's some other architecture altogether. Hopefully it won't be too hard to figure out once I get around to dumping it, though.

As for the 551 - the only real mystery left at this point is figuring out how the samples are stored in the ROM. It at least uses an external serial DAC, so I'm able to capture the PCM bitstream with a logic analyzer and inspect the waveforms.

Page 1 of 4 1 2 3 4

Link Copied to Clipboard
Who's Online Now
0 members (), 19 guests, and 1 robot.
Key: Admin, Global Mod, Mod
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by