RDUART JSR WTUARTRXRDY WAIT FOR UART RX CHAR
IOR 0X01 0X09 READ UART CHAR
RTS RETURN KBD DATA IN REG1
WTUARTRXRDY IOR 0X00 0X08 READ UART STATUS
ARI 0X00 0X01 RX RDY BIT
BEZ WTUARTRXRDY LOOP UNTIL CHAR PRESENT
RTS
Write Code to UART
Pass character to write in Reg0
Destroys Reg1
Blocks until character can be written
WRUART JSR WTUARTTXBSY WRITE REG1 TO THE UART TX
IOW 0X01 0X09
RTS
WTUARTTXBSY IOR 0X00 0X08 WRITE REG1 OUT UART
ARI 0X00 0X02 TX EMPTY BIT
BEZ WTUARTTXBSY LOOP WHILE NOT EMPTY
RTS
UART and Baud Rate Generator VHDL Entities
Code to add UART to the IOP16 top file
Pins
Add to top level entity
-- UART
rxd1 : in std_logic := '1'; -- Hardware Handshake needed
txd1 : out std_logic;
cts1 : in std_logic := '1';
rts1 : out std_logic;
serSelect : in std_logic := '1'; -- Jumper with pullup in FPGA for selecting serial between ACIA (installed) and VDU (removed)
Signals
Add signals to architecture section
-- Decodes/Strobes
...
signal w_wrUart : std_logic;
signal w_rdUart : std_logic;
-- Interfaces
..
signal w_UartDataOut : std_logic_vector(7 downto 0);
-- Serial clock enable
signal W_serialEn : std_logic; -- 16x baud rate clock