Friday, 23 June 2017

Fx502p Cassette Interface

Fx502P Cassette Interface

The Casio fx502p is an old calculator. It is from the 80s which was a time when the cassette recorder was more common that it is these days, and it was used for non volatile storage on devices like this. I have a couple of these calculators, but I don't have a cassette recorder any more, and I really would like to have a better way to store programs than a cassette tape.

So, the MK I cassette interface based on an Arduino Uno:

This breadboarded circuit was capable of reading a cassette file sent by the calculator and then sending that same file back again. The output from the cassette interface is a microphone signal of about 10mV so there's an amplifier stage to get the signal to a logic level. This breadboard proof of concept worked well, so I made a PCB version of the amplifier circuit.

The Arduino Uno is just fast enough to handle the signals from the fx502P, which are 2400Hz and 1200Hz pulses, but I wanted to try to get this circuit working with calculators and computers that use faster signals, so I replaced the Uno with a Due which is a much faster processor. It also has more flash memory and RAM so I can add the SD card interface to the Due and have enough flash and RAM space left over to cache programs received over the interface.

The SD card interface was integrated with the amplifier on a shield:

The trimmers are used to adjust the gain of the amplifier stages and also the final threshold level on the comparator stage that is used to generate the final pulses .

The control of the card is currently done using the arduino serial interface. There's a set of commands that can be sent to do things, like send the current RAM buffer back to the calculator.

This is a program file sent from the fx502P:
This can be written to SD card and then read on a PC. You can also alter the program or data on the Arduino and send that back to the calculator. In this way you can get access to program instructions it is impossible to access from the keyboard, or the alphanumeric characters that, in the case of the fx502p can only be accessed with a sequence of keystrokes.

This is the fx502P receiving a program from the arduino:

Here I have sent the memories in one fx502p, modified them to give alphanumeric characters and sent the modified memory data to a second fx502P, you can see them on the calculator on the right.

 Next, I need to add a few commands to the code to read files from SD card and also see what other calculators and computers I can get to work with the interface.
I also added code that used the bottom bit of the file number to turn the Arduino LED on if the bit is 1 and off if it is 0. This is a single bit output port. It would be very feasible to assign input and output ports to one of the memories of the calculator (perhaps just for a particular file number). This would allow the calculator to control external hardware and read sensors etc. You could also attach an I2C port to the calculator with some extra code. I'll try this as well.

No comments: