Previous Thread
Next Thread
Print Thread
Joined: Oct 2002
Posts: 1,017
M
Senior Member
OP Offline
Senior Member
M
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: http://casperelectronics.com/finished-pieces/casio-sa-keyboards/

What interested me was the following line:
Quote:

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: 995
Likes: 4
S
Senior Member
Offline
Senior Member
S
Joined: Oct 2006
Posts: 995
Likes: 4
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: http://bristol.sourceforge.net/

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

- Stiletto

Joined: Jan 2021
Posts: 33
=
Member
Offline
Member
=
Joined: Jan 2021
Posts: 33
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.

Code
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.

Code
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.


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Jun 2011
Posts: 25
Z
Member
Offline
Member
Z
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: 123
A
AJR Offline
Senior Member
Offline
Senior Member
A
Joined: Dec 2015
Posts: 123
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,119
Likes: 1
Very Senior Member
Offline
Very Senior Member
Joined: Jan 2012
Posts: 1,119
Likes: 1
@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,233
Likes: 6
Very Senior Member
Offline
Very Senior Member
Joined: Feb 2004
Posts: 2,233
Likes: 6
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: 33
=
Member
Offline
Member
=
Joined: Jan 2021
Posts: 33
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).

Code
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.


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}

Link Copied to Clipboard
Who's Online Now
5 members (Pernod, DarthMarino, Duke, Golden Child, 1 invisible), 19 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,913
Posts117,077
Members4,989
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com