Nicron #24
13 марта 1997

Programming - KR580VV55A.

<b>Programming</b> - KR580VV55A.

                                                           z80


[For readers' letters]

(C) WLODEK BLACK

        KR580VV55A - Programmable ADAPTER
        Parallel I / O

                            Hello, friends!
        VV55 Once again we are vstrePA3 January 1940 PA4 
chaemsya in the fields of your                              
messages! Epidemic myshiPA2 February 1939 PA5 Nogo rabies :-)   
                           swept dobroPA1 March 1938 PA6 mu ten 
"Profyakov"                              plus interest to the 
problems April 1937 PA0 PA7 connecting different

                             peripherals (printers and
/ RD May 1936 / WR, etc.) and management called away to a life 
free on / CS June 1935 Reset (+) necks conversation today.      
                        Also among your Earth in July 1934 D0 
bids came across Conc retnye request - rassA0 August 1933 D1 
Prove of VV55. 

A1 September 1932 D2 circuit KR580VV55A
                             as a logical ustroystPS7 October 
1931 D3 is in the pro ble adapter paralPS6 November 30 D4 of 
parallel I / O                              contains 3 8-bit

PS5 December 29 D5 port can work as a thief to enter and
PS4 13 28 D6 at the conclusion. As an electron LIMITED 
component VV55 - miPS0 14 27 D7 kroshema n-MOS type, on the +5 
V supply voltage; 15 26 PS1 +5 V input circuits are made

                             for MOSFETs with izoPS2 16 25 PV7 
isolated gate, and you can chain gressorial pePS3 17 24 PV6 
goes over into the third state of the. Input and output PV0 18 
23 PV5 levels consistent with                              TTL. 
Inputs chips PV1 19 22 PV4 sensitive to static electricity and 
Scoma PV2 20 21 PV3 potential overload kam outside 0 .. +5 V

therefore should not be left "free hanging" inputs, which can 
be anything to connect or disconnect (eg, Kempston joystick) - 
need to connect these inputs to ground or +5 V through 
resistors, the resistance of which little is critical (up to 
several tens of kilo). Better yet, connect the peripherals are 
not directly to the contacts VV55, and through the buffer 
elements TTL-type, as this is done, for example, in printers - 
a Schmitt trigger K155 TL2, for example. If your computer is 
directly VV55 "communicates" with the outside world - exercise 
extreme caution when connecting and disconnecting devices 
associated with it, no matter stick it or a printer - turn off 
the computer and another device, remove the plug from the 
socket, get rid of your own static electricity even touching 
the metal chassis slot tape input or to another details 
connected to ground the computer, and then take a connecting 
cable connector device and insert it in the right place! At the 
same time the chip is much less sensitive to short-circuit 
output to 0 or +5 volts, but such an overload and not be 
allowed. 

        Software control VV55

The policy regarding VV55 represents 4 addressable port
in a standard configuration "Spectrum" (PROFI, Delta-C, 
"Pentagon-48, etc.) with address # 1F, # 3F, # 5F and # 7F. 
Address these Ports are defined by bits A5 and A6, address bus, 
which connected the inputs A0 and A1 circuits through which 
selected one or another internal register VV55 and discharge A7 
Address Bus, which should be 0 for the sample VV55. That 
corresponds to the address registers, internal adapter: # 1F - 
Port A # 3F - Port B

# 5F - Port C
# 7F - control register.
VV55 can operate in three modes, different purpose
individual bits of ports and ports in general. In modes 1 and 
2, the adapter is capable to a limited extent on their own to 
support the protocols for transferring / receiving data, for 
example, by issuing special flags or signals interrupt request, 
under the which are allocated the appropriate lines of some 
ports. For have these modes of little interest, as in 
"Spectrum" their implementation is difficult and generally of 
little use. In Mode 0 adapter works as a 3 parallel ports I / O 
in which you can simply write or read from there. In Mode 0 
ports A and B can be programmed either to enter or to withdraw 
as an 8-bit registers, and port C is divided into two 4-bit 
registers, each of which can either accept or transmit data. 
Programming adapter is entering in control register 8-bit code, 
the appointment of individual bits is as follows: 


 D7 D6 D5 D4 D3 D2 D1 D0


      Mode Channel A Channel A Channel B Mode KanalC2 KanalC1

      and channel C2 channels

  1 0 0 1 - IN 1 - IN B and C1 1 - IN 1 - IN

       (Mode 0) 0 - OUT 0 - OUT 0 0 - OUT 0 - OUT


Channel C1 - bits 0 ... 3 Port C;
channel C2 - level 4 ... 7 Port C.

In a typical embodiment of a control code is # 98:
% 10011000, and the port assignment is as follows: Port A - 
Kempston joystick (input) port B - data for the printer 
(output) channel C1 - Bit 0 - signal / STROBE for the printer 
(output) channel C2 - bit 7 - signal BUSY (busy) from the 
printer (input). After reset, all three ports are working on 
putting in Mode 0, thus use of Kempston joystick is possible 
without special programming adapter. Note: reset signal is fed 
level logic 1! In older versions of chips, wearing name 
K580IK55, reading from a port programmed as an output, let us 
always # FF. In modern version VV55 result of reading is that

was recorded in the register of the adapter. This should be 
borne in mind when acquainted with the old literature, for 
example, with a description of the computer, "Radio-86RK. Most 
recently, Moscow's network spread over the whole "epidemic of 
murine rabies - programming glitches ZXZIP / ZXUNZIP computers 
PROFI, when "discover" a nonexistent interface Kempston-mouse, 
and on the screen started to randomly move the mouse pointer, 
making it difficult work with the program from the keyboard. 
Despite the fact that the ports mouse interface are 
distinguished by addresses from VV55, participated in the 
latest "reality" seems to have a place, as on lines A7 and A5 
VV55 explicitly chosen by simulating the presence of some mouse 
interface. I offered to users PROFI try this program from:

1910 OUT 127,128: OUT 31,255: OUT 63,255: OUT 95,255
20 RANDOMIZE USR 15619: REM: RUN "ZXZIP"
It is easy to establish that after a "procedure" read from the 
ports of channels A, B and C will give a # FF, that is, it 
might seem that these ports and there is no at all. Results of 
the survey profistov showed that:

PROFI on 1-D and 3-x versions ZIP begins to work normally, if
ZIP-profievsky not (not "ZIPp");
UNZIP-s "cure" generally all;
PROFI on 5-x version bugs and so no.
But I myself do not PROFI, so a more thorough investigation
I could not hold.
And finally, bring the text of the print driver for the 
ZX-Word-a: 

    ORG 23296; so it is necessary for the ZX-Word-a
    NOP; so necessary for the ZX-Word-a
    JR INIT
; NOP
START DI
    LD E, A
CHROUT LD A, (23624); Border
    CPL
    RRCA
    RRCA
    RRCA
    AND 7
    OUT (254), A; visualization of output data
CHROU1 IN A, (# 5F)
    RLCA; free?
    JR NC, READY
OFFLIN CALL BREAK
    JR CHROU1
READY LD A, E
    OUT (# 3F), A; output bytes of data in channel B
    XOR A
    OUT (# 5F), A; / Strobe
READY1 IN A, (# 5F)
    RLCA; Busy
    JR C, RECEIV
    CALL BREAK
    JR READY1
RECEIV LD A, # 0F; remove / Strobe
    OUT (# 5F), A
    XOR A
    OUT (# 3F), A
    LD A, (23624)
    RRCA
    RRCA
    RRCA
    AND 7; simultaneously reset the flag C, which is necessary 
for          ZX-Word-a

    OUT (254), A
    RET
; BREAK CALL # 1F54; systemic Break
    RET C
    POP AF
    CALL RECEIV
    SCF; flag for the ZX-Worda, we want to stop printing
    RET
; INIT DI
    DEFB # C3; JP
INITA DEFW INIT0
INIT0 LD HL, INITW
    LD (INITA), HL; hammered, then to re-
              do not initialize VV55
    LD A, # 98
    OUT (# 7F), A; setting VV55
    CALL RECEIV
INITW LD HL, STALST; a list of the initialization code printer
INIT1 LD A, (HL)
    LD E, A
    INC E
    RET Z
    CALL START
    INC HL
    JR INIT1
STALST DEFB 27,64,27,82,4,255; for MS-6312. For other prints 
ditch do not need "27,82,4". ; DEFS 23,549 - $

    END
;
[Continuing the theme of "assembler" should be].





Other articles:

Entry - the contents of rooms.

BBS - list of stations BBS ZXNet.

Programming - KR580VV55A.

Graphics - Image ANSI graphics.

Humor - the laws of female logic.

Secrets games - control without secrets.

Search - search for game programs.

Announcement - a program for sisopov.

Humor - anecdotes.

Advertising - advertising and announcements.

Feedback - contact the publisher.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Toys - 3D construction kit: a detailed description of the editor of 3D games such as Castle Master. The article describes the internal language sistemmy, which in fact, makes a set of locations and objects in a full game.
Introduction - Third number Cheboksary irregular almost modem independent newspaper.

В этот день...   21 November