put display din as dout as in the real PIA

This commit is contained in:
nino-porcino 2022-05-21 21:17:25 +02:00
parent ac99eaff41
commit c80b372ef2
2 changed files with 9 additions and 5 deletions

View File

@ -116,7 +116,8 @@ module apple1(
addr[7:0] == 7 ? T65_PC[23:16] : 8'hAA; // PC regs[63:56]
// byte returned from display out
wire [7:0] display_dout = { ~PB7, 7'b0 };
wire [6:0] dsp_dout;
wire [7:0] display_dout = { ~PB7, dsp_dout };
//////////////////////////////////////////////////////////////////////////
// Peripherals
@ -154,6 +155,7 @@ module apple1(
.address(addr[0]),
.w_en(we & display_cs),
.din(cpu_dout),
.dout(dsp_dout),
.clr_screen(cls_key),
.ready(PB7)
);

View File

@ -19,7 +19,8 @@ module display (
// cpu interface
input address, // address bus
input w_en, // active high write enable strobe
input [7:0] din // 8-bit data bus (input)
input [7:0] din, // 8-bit data bus (input)
output reg [6:0] dout // input data is also seen as output
);
//////////////////////////////////////////////////////////////////////////
@ -255,6 +256,7 @@ module display (
if (cpu_clken & w_en & ready) begin
// incoming character
ready <= 0;
dout[6:0] <= din[6:0];
if(din[6:0]=='h0D) begin
// handle carriage return