Author: Daniel Coulom - Website: DCMOTO Emulator - Last updated on February 5, 2018
Here is a translation:
SDLEP-READER is an Arduino-based electronic editing. It allows TO and MO tape recorders to be replaced in playback, using "cassette image" files stored in a microSD card. The card can hold up to 128 files, selectable by 7 two-position switches. This system works for all cassettes, protected or not, with all computers in the Thomson 8-bit range. It only allows reading and not recording. Tests have also been successfully conducted with other computers using cassette players with analog audio output or TTL output, making SDLEP-READER a universal replacement tool for vintage computer cassette players.
The problem of program cassettes
Cassette players have never been very reliable devices, and even with new hardware input/output errors were common. Today the mechanics are worn, the belts are distorted, the magnetic media have aged and it is even more difficult to read a cassette without error. The first generations of Thomson computers used this medium almost exclusively. The amount of programs and games on tape is impressive and a day will come when they will all be unreadable.
The replacement of a conventional tape recorder by an electronic system, without mechanical parts in motion and without magnetic support, brings absolute reliability and makes it possible to load the entire Thomson repository on cassette with great ease. It is a simple device, inexpensive, compact and very practical. In particular, copying a file on the SD card from a PC is of a disconcerting ease compared to the creation of an audio cassette with a tape recorder connected to the sound card.
Unfortunately, the loading time remains the same as that of a cassette, and this system does not allow to compete with the simulation of a floppy disk on SD card. Nevertheless, it is still of interest for cassette programs that do not exist in floppy disk format.
Description of the SDLEP-READER system
The heart of the system is an Arduino Pro-Mini, based Atmega 328 or 168. It is added a module to access a microSD memory card in SPI mode. A block of 7 switches allows you to select a file from the card. This file is read and interpreted by the Arduino, which outputs to the Thomson computer the same signals as a Thomson cassette player. The MOTOR signal, sent by the computer to the Arduino, allows you to start the transmission or to stop it.
An electroluminescent diode gives indications on the operation of the system. It flashes at the rate of the data during the transmission, then by brief pulse every two seconds when the end of file is reached (end of cassette). When the system starts, if the file selected by the switches is not found on the card, this LED flashes very quickly to indicate the fault.
The mounting power can be done in many ways:
- by pin 5 of the optical pen connector, for computers that are equipped.
- via the 12V output of TO7 and TO7 / 70.
- by a 5V or 7V power supply at 12V.
- by a 9V battery.
The Arduino program
The program of the Arduino (sketch) uses its own functions to access the SD card as quickly as possible. They were partly inspired by the SimpleSDAudio library.
In addition, access to the card is performed by a command to read bytes directly, to avoid any undesirable delay.
The rest of the program is very simple and the comments explain the subtleties.
Download the program Arduino -> sd-lep_ino.zip
The structure of the cassette image files
Cassette images in .k7 format used by emulators may not be suitable for the tape recorder simulation because they do not contain the necessary information to reconstruct the signal. In particular, they do not know the delays between blocks, nor the frequencies used, nor the protection systems put in place by the software editors.
The .wav files reproduce the analog audio signal recorded on the tape, but not the digital signal generated by the tape recorder. This one is very close to the audio signal in the case of the LEP MO, on the other hand, it is totally different in the case of the LEP TO. A 44.1 kHz 8-bit monophonic .wav file is very big for the little information contained (49 bytes for 1 bit of information in the case of the TO), but in addition, it does not represent the signal sent by the tape recorder at the computer. It is not appropriate.
A new format, giving the required information in a condensed form, has been created. This is the .lep format whose specifications are listed below:
Code: Select all
=============================================================================== Cassette Format Thomson .lep =============================================================================== A .lep file is initially a cassette image Thomson, TO or MO. It reproduces the output signal LEP TO and MO. By extension, it can also be used for all other formats of digital data recording on audio cassettes. -------------- Format TO -------------- The signal recorded on the tape is transformed into a sequence of bits according to the TO encoding system: 5 periods (4500 Hz) give a bit 0, 7 periods (6300 Hz) give a bit 1. Each useful byte starts with a start bit of 0 and ends with two stop bits at 1. The synchronization sequences and unsaved passages are replaced by 1-bit. A 44.1 kHz 8-bit mono .wav file is created. It is similar to the output of the TO tape recorder. It contains 49 samples per bit, with a high level to encode bit 1 and a low level to encode bit 0. -------------------------- - MO format and other formats ---------------------------- The mono 44.1 kHz 44-bit .wav file of the tape is shaped to contain rectangular slices of constant amplitude. -------------- .lep file -------------- Each byte of the .lep file contains the duration until the next value change of the signal. This duration N is expressed in the unit given in parameter (50 μs), with the sign + for the positive state and the sign - for the negative state. If the number N is greater than 127, there is a byte equal to the remainder of N / 127 (or 1 if the remainder is zero) assigned the sign + or - according to the direction of the slot, followed by N / 127 bytes at zero.
The SDLEP-READER module is made on a 5x3 cm strip circuit board. The Arduino is soldered to the wafer, but its connector is accessible for possible reprogramming in-situ. The module for the SD card is located at the top right on a female connector. The Arduino connector, on the top left, receives the connection cable with the computer. The connector in the middle on the right is used for the supply of 7V to 12V, in the case where the module is not supplied with 5V by the cable of connection.
The construction is very simple and poses no particular problem. All components are standard and can easily be found on the internet for a nominal fee, without any shipping costs, from Shenzen's electronics vendors.
Start by cutting the strip circuit board to the right dimensions, so that it enters the housing. Cut the tracks according to the diagram, solder the straps, the connector of the SD card, the connector + 12V, the discrete components: diode, resistance and LED.
See for the rest of the building in the original link.
See in the original link.
The SDLEP-READER module is connected on the one hand to the tape recorder connector of the computer by a special cord, on the other hand to a power source. For computers with an external optical pen connector, this is the + 5V available at pin 5 of this connector. For the TO7 and TO7 / 70, this is the external 12V power socket located near the power switch. For other computers, you can use a 5V power supply (on the left connector), or a 7V to 12V power supply (on the right connector), or a 9V battery (on the right connector). Beware, only one power supply must be used. There is a big risk if the module is powered simultaneously by both connectors.
The 7 switches numbered from 1 to 7 allow choosing the file of the SD card to use.
Code: Select all
Determining the file name (extension .lep) according to the position of the 7 switches (128 possibilities). The file name is composed of seven digits 0 or 1 describing the position of the switches 1 to 7. Example: switches 2, 4, 6 to ON -> file 0101010.lep Example: switches 5 to ON -> file 0000100.lep Example: switches 1,2,3,5,7 to ON -> file 1110101.lep
During loading, it flashes as data transfers. If the computer tries to read after the end of the file, the LED flashes every two seconds to signal the error "play after the end of the tape".
At any time, pressing the Arduino boot button rewinds the tape. To change the cassette, change the position of the switches and reset the Arduino.
The reading of the .lep file by the Arduino is very simplified. It does not consult the allocation table of the SD card during the loading of a cassette, to avoid delays incompatible with the principle of reading at constant speed. As a result, .lep files should not be fragmented. This is always the case when the card has just been formatted and no file has been deleted. On the other hand, if the card is almost full and file deletions have been made, there is a risk of fragmentation. In this case, it is advisable to make a backup copy of the files in a directory on the hard drive, format the SD card and then deliver the files.
For any further information
Please continue to the original link.