Hardware Tape Emulator

Discussions about Sinclair ZX80 and ZX81 Hardware
Post Reply
User avatar
blittled
Posts: 229
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Hardware Tape Emulator

Post by blittled »

I am currently working on a SD card reader that converts a P file to audio output using a Propeller Microcontroller on an Activity Board http://www.parallax.com/product/32910. I have hooked it up to a ZX81 and had it reading in the 1K Slot program. It seems to read it well until it gets 3/4 the way through then it drops out leaving the ZX81 with no cursor.

I'm streaming out the data as MSB first 4 pulses for 0, 9 pulses for 1. The pulses are 150uS high and 150uS low with a 1300uS pause between each bit.The output is 3.25V high with a capacitor resister filter and DAC output. Is timing critical and my timing correct? I'll post an Oscilloscope picture later this week when my life is a little less busy. :)
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Hardware Tape Emulator

Post by sirmorris »

There are no pauses between bits. Have you checked the source code for any of the p-to-wav programs available on the board? They might prove to be a good sanity check, or the nocash documents have a very good explanation of the signal.

C
User avatar
blittled
Posts: 229
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Re: Hardware Tape Emulator

Post by blittled »

The Nocash site state "The duration of the silence between each bit is 1300us" that is what I mean as a pause between bits. Also I have been doing most of my comparing using Audicity and matching up a wav file generated by Miguel Angel's conversion program with the recorded output. An Oscilloscope would probably have better resolution.

Is there a good method of recording audio and convert to P files? I tried Miguel's program on both my recorded output and a cassette output and it failed on both.
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II
User avatar
blittled
Posts: 229
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Re: Hardware Tape Emulator

Post by blittled »

The Nocash site state "The duration of the silence between each bit is 1300us" that is what I mean as a pause between bits. Also I have been doing most of my comparing using Audicity and matching up a wav file generated by Miguel Angel's conversion program with the recorded output. An Oscilloscope would probably have better resolution.

Is there a good method of recording audio and convert to P files? I tried Miguel's program on both my recorded output and a cassette output and it failed on both.

Sir Morris, I'll look at Miguel's source code to get a better idea. Thanks for the advice.
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hardware Tape Emulator

Post by PokeMon »

sirmorris wrote:There are no pauses between bits.
C
I am quite sure you are wrong, as I did a look into my program source and realized the WAV transfer through the ZX-IDE.
The documentation of nocash is correct, otherwise if there would be no pause and all pulses come one after each other how would you distinct between 0 and 1 or 4 pulses and 9 pulses ?
5 seconds silence
1-127 bytes filename (bit7 set in last char)
LEN bytes data, loaded to address 4009h, LEN=(4014h)-4009h.
1 pulse video retrace signal (only if display was enabled)
x seconds silence / video noise
Maybe he did forget to include the name of the program, or to set bit7 in the last char of the name or the length of data.

Could me maybe output level a little bit too small (5V would be surely better).
And I would take notice of this section I did write to audio file transfer, especially the audio connectors (mono):

viewtopic.php?f=6&t=1064#p10987

blittled, did you try to transfer via LOAD at all with another audio device first ? Could use the ZX-IDE as reference as well (with FAST LOADER switched off).

And does the ZX81 hang (no end with space) or does it simply not load ?
User avatar
blittled
Posts: 229
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Re: Hardware Tape Emulator

Post by blittled »

Pokemon, I was not aware that the P file format does not have the program name in it. I'll just take the file name it was saved as without the .p. Is there any references out there on the format of the various file types such as .p .81, etc? The SD routines I'm using only permit the DOS 8.3 format due to Microsoft licensing of long names.

The ZX81 hangs 3/4 of the way through. I need to unplug to reset it. Since there is no name sent there is no telling where the data will end up so I could see that crashing the ZX81.
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Hardware Tape Emulator

Post by PokeMon »

Yes, the name is stored separately and is not part of the .p File. ;)

By the way, there is no length of data sent, after filename the data follows.
The ZX81 doesn't know how much or when it's end, have to determine with the length shown in the data section (variables) which is transferred first.
So there is no memory check done if program will fit into available memory.
If not, it will simply crash.

The ZX81 stops when E_LINE is reached (received).
The last byte is normally 80h for end of variables section.
But the Slotmachine will fit into 1k ...
I use this program often for testing as well :mrgreen:

By the way, if you don't know the name you can load any file with LOAD "" - but the best is simply convert the filename into ZX charset and use it.
User avatar
blittled
Posts: 229
Joined: Fri Dec 19, 2008 3:04 am
Location: Northwestern Pennsylvania, USA

Re: Hardware Tape Emulator

Post by blittled »

Success! After fixing some bugs in my Propeller code I was able to load the 1K slot and Mazogs with no problems. The 3.5V logic in the Propeller was compatible with my Timex Sinclair 1000 ear input. The setup is rather simple. I'm using a Propeller Activity Board http://www.parallax.com/product/32910 and a Serial LCD http://www.parallax.com/product/27977. I'm adding some momentary switches and code so I can navigate through the directory on the SD card. Should I start a thread in Development on this or continue my progress on this thread since from now on I'm calling this project ZX-SD Drive?

I also will work on the Save routine and probably will develop a version on a breadboard with just the parts needed to minimize cost.
2X Timex Sinclair 1000, ZX81, ZX80Core, 5X 16K Ram Pack, ZXBlast, ZX P file to Ear Input Signal Converter, Elf II
sirmorris
Posts: 2811
Joined: Thu May 08, 2008 5:45 pm

Re: Hardware Tape Emulator

Post by sirmorris »

I think a sweet little project like this needs its own thread in development. Can't wait to hear more!
Post Reply