Changes

Jump to: navigation, search

Z80 STI RS232 interface

100 bytes removed, 21:16, 2 May 2010
/* How to build a RS232 - Interface for the CPC-Series! */
First about the connection plan: You need a power supply that supports +9V,-9V and 5V. Connect all pins. You have to connect D0..D7 from the adressbus with the Z80 STI. You have to connect D0 with pin 21, D1 with pin 22, ..., D7 with pin 28. That's all.
Now you can plug in the interface in the CPC. Switch the power on. If the CPC doesn't work normal please switch the power off and you have to watch for faults in the connection of your interface :-(. If everything is ok then you have to copy the assembler code and do the next test.
 
WARRANTY: There is no warranty of any defects of your CPC!!! On my CPC everything works fine and I hope that you won't have any problems with this RS232-Interface.
Second part: How to program the interface. (The assembler code is saved in RS232.ASM)
Z80-STI: 50 to 19200 bps (5,6,7 or 8 bit, 1, 1 1/2, 2 stopb.stopbits, all parity flags) 24 registers, use 16 registers (direct) with F8E0-F8EF, the last 8 registers can be used indirect with a special register
== The meaning and the adresses Addresses of the registers:==
register === Register 0, port adress F8E0:(Port F8E0h) ===
This register transfers data from and to a indirect register.
register === Register 1, port adress F8E1:(Port F8E1h) ===This register transfer transfers the data from and to the I/O port of the chip. If youuse V24 you can request handshake signals from this port. In this interfacethe following bits have this meaning: Bit 0: DTR (Data Terminal Ready) Bit 1: RTS (Ready to Send) Bit 2: CTS (Clear to Send) Bit 3: DSR (Data Set Ready) Bit 4-7: not used
register === Register 2-7, port adress F8E2(Port F8E2h-F8E7:F8E7h) ===
These registers are used by the interrupt handler. If you want to know
what you can do with this registers please write to Mostek for support.
register === Register 8, port F8E8:(Port F8E8h) ===Bit 3-7 are used by the interrupt handler. With bit 0-2 you can choose theindirect register.
register === Register 9, port adress F8E9:(Port F8E9h) ===Controll Control register for timer A and B. You needn't to use the timer for a V24interface.
register === Register 10, port adress F8EA:(Port F8EAh) ===
Timer B value
register === Register 11, port adress F8EB:(Port F8EBh) ===
Timer A value
register === Register 12, port adress F8EC:(Port F8ECh) ===
USART-register. Change the connect-parameters.
 
Bit 7 6 5 4 3 2 1 0
x x x x x x x 0
please always set on 0
register === Register 13, port adress F8ED:(Port F8EDh) ===
Receiver status. You need only the following bits:
Bit 0: Receiver-Enable, set to 1 if receiving is possible.
Bit 1: Memory full "1" or not "0". (If 8 Bits are
received then the interface send memory full).
Bit 0: Receiver-Enable, set to 1 if receiving is possible.Bit 1: Memory full "1" or not "0". === Register 14 (If 8 Bits are received then the interface send memory fullPort F8EEh). register 14, port adress F8EE:===
Sending status. Again you need only two bits:
Bit 0: Sending-Enable, must set to "1" if sending is allowed.
Bit 7: Memory full "1" or not "0". This bit can
be used to ask if a word is send or not.
Bit 0: Sending-Enable, must set to "1" if sending is allowed.Bit 7: Memory full "1" or not "0". This bit can be used to ask if a word is send or not. register === Register 15, port adress F8EF:(Port F8EFh) ===
This is the send and receive register. Here you can get a word or send a word.
== Indirect registers (Choose them with register 8):==
register 0: Not used.
For more exact informations please write to Mostek and ask for support for theZ80-STI. You also can look at the assembler code. 
== About the assembler code ==
6,388
edits