Loading tape resets ZX81

Discussions about Sinclair ZX80 and ZX81 Hardware
sorenlorensen
Posts: 8
Joined: Mon Jul 27, 2020 10:19 am

Loading tape resets ZX81

Post by sorenlorensen »

Hi folks

Very new to the forum (first post) so go easy on me ...

I've recently got hold of an issue one 1K ZX81 - my first since I was 11 years old - and until this evening I thought it was working fine.

I've been using it with a basic composite video modification without any problems, and I replaced the broken keyboard membrane, and I've been able to type in some straightforward BASIC programs which have all worked without issue.

This evening, I finally got around to trying to load some games from audio files from my phone (which I've done previously with a couple of old Spectrums) but I'm having an odd issue with the ZX81.

Whenever I start the audio playing, the machine restarts. LOAD "" gives the expected wavy lines on screen, but as soon as the audio starts to play, the screen goes black and remains that way until I stop playing the file, upon which the machine starts up as if it had just been powered on.

If I'm honest, I'm not sure where to even start looking. Is this a ULA issue?

Thanks for any pointers anyone may have.

S
User avatar
1024MAK
Posts: 5117
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Loading tape resets ZX81

Post by 1024MAK »

Hello

There are normally only three outcomes once the machine starts trying to LOAD. If you press BREAK the LOADing is aborted. Otherwise either the program LOADs correctly and works, or if there is an error during LOADing, it will crash. Often after a crash it will ‘reset’.

Unfortunately my experience is that I find it extremely difficult to set the volume to the correct level when using a LCD screen. The volume has to be high, but not too high.

The relevant section (chapter 16) of the ZX81 BASIC manual is here.

You may want to introduce yourself in the Welcome area ;)

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
sorenlorensen
Posts: 8
Joined: Mon Jul 27, 2020 10:19 am

Re: Loading tape resets ZX81

Post by sorenlorensen »

Thanks for that - I've introduced myself publicly now ;)

Really not sure what's going on with it - it's as soon as I press play on the device to start the "tape" that the screen blanks and the machine resets. Even if I start the playback at a random point of the recording, it's the same behaviour after only a second or so.

Anyways, I'm trying to get hold of a proper tape deck to see if it's an issue with the phone and PC I've been using (they both work with my Spectrums)

Thanks again,
S
Last edited by sorenlorensen on Fri Aug 21, 2020 10:42 am, edited 1 time in total.
User avatar
1024MAK
Posts: 5117
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Loading tape resets ZX81

Post by 1024MAK »

Ahh, that’s very odd.

The Ear (input) {you are feeding audio into the ZX81 Ear socket I presume} is just a one bit input port provided by the ULA (with a five bit input port for the keyboard and another one bit input port to detect the U.K./U.S.A. {50Hz/60Hz} display refresh rate) that is then read by the Z80 on I/O port 0xFE (in fact any with address bit A0 reset).

So if it’s crashing and resetting as soon as it sees a signal... We’ll, I’m stumped :shock:

What ROM chip is fitted? Or does your machine have a EPROM?

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
sorenlorensen
Posts: 8
Joined: Mon Jul 27, 2020 10:19 am

Re: Loading tape resets ZX81

Post by sorenlorensen »

Thanks - it is the EAR - one of the first rookie things I checked :)

It's still fitted with (what I'm assuming is) the original ROM.

One odd thing is that the ULA's sitting at a very jaunty angle - only one side is fully through the board, and the other side is pretty high up. Was going to reseat that properly this evening to see if that had any effect on it.

I've attached a couple of pics of the board and the squinty ULA.
ZX81 Board
ZX81 Board
ULA
ULA
S
User avatar
1024MAK
Posts: 5117
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Loading tape resets ZX81

Post by 1024MAK »

Try this:

Code: Select all

HEX DEC Code          Comments
=== === ============  ================================================
 DB 219 IN A,(254)    ; get tape data from port 254 and store in register A
 FE 254               ; data for above instruction
 E6 230 AND 128       ; mask off tape input bit (bit 7)
 80 128               ; data for above instruction
 4F  79 LD C,A        ; transfer data from A register to C register so it is returned by the USR function
 06   6 LD B,0        ; clear B register
 00   0               ; data for above instruction
 C9 201 RET           ; return to BASIC

1 REM 123456789        must be at least 9 characters long
10 FAST
15 LET A=16514
20 POKE A,219
25 POKE A+1,254
30 POKE A+2,230
35 POKE A+3,128
40 POKE A+4,79
45 POKE A+5,6
50 POKE A+6,0
55 POKE A+7,201
60 SLOW
70 LET D=USR A         The byte that the Z80 read from the input port is returned and stored in D
80 PRINT D
90 SCROLL
100 GOTO 70
If the ULA is detecting no ear input signal, bit 7 of port 254 (0xFE) will be zero, and the program will print 0.
If the ULA does detect an ear signal, bit 7 of port 254 (0xFE) will be one, and the program will print 128.

Edit:
This version is slightly faster:

Code: Select all


HEX DEC Code          Comments
=== === ============  ================================================
 DB 219 IN A,(254)    ; get tape data from port 254 and store in register A
 FE 254               ; data for above instruction
 E6 230 AND 128       ; mask off tape input bit (bit 7)
 80 128               ; data for above instruction
 4F  79 LD C,A        ; transfer data from A register to C register so it is returned by the USR function
 06   6 LD B,0        ; clear B register
 00   0               ; data for above instruction
 C9 201 RET           ; return to BASIC

1 REM 123456789        must be at least 9 characters long
10 GOSUB 100
20 LET D=USR A         The byte that the Z80 read from the input port is returned and stored in D
30 PRINT D
40 SCROLL
50 GOTO 20
100 FAST
105 LET A=16514
120 POKE A,219
125 POKE A+1,254
130 POKE A+2,230
135 POKE A+3,128
140 POKE A+4,79
145 POKE A+5,6
150 POKE A+6,0
155 POKE A+7,201
160 SLOW
170 RETURN
Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
sorenlorensen
Posts: 8
Joined: Mon Jul 27, 2020 10:19 am

Re: Loading tape resets ZX81

Post by sorenlorensen »

Thanks for that - will give it a go when I get back from work this evening.
User avatar
1024MAK
Posts: 5117
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Loading tape resets ZX81

Post by 1024MAK »

So your Issue 1 board is interesting.
The ULA is the last of the three versions produced and includes the back porch part of the video signal, it’s type 2C210E. It’s soldered in.
Your ROM is a MOSTEK MK36809. Also soldered in.
The Z80 is a 4MHz uPD780C-1 by NEC (normal) and is soldered in.
But your RAM chip is a NEC uPD4016 2k byte RAM in a socket. This is unusual in a U.K. / European machine.
It is a U.K. / European board because resistor R30 has never been fitted.

If all the pins are soldered on the ULA, I would not worry about it being a bit drunk. You board is not the first, and is unlikely to be the last, where one of the chips is soldered in at an odd angle!

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
sorenlorensen
Posts: 8
Joined: Mon Jul 27, 2020 10:19 am

Re: Loading tape resets ZX81

Post by sorenlorensen »

Thanks again for that listing - tried it today and when playing audio I get a constant stream of 0's with the odd 128 thrown in once in a while. Should that be all 128 when there's valid, good audio?

I'll try later with a different file - this is a WAV of 1K chess that I exported from the EightyOne emulator.

Re. the RAM - that is interesting - would that hint at a repair sometime along the line? And does this mean this techinically is a 2K ZX81 ;)

S
User avatar
1024MAK
Posts: 5117
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Loading tape resets ZX81

Post by 1024MAK »

Well, you should get a good mixture of 0s and 128s, the ratio depends on the bytes in the file you are playing to it.
But keep in mind that when loading or saving, the machine runs in FAST mode. And this test program runs in SLOW mode (so you can see the screen) and it’s a BASIC program with just a bit of machine code to read the input. Hence it is a lot slower than the code in the ROM. So it will be missing some of the data that is being sent to the ear input.

I suspect either the factory ran out of 1k byte RAM chips (the TS1000 uses 2k byte RAM chips), or someone upgraded it. As it’s in a socket, I suspect the later. But it could have been a repair.

To see if the machine is seeing all the RAM, type:
PRINT PEEK 16388+256*PEEK 16389

Result
17408 = 1k byte of RAM
18432 = 2k bytes of RAM
32768 = 16k bytes of RAM

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
Post Reply