From
Konstantin Butorin
→
To
All
2 November 2003
Hi All!
Can you tell me how I can make an analogue of RS-232 9 pin on the spectrum?
I wanted to use contacts from the printer and Kempston, but then I thought that they
Might come in handy :-). Therefore, you need to use free ports.
I would also like to do it via optocouplers, since I’m thinking of connecting via the port
pussy.
Schemes, tips, etc., please...
Bye All!
From
Kirill Frolov
→
To
Konstantin Butorin
4 November 2003
Press RESET immediately, Konstantin Butorin!
On Sun, 02 Nov 03 21:33:17 +0300, Konstantin Butorin wrote:
KB> Can you tell me how to make an analogue of RS-232 9 pin on the spectrum?
Well, buy a connector like DB9P...
KB> I wanted to use contacts from the printer and Kempston, but then I thought that
KB> they might come in handy :-). Therefore, you need to use free ports.
I have already written many times... There are 3 options:
1. Software emulation.
2. "Multicard" from the PC (only UART16550A is needed) in
Kondratieff modem connection diagram (or in SMUC).
3. Various loose powder options like 580BB51 or
microcontrollers.
KB> I would also like to do it through optocouplers, since I’m thinking of connecting through the port
KB> pussy.
Are you connecting the mouse without optocouplers? It’s the same here.
It is highly advisable to include all equipment into a common extension cord
"Pilot" type, the free grounding contact of which is connected to
to the nearest cactus (to remove radiation).
From
Oleg Groskow
→
To
Konstantin Butorin
5 November 2003
Hello, Konstantin!
Sunday November 02 2003 21:33, Konstantin Butorin wrote to All:
KB> Can you tell me how to make an analogue of RS-232 9 pin on the spectrum?
Catch it.
KB> Schemes, tips and more, please...
*************
─ ZX.SPECTRUM (2:5052/29.2) ───────────────────────────────────── ZX.SPECTRUM ─
Msg: 20 of 86
From : Stanislav Udin 2:5045/78.4 Thu 01 Feb 96 21:16
To : Max Vasilyev Sat 10 Feb 01 01:19
Subj: RS232C for Spec
─────────────────── ──────────────────── ──────────────────── ────────────────────
Hello Max!
07 Feb 01 18:36, Max Vasilyev -> Kirill Frolov:
KF>> How much do you think your soldering work costs
KF>> these microcircuits, writing software, debugging? I think more
KF>> cartoons.
MV> It’s worth a coursework or even a diploma, and any cartoon on the dock
MV> can be soldered.
Maybe this will help to continue the conversation about the subject:
=== Cut ===
(C) VIC, 1997, Kharkov, Ukraine
Serial port for Spectruma!!!
Description of the modification that will allow you to connect to your computer
Computer any external device designed for serialtelephone port. For example - a mouse, modem or printer. I'm ready to pay
port or software you can order from me,
by calling the phone number given at the end of the article or by writing to
addresses indicated there. So, the basic diagram:
┌──┬──┬──┐ ┌──┬──┬────┐
A12>──1┤A0│DC│Q0╞15─────────┐ <─8┤D0│PT│ │ ┌──<+5V
A13>──2┤A1│ │Q1╞14───┐ │ <─7┤D1│ │ │ │
A14>──3┤A2│ │Q2╞13 │ │ <─6┤D2│ │ │ │
│ │ │Q3╞12 │ │ <─5┤D3│ │CLK0├9──┼─┐
│ │ │Q4╞11 │ │ <─4┤D4│ │G0 ├11─╡ │
A3>──4╡E1│ │Q5╞10 │ │ <─3┤D5│ │OUT0├10─┼─┼──>FR1
OIRQ>──5╡E2│ │Q6╞9 │ │ <─2┤D6│ ├────┤ │ │
A15>──6┤E3│D1│Q7╞7 │ │ <─1┤D7│ │CLK1├15─┼─╡
└──┴──┴──┘ │ │ ├──┤ │G1 ├14─╡ │
│ └────21╡CS│ │OUT1├13─┼─┼──>FR2
D1 - 1533ID7 │ A8>──19┤A0│ ├────┤ │ │
D2 - 580VI53 │ A9>──20┤A1│ │CLK2├18─┼─╡
D3 - 580ВВ51(IK51) │ ┌─22╡RD│ │G2 ├16─╡ │
D4 - K170UP2 │ WR>┼─23╡WR│D2│OUT2├17─┼─┼──>FR3
D5,D6 - K170AP2 │ │ └──┴──┴────┘ │ │
│ └──────────────────╡ │1.75Mhz >──────────────┼───╥───────────────────────┼─┘
┌─────────────────┘ │ ┌───────────────┘
│ ┌───┬─────┬───┐ │ ╔════╪══════════════════╗
D0>──┼─27┤D0 │УСАПП│ │ │ ║ │ ┌───┬──┬──┐ ║
D1>──┼─28┤D1 │COM2 │ │ │ ║ ╓1─┼─4┤X1 │ │Y1╞13──4╢
D2>──┼──1┤D2 │ │ │ │ ║ ║ ╞─3┤УП1│ ├──┤ ║
D3>──┼──2┤D3 │ │ │ │ ║ ║ │ ├───┤ │Y2╞12──5╢
D4>──┼──5┤D4 │ │ │ │ ║ ╟2─┼─5┤X2 │ ├──┤ ║
D5>──┼──6┤D5 │ │ │ │ ║ ║ ╞─2┤УП2│ │Y3╞11──6╜
D6>──┼──7┤D6 │ │ │ │ ║ ║ │ ├───┤ ├──┤
D7>──┼──8┤D7 │ │ │ │ ║ ╟3─┼─6┤X3 │ │ ├15───<+5V
│ ├───┤ │ │ │ ║ ║ ╞─1┤УП3│D4│ ├8──┐
└─11╡CS │ │RxR├14 │ ║ ║ │ └───┴──┴──┘ ┴
WR>────10╡WR │ │TxR├15 │ ║ ╚══╪═══════════════╗ TXD
RD>────13╡RD │ ├───┤ │ ║ R1║ ┌─╫──────>2
A8>────12┤C/D│ │TxD├19─┼─1╢ 1K║ ┌──┬──┬──┐ │ ║ RXD
├───┤ │RTS╞23─┼─3╫1───┼─2┤X1│ │ │ │ ╟1─────<3
FR1 ┌──25┤RxC│ │DTR╞24─┼─2╢ │ ├──┤ │Y1╞7┘ ║ RTS
>────╨───9┤TxC│ ├───┤ │ ║ ╞─1┤C │D5│ │ ┌─╫──────<4├───┤ │RxD├3──┼─4╢ │ └──┴──┴──┘ │ ║ CTS
┌───21┤RES│ │CTS╞17─┼─6╢ │ ┌──┬──┬──┐ │ ╟3─────<5
│ ┌─20┤CLK│ DD3 │DSR╞22─┼─5╫2───┼─2┤X1│ │Y1╞7┘ ║ DCD
│ │ └───┴─────┴───┘ │ ║ │ ├──┤ │ │ ╙2─────<8
│ └─────────────────────┘ ║ └─1┤C │ ├──┤ SG
┴ ║ ├──┤ │Y2╞6─┐ ┌─────>7
╙3─────3┤X2│D6│ │ │ ┴ DTR
└──┴──┴──┘ └───────>20
pin 4 D5 and D6 connect to GND
Pin 5 D5 and D6 connect to -12V
Pin 8 D5 and D6 connect to +12V
Controller port addresses:
#80F7, #81F7, #82F7, #83F7 - timer ports
#90F7, #91F7 - COM1 interface ports
When working with a port, you first need to program the
measures for frequency division mode (mode 3). In this case, it is necessary to follow
Make sure that the resulting frequency does not go beyond the permissible limits.
tim values (maximum frequency at the RxC/TxC inputs of the USART according to
passport is 615 KHz).
The type of connector used is DB-25P (standard external connector
modem). For those who don't know, DB-25P stands for connector type
"fork" or "dad".
To connect COM2 you need to use 3 microcircuits
(BB51, UP2, AP2). The USART inputs 9 and 25 must be supplied together with
then the signal FR1 is the signal FR2 from the timer, and to input 11 the signal from 13output ID7. For TxD signal you must use free
half D5.
For additional information, please contact directly
me.
┌─────────────────────────────── ───────────────────────────────┐
│ (c) Vic at 10.29.96 │
│ Phone: (0572) 10-50-26 │
└─────────────────────────────── ───────────────────────────────┘
Now a little history...
It all started when a guy came to me with two boards -
mi on 174УН4А, which we hooked up to the tape recorder port. Before this-
there were a couple of articles in magazines and ordered from some co-operation
Here is a wiring diagram for some kind of gadget called “Modem
for ZX".
Of course, nothing worked out for us, but the fact itself was enough
for a long time. Afterwards there were several diagrams that I saw, but due to
lack of software and experience in programming, they were left without
attention. But in vain - there were some very good solutions there.
Then there was a short break, during which I
I tried to use pieces of AON circuits, but there were no results.
Then a modem diagram appeared in the Spectrofon magazine, for playing
Modem steward. At the same time, we finally hooked up with Sinclair
AOHy. And as a result, I had the Spectrofon version, and
Comrade - AONovsky. We found a program for Tape Modem and things went well.It's in full swing. We spoke for the first time using a computer, and not
of any kind, but Speccy. We downloaded files, albeit at speed
1800 baud, but then it was very cool. I still remember when we
broadcast Satisfaction, ZX-FORMAT'1... I even tried to write
software for this type of modem, but in the end I realized that it was
does not have any special prospects.
More and more attracted by the idea of communication with pussies and
greater speed. So, a standard had to be chosen, and with this
HAYES became the standard. That's why I started working in this direction -
research, read literature, asked people, and in the summer of 96
The first modem appears to me - Faylin 1200 without protocols. This-
an hour is of course funny (for Kharkov), but for reference it’s
It wasn't entirely bad, even very good. And so I began to develop
botky modem connection interface, fortunately in electronics it has become
At this time it is relatively good to understand. And that's all at last
was assembled and turned on and, as always, nothing happened the first time
it came out.
After wasting two days, everything worked so well that I was even surprised -
I wonder how it could not have worked before. This significant date
- September 7, 1996.
In the evening of the same day I contacted the pisish BBC for the first time and that’s it
what I read and heard about BBS suddenly appeared before my eyes -
we, and, as they say, I felt the steepness of the phenomenon. At this time II used some kind of terminal written under BB51, but I doubt it
that the author wrote it for a really working modem, since there
there were several glitches that were absolutely impossible to work with
possible. I fixed it, improved it a little, added exchange protocols
and thoroughly enjoyed my work. But the question arose about improving the quality
you and here the scheme for expanding graphics to
512x192 mode. It was a real thrill to work, especially
when I saw the BBS screensavers in 85 characters per line mode, then
there is no breaking of lines - as it SHOULD BE. After that I added
ANSI support, YMODEM protocol, a bunch of modes and to this day
I use it.
An interface scheme has also now been developed that provides
connecting any ISA card to a sinclepy, that is, multi-
dem internal, etc. Also connects absolutely easily
screw, mouse, normal flops. Also while I'm just you-
sent me the diagram of his interface, it became known about one more
Kharkov development, which is really not worth attention at all
at least for the fact that the modem ports are accessible using the mask #FFFD This
the development was notorious under the name "Shepelevskaya
diagrams"...
=== Cut ===
Stanislav
-+- ZX-Spectrum
+ Origin: Speccy rulez forever!!! (2:5045/78.4)
**************
Best regards, Oleg. [ZX]
From
Konstantin Butorin
→
To
Kirill Frolov
6 November 2003
Hi Kirill!
04 November 2003 19:05, Kirill Frolov wrote to Konstantin Butorin:
KB>> Can you tell me how to make an analogue of RS-232 9 on the spectrum
KB>> pin?
KF> Hy buy a connector like DB9P...
Not funny, damn it... Moreover, it was originally 25 pin...
KB>> I wanted to use contacts from the printer and Kempston, but then
KB>> thought they might come in handy :-). Therefore, we need to use
KB>> free ports.
KF> I have already written many times... There are 3 options:
KF> 1. Software emulation.
KF> 2. "Multicard" from the PC (only UART16550A is needed) in
KF> Kondratiev modem connection scheme (or in SMUC).
KF> 3. Various options for loose powder like 580BB51 or
KF> microcontrollers.
Will the 580BB51 emulate the port? Most likely everything will come down to point 1
Regarding point 1. Has anyone done something like this before? At least an external modem
connect?
KF> Are you connecting the mouse without opto-couplers? It’s the same here.
What if I want the modem to attach itself to my pussy? Without them too?
But I don’t have a mouse yet... :-(KF> It is highly advisable to include all equipment in a common extension cord
KF> type "Pilot", the free grounding contact of which should be hooked to
KF> the nearest cactus (to remove radiation).
And on the battery, so that the neighbors have more fun :-)
Bye Kirill!
From
Kirill Frolov
→
To
Konstantin Butorin
9 November 2003
Press RESET immediately, Konstantin Butorin!
On Thu, 06 Nov 03 22:09:06 +0300, Konstantin Butorin wrote:
KB>>> Can you tell me how to make an analogue of RS-232 9 on the spectrum
KB>>> pin?
KF>> Hy buy a connector like DB9P...
KB> Not funny, damn it... Moreover, it was originally on 25 pin...
You write it yourself: 9 pin. And it also comes in RJ-4x...
KF>> I have already written many times... There are 3 options:
KF>> 1. Software emulation.
KF>> 2. "Multicard" from the PC (only UART16550A is needed) in
KF>> Kondratiev modem connection scheme (or in SMUC).
KF>> 3. Various options for loose powder like 580BB51 or
KF>> microcontrollers.
KB> Will 580ВВ51 emulate the port?
I don't know what you wanted to say, but 580BB51 is a controller
serial asynchronous and synchronous interfaces compatible with
rs232. At speeds up to 9600 in asynchronous mode.
KB> Regarding point 1. Has anyone done something like this before? At least an external modem
KB> connect?
I’m already writing for the Nth time, I don’t know what people read. I did. There (to the modem, pussy)you need 3 wires (TX, RTS, DTR), from there 2 (RX, DCD) or 3 (RX, DCD, CTS).
RTS is required to block transmission at the moment, Spectrum
not ready to receive. TX and RX too. The rest is for management.
KF>> Are you connecting the mouse without optocouplers? It’s the same here.
KB> What if I want to attach a modem to my pussy? Without them too?
Yes, at least cling to it. Just agree on the levels.
KF>> It is highly advisable to include all equipment in a common extension cord
KF>> type "Pilot", the free grounding contact of which should be hooked to
KF>> the nearest cactus (to remove radiation).
KB> And on the battery, so that the neighbors have more fun :-)
Nothing will happen to your batteries. There's only about a hundred volts there.
units or tens of milliamps with a short circuit on the battery.
From
Alexander Araktcheew
→
To
Oleg Groskow
11 November 2003
Hi, Oleg!
On Wednesday November 05 2003 Oleg Groskow wrote to Konstantin Butorin:
KB>> Can you tell me how to make an analogue of RS-232 9 on the spectrum
KB>> pin?
OG> Catch.
KB>> Schemes, tips and more, please...
OG> === Cut ===
OG> (C) VIC, 1997, Kharkov, Ukraine
OG> Serial port for Spectruma!!!
[...]
So this circuit doesn’t seem to handle more than 9600 normally.
It’s better to do it on a microcontroller - the circuit was for both a pc/2 mouse and
rs-232 modem. There is also a data buffer there.
True, not all signals are used there.
Bye, Oleg!
Arc/exRLDG
From
Konstantin Butorin
→
To
Alexander Araktcheew
26 November 2003
Hi Alexander!
November 11, 2003 23:27, Alexander Araktcheew wrote to Oleg Groskow:
KB>>> Can you tell me how to make an analogue of RS-232 9 on the spectrum
KB>>> pin?
KB>>> Schemes, tips and more, please...
AA> So this scheme doesn’t seem to handle more than 9600 normally.
AA> It’s better to do it on a microcontroller - the circuit was for both a PC/2 mouse and
AA> for rs-232 modem. There is also a data buffer there. True, not all signals are there
AA> are used.
Can you post a schematic for rs-232? preferably in a letter, I have some files
cuts off
Bye Alexander!
From
Kirill Frolov
→
To
Konstantin Butorin
7 January 2004
Press RESET immediately, Konstantin Butorin!
On Wed, 26 Nov 03 23:01:26 +0300, Konstantin Butorin wrote:
KB> Can you post a diagram for rs-232? preferably in a letter, I have some files
KB> trims
Figure it out for yourself:
Newsgroups: fido7.zx.spectrum
X-Comment-To: Sergey Cherbynin
From: Kamil Karimov
Date: Fri, 05 Dec 03 21:46:57 +0300
Subject: Pros
Hello, Sergey!
Let's continue the conversation about the keyboard controller for Spectrum.
KK>> I already wrote that the circuit of this controller is universal.
KK>> After a little modification, it is perfect for
KK>> connecting an IBM AT keyboard.
KK>> If ALL wants, I can throw it in the echo.
SC> Of course we want, but it’s even better to make one controller for mouse and keyboard.
AT> Is there a circuit that allows you to simultaneously connect a PS/2 mouse and keyboard
AT> at the same time? What about the situation with additional
AT> keys?
It seems to me that the most important thing is to connect the keyboard, that’s all
the rest are additional bells and whistles. The proposed scheme allows
fully emulate the operation of the Spectrum key matrix usingwhile for decrypting the keyboard port and for buffering
circuit elements that are already on the board.
All keys are scanned perfectly, the only problem is
to decide which one to hang what on.
AT> PS/2 connector is used to connect only a keyboard and mouse?
AT> Is it possible to connect a modem, etc. through it?
I threw a modified mouse controller circuit into the echo, which
emulates a modem connection to the Spectrum using the Kondratiev scheme.
In practice, this comes down to changing the base address of the port
controller (A4 and A5 are swapped), and the output is PS/2
TTL <-> RS232 level converter is connected
(for example MAX232). In the existing firmware version for the modem
a 126-byte receive buffer has been implemented, which greatly simplifies
development of programs for working with a modem.
By the way, this circuit is a full-fledged COM port,
working using the XON/XOF protocol.
AT> Is it possible to immediately modify the circuit for programming
AT> straight from the spec?
It's possible.
==== zxkbd10.txt ===============================
IBM PC keyboard -> ZX Spectrum keyboard v1.0
(c) 2003 Kamil Karimov E-mail:k2k@list.ru
===============================================================================
DD1A DD1B1┌───┐ 4┌───┐ VD1
/RDFE─────────┬──────┬───┤& 0───────────────┤& 0──────┤<├──── /WAIT
│ └───┤ЛА3│3 ┌──────┬────┤ЛА3│6
│ 2└───┘ │ R1 ┌┴┐ 5└───┘
+5V │ │ 1K │ │
R2..R4 │ │ │ └┬┘ VD2
10K ┌──┼──┐ │ ┌───────────────┘ └──┤>├───┐
┌┴┐┌┴┐┌┴┐ │ │ \ ─┴─
│ ││ ││ │ │ │ +5V
└┬┘└┬┘└┬┘ │ │ DD2 ┌───────────────────────┤
│ │ │ │ │ 1┌───┬─────┬───┐20│ 1┌───┬────┬───┐20│
│ │ └──│──│───0/RS│ MCU │VCC├──┘ ┌──┤DIR│ <> │VCC├──┘
MDAT─┴──│─────│──│───┤PD0│ │PB7├────╫──│──┤ A1│ │/OE0───┐
MCLK────┴─────│──│───┤PD1│ │PB6├────╫──│──┤ A2│ │B1 ├───│──KA15
┌────────│──│───┤X2 │ │PB5├────╫──│──┤ A3│ │B2 ├───│──KA14
Q1 │ ┌┐ ┌───│──│───┤X1 │ │PB4├────╫──│──┤ A4│ │B3 ├───│──KA13
10Mhz├┤││├┤ │┌─│───┤PD2│ │PB3├────╫──│──┤ A5│ │B4 ├───│──KA12
C1,C2│ └┘ │ └│─│───┤PD3│ │PB2├────╫──│──┤ A6│ │B5 ├───│──KA11
20 ─┴─ ─┴─ │ └───┤PD4│ │PB1├────╫──│──┤ A7│ │B6 ├───│──KA10
─┬─ ─┬─ │ ┌───┤PD5│AT90S│PB0├────╫──│──┤ A8│1533│B7 ├───│──KA09
├────┴────│─│───┤GND│-2313│PD6├──┐ ║ ├──┤GND│ АП6│B8 ├───│──KA08
─┴─ │ │ 10└───┴─────┴───┘11│ ║ │10└───┴────┴───┘11 │ 9┌───┐8│ │ │ ║ ─┴─ DD3 ├──┤& 0─┐
VD3 │ │ └─║──────────────────────┴──┤ЛА3│ │
/NMI───┤>├─────┘ │ ║ +5V 10└───┘ │
│ ║ │ 1┌───┬────┬───┐20 +5V DD1C│
VD4 │ ║ └──┤DIR│ <> │VCC├───┘ │
/RES───┤>├───────┘ PB0╟─────┤ A1│ │/OE0────────────┘
PB1╟─────┤ A2│ │ B1├──────KD0
PB2╟─────┤ A3│ │ B2├──────KD1
+5V───┬────┬────┐+ PB3╟─────┤ A4│ │ B3├──────KD2
C3,C4─┴─ ─┴─ ─┴─ C5 PB4╟─────┤ A5│ │ B4├──────KD3
0.1 ─┬─ ─┬─ ─┬─ 10.0+10V PB5╟─────┤ A6│ │ B5├──────KD4
│ │ │ PB6╟─────┤ A7│ │ B6├─KD5
GND───┴────┼────┘ PB7╙─────┤ A8│1533│ B7├─KD6
─┴─ ┌──┤GND│ АП6│ B8├─KD7
│10└───┴────┴───┘11
─┴─ DD4
Микросхемы:
DD1 1533ЛА3 (74ALS00)
DD2 AT90S2313
DD3,DD4 1533АП6 (74ALS245)
Цоколевка разьемов AT - клавиатуры:
5-контактного разьема:
1 - MCLK
2 - MDAT
3 - /RESET (не используется)
4 - GND
5 - +5V
Разьем PS/2:
┌──┐ ┌──┐
N/C 6 ──── ┌┘* └─┘ *└┐ ─── 5 MCLK+5V 4 ──── │* *│ ─── 3 GND
N/C 2 ──── └─┐* *┌─┘ ─── 1 MDAT
└─────┘
View of the socket from the contact side (not from the solder side)
Iron:
=======
This controller is not connected to the Spectrum system bus,
and to the bus of his keyboard. In addition to food, they also go towards it
only two signals:
1. Keyboard port reading strobe /RDFE;
2. Z80 processor /Wait signal (pin 24).
If the KA08..KA15 keyboard scanning signals come from the bus
processor addresses through decoupling diodes, then you need them
pull up to +5V with 10 Kom resistors per line.
The same applies to signals KD0..KD4. They too
must be pulled up to +5V with 10 Kom resistors (usually they
already present on the keyboard port inputs).
The two remaining free controller outputs can be
use to generate /RES and /NMI Spectruma signals.
Quartz can be set to any frequency up to 10 MHz, or supplied from the board
Spectrum 7 MHz to pin X1 of the microcontroller.
Program:
==========
Version 1.0 of the controller firmware supports operation
with any IBM AT keyboard.
Unlike Zonovsky, this controller does not slow down operation
Spectrum when the keys are not pressed (WAIT is not generated). Yes
and due to the high speed of the AVR, the waiting time
very little when the keys are pressed.
LED VD2 lights up if at least one key is pressed.You can press up to 8 keys simultaneously (unless
they are recognized in the keyboard itself).
Layout of additional ones (relative to Spectrum ones)
keys are still preliminary (the first thing that came to mind).
It is possible, like Zonovsky, to provide several layouts.
If anyone has any good ideas about this, it would be my pleasure.
I'll listen.
I'm still working on the firmware. If anyone wants to
assemble the controller upon request, I will send the latest version.
With respect to all Speccy fans
Kamil Karimov.
Newsgroups: fido7.zx.spectrum
X-Comment-To: Aleksey Tarasow
From: Kamil Karimov
Date: Sun, 07 Dec 03 23:41:42 +0300
Subject: Pros
Hello Alexey!
07 Dec 03 21:46, Aleksey Tarasow -> Kamil Karimov
KK>> It seems to me that the most important thing is to connect the keyboard, that’s all
KK>> the rest are additional gadgets.
AT> I don’t agree. For example, my Camston rat works very poorly.
AT> I'm sinning both the controller and the mouse itself, so s
AT> I'll be happy to switch to PS/2. Especially if she supports the video.
With the keyboard controller circuit that I propose, it is impossible
work with several devices at the same time, but it works greatfits with any Spectrum circuit, since it uses its elements
for decryption and buffering. Moreover, with the support of several
devices cannot be provided with no-WAIT mode because it will have to
track all calls to the controller from the Z80.
And for connecting additional devices, in particular a mouse and a modem
I suggest using another controller and also on the AVR.
I have already created a circuit for connecting two PS/2 devices, I’m trying it out
Connecting a mouse and modem is probably the best option.
The circuit provided elements for reprogramming the AVR to
the Spectrum itself. All that remains is to write a program to work with this
programmer. you'll have to write an assembler for AVR :).
With this approach it will be possible to actually reflash this
controller for connecting various devices to the Spectrum, which
As I understand from the end of the letter, that’s what you wanted.
KK>> All keys are polled perfectly, the only problem is
KK>> to decide which one to hang what on.
AT> There’s nothing to decide here. There are already several standards.
AT> I am interested in the Pro standard, ...
AT> I can give the distribution by ports.
Definitely. KK>> ... TTL <-> RS232 level converter is connected
KK>> (for example MAX232).
AT> Can you tell us more about the converter?
AT> Diagram, description for dummies (that is, for me :).
To connect a modem, MDAT(RXD) and MCLK(TXD) lines, via
The ADM232 chip is connected to a 9 (or 25) pin
connector, which is usually installed on IBM/PC COM ports.
DD5
┌───────────┐
+5v ──────┬───┤16 1├───┐
C1 ─┴─ │ │ ─┴─ C3
─┬─ │ +5/12v │ ─┬─
└───┤2 3├───┘ X1
┌───┤6 4├───┐ DB9 DB25
C2 ─┴─ │ │ ─┴─ C4 ┌─┬─────┬──┐
─┬─ │ │ ─┬─ │1│ DCD │ 8│
GND ────┬──┴───┤15 5├───┘ ├─┼─────┼──┤
│ ├───────────┤ ┌────┤2│ RD │ 3│
└──────┤10 7o─────────┐ │ ├─┼─────┼──┤
MCLK(TXD)───────┤11 14o─────────│────│────┤3│ TD │ 2│
├───────────┤ │ │ ├─┼─────┼──┤
──┤8 9o── ├────│────┤4│ DTR │20│
┌──┤13 12o───┐ │ │ ├─┼─────┼──┤
│ └───────────┘ │ └────│────┤7│ RTS │ 4│└──────────────────│──────────┘ ├─┼─────┼──┤
MDAT(RXD)───────────────────────┘ ┌──┤5│ SG │ 7│
─┴─ └─┴─────┴──┘
DD5 ADM232 - level converter for RS232;
C1..C4 - 0.1 µF;
X1 - DB9 or DB25 connector (plug).
KK>> I'm still working on the firmware. If anyone wants to do it themselves
KK>> assemble the controller upon request, I will send the latest version.
AT> Listen, maybe I can buy a ready-made controller from you?
AT> It is VERY desirable that it supports both mouse and keyboard at the same time.
For the keyboard controller, a board was traced in PCAD and sent
for production (so far I have ordered 10 pieces).
Should receive it by the end of the month.
AT> And such a question
AT> 1: is it possible to have several PS/2 ports on one machine at once?
AT> Let's say 1 - keyboard, 1 - mouse and 2 - catfish port.
AT> If yes, what will be the scheme in this case.
Above, as you understand, I propose the option:
1 - separate keyboard controller;
2 - controller for connecting two two-wire devices
with the possibility of reprogramming on the Spectrum itself.
AT> Question 2: as I understand it, the circuit can be modified to the point of possibility AT> replacing ROM firmware from Speccy? Is that so? It would be very nice
AT> and the ability to connect multiple devices
AT> (you need to work with the modem - download one, firmware; need
AT> work, say with a light pen - load another).
Best regards, Kamil.
= Emulators hang out here (2:5030/827.2) ==================== ZX.SPECTRUM =
Msg: 2185 of 2198 -788
From : Kamil Karimov 2:5080/500.12 07 Jan 03
To : ALL 12 Jan 03
Subj: mouse controller
===================================================================================
Hello, ALL!
I look at the screen and see: Kirill Frolov is drawing something Vadim Chumachenko!
VC>> what about the mouse controller circuit on Atmel? did you finish it? available in
VC>> Stakhov diagram (for ps/2 mouse).
KF> Hardly.
============================================================
PS/2 -> Kempston Mouse Adapter v2.0
(c) 1999-2000 Studio STALL (Eugene Stahov)
(c) 2003 Kamil Karimov E-mail: k2k@list.ru
============================================================
DD1
┌───┐
A7──────┤1& │
A6──────┤2 │
A4──────┤3 │8
A3──────┤4 0─────┐
A2──────┤5 │ │ A1──────┤6 │ │
A0──────┤11 │ │
/M1──────┤12 │ │
└───┘ │
DD2A │ 5┌───┐ DD2B 9┌───┐ VD1
1┌───┐ └──┤1 ├────────┬──────┤1 ├───|<|─── /WAIT
A5──────┤1 ├────────┤ │6 │ ┌───┤ │8
/IORQ────┤ │3 4└───┘ │ │ 10└───┘
2└───┘ │ │ DD2C VD2
│ ├───────────|>|──────────┐
/CS │ │ LED │
┌───────────────────────┴──│────────────────────┐ ┌┴┐
│ ┌───────────────────────┘ │ │ │R3
/WR────────│──│─────────────────────────┐ +5V│ └┬┘1K
│ │ ┌────│────────────────┤ │ │
│ │ 1┌───┬─────┬───┐20│ │1┌───┬────┬───┐20 │ ─┴─
/RES───────│──│───0/RS│ A │VCC├──┘ └─┤DIR│ <> │VCC├─┘ │
MDAT─┬─────│──│───┤PD0│ T │PB7├─────────┤ A1│ │ G 0───┘
MCLK─│───┬─│──│───┤PD1│ 9 │PB6├─────────┤ A2│ │B1 ├─────D7
│ │ │ │ ─┤X2 │ 0 │PB5├─────────┤ A3│ │B2 ├─────D6
7MHZ─│───│─│──│───┤X1 │ S │PB4├─────────┤ A4│ │B3 ├─────D5
│ │ └──│───┤PD2│ 2 │PB3├─────────┤ A5│ │B4 ├─────D4
│ │ └───┤PD3│ 3 │PB2├─────────┤ A6│ │B5 ├─────D3
A8──│───│────────┤PD4│ 1 │PB1├─────────┤ A7│ │B6 ├─────D2
A10──│───│────────┤PD5│ 3 │PB0├─────────┤ A8│ │B7 ├─────D1
│ │ ┌───┤GND│ │PD6├──┐ ┌──┤GND│ AP6│B8 ├─────D0
│ │ │ 10└───┴─────┴───┘11│ │10└───┴────┴───┘11
│ │ ─┴─ DD3 │ ─┴─ DD4
/RD──│───│─────────────────────────┘
│ └──┐
┌┴┐R1 ┌┴┐R2
│ │8K2 │ │8K2
└┬┘ └┬┘
└──────┴──────+5V
PS/2 Pin Layout
┌──┐ ┌──┐
N/C 6 ──── ┌┘* └─┘ *└┐ ─── 5 MCLK
+5V 4 ──── │* *│ ─── 3 GND
N/C 2 ──── └─┐* *┌─┘ ─── 1 MDAT
└─────┘
View of the socket from the contact side (not from the solder side)
Chips:
DD1 1533LA2 (74ALS30)
DD2 1533ЛЛ1 (74ALS32)
DD3 AT90S2313 (or AT90S1200)
DD4 1533AP6 (74ALS245)
Decoding is hard: all low-order bits of the Z80 address are involved.
(but this is not necessary, in many cases you can get by
with a smaller number of bits, connect unused inputs to +5V).
For example, in Quorum I use addresses for decryption
A7, A6, A5 and A4, the remaining inputs of the address lines are connected to +5V.
The circuit is designed to connect to a computer that does not have
conflicts on port #DF.
If there is still a conflict, or there is port #FF, then you need to
assemble the control circuit /IORQGE :(.
How is the interface with the computer implemented?
At initial power-up or on the /RESET signal, the controller
checks the mouse connection, and the VD2 LED (LED) lights up.
When the mouse is connected, after approximately 0.5 seconds, the LEDgoes off (this is the time of the internal mouse test), this is a sign
the controller is ready for operation.
If the mouse is not connected or is faulty, the LED
continues to light, and when software polls the mouse from its ports
code 255 is read (no mouse).
You can connect the mouse at any time, and the LED
goes out, and button codes and buttons begin to be read from the mouse ports
X and Y coordinates.
At a controller clock speed of 7 megahertz, the sleep cycle
lasts about 3 microseconds.
This version of the program emulates the operation of a Campston mouse -
that is, it provides information about pressing two buttons and two coordinates.
Ports:
#fadf (64223) => D0 - right, D1 - left buttons (0 - press).
#fedf (65427) => also buttons
#fbdf (64479) => X coordinate (increasing code to the right)
#ffdf (65503) => Y coordinate (up code increase)
When you turn it on for the first time, if you do not touch the mouse, the ports should
read codes:
255 128 96
10 PRINT AT 0.0;
20 PRINT IN 64223;" ";: REM 255
30 PRINT IN 64479;" ";: REM 128
40 PRINT IN 65503;" ";: REM 96
50 PLOT IN 64479,IN 65503/1.5
60 GOTO 10
The scheme provides the ability not only to read, but also
write information to the controller, which allows you to control
its mode of operation.
In particular, it is possible to provide a connection to the controller
mice in 3D standard - Mouse or Intelli Mouse.In this case, you can read the Z coordinate via port #fedf (65427)
and codes for pressing additional buttons.
By adding one chip (TM2 dual trigger), you can
program the controller directly in the Spectrum.
The scheme turned out to be universal, and its possibility
reprogramming allows you to connect to the Spectrum via
2 (I2C or RS232) or 3 (SPI) wire interface:
- external modem (via AD232 level conversion circuit);
- ADC;
- DAC;
- digital temperature sensors;
- flash memory;
-+--+--+- firmware codes version 2.0 -+--+--+-
:1000000016C09398869B04C00AC0826082601895CF
:1000100097BB58BB849B03C038BB859948BB939A58
:100020000000829BFECF9398F7BA98BB1895FF24E7
:100030009FEFF7BA98BB08E001BB08E002BB00E401
:100040000BBF02E005BF00E809BF04E00EBDF89455
:100050000FED0DBF5FEF30E840E68827939A2FEF52
:10006000689499D062D098F337D088F32A3F79F713
:1000700087D032D060F330D050F324EFE89487D0AB
:1000800054D028F380D028D010F32A3F01F793985A
:10009000789414E11A9551F424EFE89478D045D07F
:1000A00018F071D019D008F4D2CF1AE070D014D063
:1000B00088F3D22E68D010D068F3622F64D00CD0B1
:1000C00048F3722F360F470F5FEFD0FA51F9D1FA8C
:1000D00050F903E05027DDCF8898899881FD23C02F
:1000E0008099FCCF19D0F8F011D0E8F018E014D0C6
:1000F000D0F080990894279509D0A8F01A95B9F7FF
:100100000BD088F003D078F007D068F081FD0BC0E9
:10011000819BFCCF8894089581FD05C08199FCCF17:10012000889408958898089408959198899A20D081
:100130009098889A1FD089981DD018E0EDDF90F331
:10014000279510F0889A01C08898E0DF58F31A9537
:10015000A9F7E2DF40F388980EF0889AD7DF10F312
:10016000DBDF08F38898D2DFF0F2D6DFE0F2CECF03
:1001700004E601C005E00A9500C000C0E1F708955B
:1001800000270DBD0BC00DEF0DBD04E507C005EF49
:100190000DBD02E503C00AEC0DBD08E90CBD8D7F65
:0201A0000895C0
:00000001FF
Everything is good, ALL!
-+- ∙ . Sherwood Station. ∙
+ Origin: ...... (Fido 2:5080/500.12)
- Емулятопщики тусуются (2:5030/827.2) -------------------------- ZX.SPECTRUM
-
Msg: 1963 of 2000
From : Wlad Sorokin 2:5020/6664.14 22 Feb 00
To : All 24 Feb 00
Subj: Mouse on ZX
-
Big Hello All, %^& &&^# !!!!!
The scheme of the Kempston mouse interface from ZX format flew by.
and remembered how, two years ago,
I connected the mouse from the AMIGA to my pentagon, and thought about what I should do
опять соорудить чего-нибудь сободное, тем более, что софта под
мышь сейчас намного больше, yes and spec with мышой posolidnee by
watched... :)
Tut zhe voznikla problema - where to get an amizhnuy mouse, (from "poiska"
I can't find a problem now, even though it's not very big...)as usual, there was no mouse nearby, except for the active one,
but I didn’t have the chance to break it :)
Well, I decided to connect it...
And this is what happened - only 3-4 microcircuits, normal movement speed
(unlike many passive mice), fully compatible with Kempston,
(except for the missing middle button)....
Unfortunately, the circuit uses the processor's WAIT signal, although it does not last long.
and only while reading from the port...
Below is the circuit and firmware for the PIC16c620 microcontroller, (osc=hs wdt=off)
although it will get along well in 16c84,16F83,16c622 etc, the only thing is
that all of them should be at an operating frequency greater than 10 MHz...
By the way, at the moment I don’t have 561la9 installed...
I got 561lp5 in the Pentagon itself, on the video output (it’s like an inverter there)
and to check I typed-
10 PLOT IN 64479,IN 65503:GO TO 10
cool! (if you don’t go beyond the top or bottom of the screen)
if instead of certain lines the trail goes in an unclear direction -
the problem is the clock frequency (a separate quartz will help)
and also, on the Spectrum data bus there are resistances of 10k to 5v, so inside
they cost a controller too! hence the conclusion...(you can tear it out)
and also, 14 MHz from the board - you need to skip
through a SEPARATE inverter or hang additional quartz on 15-16 legs of PIC-a
(from these legs you will also have to install two 10-30 pF capacitors to ground)
By the way, with this solution you can remove the “native” quartz from the board...ps. The firmware is written for 14 MHz, but it works fine at 14.31818 MHz
(fortunately there are a lot of such quartz on dead 286-386)
The Wait signal sometimes needs to be passed through a diode (plus on 24n.Z80)
P.P.S. This is a beta release!
System bus
||
||
||-A10-------------------------+
||-A8------------------------+ |
||-RESET---------+ x+5v | | x+5v
|| 4| |14 | | |
|| +---++-++---+ | | |
||-D0-------6|Rb0|CPU|Ra0|18--+ | |
||-D1-------7|Rb1|IC1|Ra1|19----+ |
||-D2-------8|Rb2| |Ra2|1----------)-----+
||-D3-------9|Rb3| |Ra3|2------+ | | From mouse
||-D4------10|Rb4|pic|Ra4|3----+ | +----+|//_
||-D5------11|Rb5|16c|---| | | (o o o|o o)
||-D6------12|Rb6|620|xt.|15 | | o o|o o /
||-D7------13|Rb7| |xt.|16-+ | | |
|| +---+-+-+---+ | | | GND
|| 5| | | |
|| __ GND | | |
|| |1 | | | |
||-14mHz■--+ o--------------+ | |
|| |__| | |
|| | |
|| +---+ | |
||-Wait-11-+=1 +12-------+-)-------------+
|| |IC4+13----------------------------+ |
|| +---+ |
||
|| +---+ |
||-A5----1-+ 1 |9 +---+ +---+ |
||-IORQ--2-+ o-------3-+ & |6 +---11-+ 1 |10 |||-RD----8-+IC2| +---4-+ o--+---12-+ o---+
|| +---+ | +-5-+IC3| +-13-+IC2|
|| | | +---+ | +---+
||-A15-------------+ | +---------+
||-A12---------------+ |
|| +---+ |
||-A0■■■■1■| & | | IC1-PIC16c620/20p
||-A1■■■■2■| o--------+ IC2-561ле10
||-A2■■■-8■|IC3| IC3-561ла9
|| +---+ IC4-555лп5
||
|| Copyright '2000 Wlad Sorokin
|| Spacesoft Hackers Group
|| Last edition 22.02.2000 22:21 pm
:100000000330620007301628A700030EA8003B301B
:1000100081000B1105190310051D0314A50CA40B79
:100020008B17280E8300A70E270E08009F00F730BD
:100030006500FF306600A00085158B018B1620300F
:1000400084003D20250EFC38033AA0003D20250801
:10005000A6003D2026080F39A61A31286720A107DF
:1000600033286620A10225080F39A51A3A286720EF
:10007000A30221286620A30721285420AA01A90B46
:100080008A1BAA0B8A1B21285420051D3F280930F2
:10009000A4007030810064008B1754208B1B4D2806
:1000A0005420051950280800051E080005080339CA
:1000B00084070008860000016600FF308511051ADC
:1000C0005F28660085158401841608000F3A8A01AE
:1000D0008207003401340134023402340234033420
:1000E0000334043404340534053406340734083446
:0200F0000934D1
:084000007F007F007F007F00BC
:02400E00FF3F72
:02FFFE002006DB
:00000001FF
-+-
+ Origin: Угнали ??? Hе надо было ставить CLIFFORD !!! (2:5020/6664.14)
─ Жэлезо на спектpуме (500:812/1.507) ─────────────────────────── HARDWARE.ZX ─Msg: 583 of 584
From : Eugene Stahov 500:3432/90 21 Aug 00
To : All 22 Aug 00
Subj: Small modification to the mouse controller circuit on the AT89C2051 (MSC-51)
─────────────────── ──────────────────── ──────────────────── ────────────────────
Hello All.
=== Cut ===
=================== kmsps2.t =================================
PS/2 -> Kempston Mouse Adapter v1.03
(c) 1999-2000 Studio STALL
Version for microcontrollers AT89C1051/AT89C2051 (MSC-51)
(+) The reset circuit has been changed - RC has been replaced by DD1D - now the circuit is
reset by general reset (previously only when turned on)
===============================================================================
DD1A DD1B DD1C DD2A
1┌───┐ 4┌───┐ 9┌───┐ 1┌───┐
A7 ──────┤& 0───┬──┤& 0──────┤& 0──────┤1 ├──┐
A6 ──────┤ │3 └──┤ │6 ┌──┤ │8 ┌──┤ │3 │
2└───┘ 5└───┘ │10└───┘ │ 2└───┘ │
A4 ─────────────────────────┘ │ │
A5 DD2C │
┌─────────────────────────────┘
DD2D │ 4┌───┐ DD2B 9┌───┐
12┌───┐ └──┤1 ├────────┬──────┤1 ├───|<|── /WAIT
/RD ─────┤1 ├────────┤ │6 │ ┌───┤ │8
/IORQ ───┤ │11 5└───┘ │ │ 10└───┘
13└───┘ │ │ DD2C/CS │ │
┌──/RES ┌───────────────────────┴──│─┐
│ DD1D │ ┌───────────────────────┘ │
│13┌───┐ │ │ C1 10uF + │ +5V
├──┤& 0──┐│ │ ┌────│────────────────┤
└──┤ │11││ │ 1┌───┬─────┬───┐20│ │1┌───┬────┬───┐20
12└───┘ └│──│───┤RES│ A │VCC├──┘ └─0 OC│ RG │VCC├─┘
MDAT───────│──│───┤P30│ T │P17├─────────┤ I7│ │O7 ├─────D7
│ └───┤P31│ 8 │P16├─────────┤ I6│ │O6 ├─────D6
│ ─┤X2 │ 9 │P15├─────────┤ I5│ │O5 ├─────D5
14MHZ ─────│──────┤X1 │ C │P14├─────────┤ I4│ │O4 ├─────D4
└──────┤P32│ 2 │P13├─────────┤ I3│ │O3 ├─────D3
MCLK──────────────┤P33│ 0 │P12├─────────┤ I2│ │O2 ├─────D2
A10───────────────┤P34│ 5 │P11├───┬─────┤ I1│ │O1 ├─────D1
A8────────────────┤P35│ 1 │P10├───│┬────┤ I0│ │O0 ├─────D0
┌────┤GND│ │P37├─ ││ ┌──┤GND│IR33│ C ├── +5V
│ 10└───┴─────┴───┘11 ││ │10└───┴────┴───┘11
─┴─ DD3 ││─┴─ DD4
┌─┘└─┐
┌┴┐ ┌┴┐
R1,2 │ │ │ │
1K └┬┘ └┬┘
└────┴──+5V
Расположение контактов в PS/2
┌──┐ ┌──┐
N/C 6 ──── ┌┘* └─┘ *└┐ ─── 5 MCLK
+5V 4 ──── │* *│ ─── 3 GNDN/C 2 ──── └─┐* *┌─┘ ─── 1 MDAT
└─────┘
View of the socket from the contact side (not from the solder side)
Chips:
DD1 1533LA3
DD2 1533LL1
DD3 AT89C2051
DD4 1533IR33 (ANALOGUE of IR22, BUT MORE CONVENIENT PIN), AP6 is also possible, only with
taking into account the pinout
The circuit is designed for connection to a computer that does not have port conflicts
#DF. If there is still a conflict, or there is a #FF port, then you need to assemble the circuit
management /IORQGE
How is the interface with the computer implemented?
In the idle state, line P31=0, so when the processor accesses the DF port
/WAIT will be issued. After the desired coordinate is issued, /WAIT
released by transferring P31->1. After completion of the Z80 cycle IOR P31->0.
About the purpose of resistors R1,2: Lines P10 and P11 do not have internal pull-up
resistors.
Decoding is quite tough: A7, A6, A5, A4, A10, A8 are involved
This scheme only supports 2-button mice (I only had
such), for 3-button models the middle button is not used.
When turned on, if there was no mouse movement, and also if the mouse did not
connected to the connector, the following will be read from the ports:
#fadf (64223) = 255 - buttons
#fbdf (64479) = 40 - x
#ffdf (65503) = 41
Warning: This firmware version does not allow mouse connection when
computer turned on.
Firmware version 2.0 will allow:
1. Connecting the mouse in a "hot" stateIn this version, the controller will “see” the mouse upon reset
2. Ability to switch left and right buttons, both from the program and
buttons of the mouse itself.
3. Ability to identify this circuit (#FEDF port)
4. Support for three-button (or more) mice.
==== PS2DRV.HEX =====================
:1000000002002630B51730B40B85059000D2B1C27E
:10001000B1D2213285049000D2B1C2B13285239091
:1000200000D2B1C2B13275A80175880175B80174EA
:1000300028F50404F505E4F520F521F522C2B17593
:1000400023FFC221D2AF3021FDD2B374F475F00882
:10005000C2B020B3FD1392B030B3FDD5F0F413A2BB
:10006000D0B320B3FD92B030B3FD20B3FDD2B03099
:10007000B3FD20B3FD30B3FDD2AF1200800200A665
:10008000D2B0D2B320B3FD30B3FD75F00820B3FD7C
:10009000A2B01330B3FDD5F0F420B3FD30B3FD2092
:1000A000B3FD30B3FD227820D2AF1180F608B8231B
:1000B000F9E5022521F502F504E5032522F503F50E
:1000C00005A200B39219A201B3921880D9A2E1331C
:0E00D00092E2A2E33392E4A2E53392E6C42268
:00000001FF
======== [ Saw, Shura, saw... ] =========================
Planned transition to microcontroller AT90C1200 (AVR)
- /wait duration will be reduced by 12 times
The microcontroller pinout matches the AT89S2051, with the exception of
the value of the RESET signal - in AT90C1200 it is /RESET, i.e. it will be necessary
exclude DD1D
Eugene Stakhov
Mon 21 Aug 2000 18:42:29
=== Cut ===
Eugene
-+- To the village, grandfather, PO Box 3.0.1 + Origin: Studio STALL (500:3432/90)