Card Success
I like it when a plan comes together, especially when it doesn't work well at first.
The story starts way back when I saw that a long time ago Casio had brought out a programmable calculator that used magnetic cards to store programs. I had a Casio fx-502p many years ago and learnt a lot about programming using that machine. Things like how to fit a program into not a lot of space. There's a program I remember from the 1980's written by someone who's name I don't know, that played tic-tac-toe. You could only ever lose or draw playing against it. I am still looking for the listing...
Anyway, I found that there were a few calculators before the fx-502p, such as the fx-201p. After a wait of a year or so I managed to buy one of those and found it was programmed in a strange language that Casio called Fortran, but is better described as 'fortran'. Then I found the Casio PRO fx-1, which is an fx-201p with a card reader.
My Casio PRO fx-1 |
The fx-201p just forgets when you turn it off, which is an exquisite form of torture when you've just spent hours crafting a gem of a program and have no way of preserving it. The card reader makes it worth spending the time working on programs.
Card reading calculators aren't common, but there were a few. The main two were the HP41C and the TI59. The TI 59 filled the same niche as the PRO fx-1 in that it has lesser siblings that forget when power is removed. Both TI and Casio families have 'continuous memory' versions that don't forget when the power is removed as they keep a low level of power supplied to the RAM chips, but changing the batteries can be a problem with these. You also can't swap between different programs easily as you can with a card reader. HP had many card reader calculators in the line up as they make proper stuff. Later on manufacturers used cassette interfaces a lot, but they are slow and bulky on the whole.
Back to the PRO fx-1. After an ebay search finally came up with a PRO fx-1, I had to buy it. Unfortunately it didn't come with any cards. The cards are no longer sold by Casio any more (shame on you). They could probably be obtained from someone who has some, but I think you'd need to give them at least two unicorns in exchange. The cards are a bit oddball, too. From photographs I'd worked out that they were 93mm long, which is a bit bigger than a standard credit card. I hunted for cards of that size and they do exist, but they are rare and expensive. So, I figured that if I used a standard credit card and pulled it a bit slower then the calculator wouldn't know it was a shorter card than it was used to. Hopefully.
There was another, more serious, problem, though. The cards that Casio made had a strange band of stripes running the length of the card just below the magnetic stripe. They were printed in the same magnetic ink that the stripe is printed with, but this made no sense as intermittent magnetic stripes are just nonsense. As I had a calculator, I could investigate, so I dismantled my calculator and had a look. It turns out that, as people had guessed, the band of stripes was for optical synchronisation (of recording). There is an optical sensor in the top part of the calculator. This also explains why the cards are transparent.
This made more sense, the band of stripes isn't magnetic at all. This is a bit at odds with the manual which tells users that they can write protect a card by putting an 'anti-magnetic self adhesive strip' on the bottom stripe of the card. This implies that the band of stripes is part of the recording of a card, not the reading.
So, I needed to have an optical band of stripes on the cards. How do I do this? It occurred to me that instead of printing a set of stripes on a transparent card (You can get transparent cards, but they are another rarity) I could make holes in a normal card. Making 85 3mm x 0.5mm holes in a credit card sized card isn't exactly trivial, but when you have a CNC engraver it is in the realms of possibility.
I had a couple of expired credit cards so I put them on the CNC, created a quick DXF file, converted to gcode and had a go. The result was better than I expected. I tried the cards but they didn't work. I was expecting this as there are tow types of magnetic stripe (in general, there are actually many different subsets): low coercivity and high coercivity. Coercivity is a measure of how hard it is to magnetise something: if it's low corecivity (LO-CO) then it's easy to magnetise. If it's high coercivity (HI-CO) then it's harder. The units used for coercivity is Oe (Oersted) and LO-CO is around 300, HI-Co around 3000. HI-Co is used for cards that have permanent data on them, such as credit cards, as you don't want it to be accidentally erased. LO-CO is used for data that is rewritten often (more than once, really). The Casio cards are LO-CO, as you want to be able to record cards at will. HI-CO cards could have been used, but as they are harder to write data to, they take more power to write and hence battery life would be adversely affected.
So, the credit cards wouldn't work, but the optical stripe looked fine. I ordered some LO-CO CR80 sized blank PVC cards. In the meantime I had some help from the calculator community and was sent a photograph of a Casio card with a ruler nbext to it. Up until now I'd been sizing cards from parts of the calculator, which, it turns out, isn';t a good way to size things. This picture enabled me to determine that I'd got the size of the cards wrong and they were actually CR80 size. Good news.
There was bad news, though, as my PRO fx-1 seemed to have taken exception to being dismantled and had decided to stop responding to keypresses properly. After a disappointing hour or two where I thought I'd broken my calculator I determined that my calculator, even though it looked pristine, had actually had some battery leakage in the past. This seems to have caused some problems with the keyboard scanning, which I fixed by giving the keyboard PCB a good scrub.
With the keyboard reliable again, i was ready for the CR80 cards to arrive. Which they did. I put them on the CNC and milled some slots.
I used a 20 degree D cutter for this, at a low rpm to avoid melting the plastic. A 10 or 15 degree cutter is better.
Trying the card was disappointing, as it didn't seem to work. I couldn't get a card to store a program. As a last resort before giving up, I soldered some wires on the card read/write head and looked at the recording signals on my scope. I was interested in the data format and even if I didn't get my cards working then at least I'd be able to work out what the data format was and why there were 85 slots (for 127 steps, odd number). I was also wondering if the card reader was faulty in my machine. Looking at the recording waveforms
they looked healthy, so I looked at the read waveforms. They also looked healthy:
In fact they looked very healthy, and I thought that maybe I was pulling the cards through too fast. I slowed down the pull speed and success! I managed to record and read a card. Oddly, from that point on I have had no real problems recording and reading cards. I have also tried to pull them through too fast and too slow, but they just work, so I'm not sure why I had a problem before.
So, I can make cards for the machine. They take a while to mill, I have to mill twice, once for the cut and once to clean it up, and I have to use a scalpel to clean the swarf off the slots, but they do work.
Here's a video of me using one of the cards:
Making your own
If you want to do this, here's some details:
I used:
LO-CO cr80 blank PVC cards
0.2mm D 20 degree cutter (10 degree or 15 degree is better)
3D printed CR80 holder
https://www.thingiverse.com/thing:3571814
Gcode file to cut slots (on Thingiverse page above)
CNC 3020 (generic CNC milling/engraving machine)
No comments:
Post a Comment