Friday, 30 June 2017

The Wet Phone Affair
( or, How to Make Your Own SD Card)

One paddling pool plus one phone equals one project. After the phone was dried out it still didn't boot well enough to get stuff off it using USB. After all attempts to get the phone to boot had ended, there was one path left: take the flash memory off the phone and read it some other way. The phone was an 8G model and the flash was implemented using an 8G eMMC module. This is a common type of flash memory with a fairly standard pinout and form factor. The package used is a 153 ball BGA with pins on a 0.5mm pitch. Not all balls are connected, so it's definitely feasible to wire this device up and read the data off. Fortunately, as this is a eMMC device, it uses the MMC interface and so it is possible to wire the chip to look like a micro SD card.

So, I removed the chip from the phone PCB (hot air gun) and attached it to a micro SD to SD card adapter. Internally these are just wiring so there's ample metal inside to attach wires.

This is the internals after it's been wired up:

This device (Sandisk SDIN8DE2-8G)  has some things that I think are peculiar to itself. Some wiring hints:

D0 to D3 just wire to the appropriate SD card signals.
The CLK and CMD signals also wire directly.
The VCCI signal needs a capcitor to ground ( I used 200nF)
There's two VSS signals on this device and two VCCs. I wired both Vcc to the SD card Vcc and bot Vss to the SD card Vss.
I put a capacitor across Vcc and Vss. (1uF)

The wire I used was from an old transformer I dismantled, it has an insulating coating that needs to be scratched off to get a good contact. Thin wire is essential. A microscope is almost essential too, if just for inspection.

After wiring the SD card/eMMC arrangement, after a couple of false starts, it worked. The data was read with no errors in dmesg for a 7.3G dd invocation.

DIY SD card...

Friday, 23 June 2017

Vortoscope Sort Of

Vortoscope (Sort Of)

The vortoscope is an optical attachment for cameras which is similar to a kaleidoscope. I want to try to experiment with  one of these, so I decided to build a copy of the Leica universal polariser part that attaches to the lenses on the front of my M8.
The attachment is a circular ring that attaches to adapters that screw on to the front of each lens.

The basic ring:

I drilled some holes that will be used to mount various  front arrangements.

The first front attachment is a 3d printed holder for a prism from an old pair of binoculars I dismantled years ago.

The thumbscrews are used to  attach this assembly to the lens adapter disks. Using different 3D printed adapters I should be able to attach various different optical adjusters...

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.