-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSystem68.vhd
748 lines (685 loc) · 20.8 KB
/
System68.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
--===========================================================================--
--
-- S Y N T H E Z I A B L E System68 System On a Chip
--
-- This core adheres to the GNU public license
--
-- File name : system68.vhd
--
-- Purpose : Top level file for a 6800 compatible system on a chip
-- Designed for the Burch ED B5-Spartan IIe board with
-- X2S300e FPGA,
-- 128K x 16 Word SRAM module (B5-SRAM)
-- CPU I/O module (B5-Peripheral-Connectors)
-- Compact Flash Module (B5-CF)
-- Using mimiUart from open cores modified to look like a 6850
-- This version of System68 boots the monitor program
-- from LBA sectors $F478 / $F479 from a 32 Mbyte Compact Flash
-- On Reset the Boot ROM is mapped for read at $E000,
-- and Writes to $E000-$FFFF write to RAM
-- Writing 0 to location $8030 disables the boot ROM and
-- maps RAM for Read only at $E000 and Writes go to the DAT.
--
-- Dependencies : ieee.Std_Logic_1164
-- ieee.std_logic_unsigned
-- ieee.std_logic_arith
-- ieee.numeric_std
--
-- Uses : miniuart.vhd, rxunit.vhd, tx_unit.vhd, clkunit.vhd
-- swtbug.vhd (6800 SWTBUG ROM)
-- datram.vhd (Dynamic address translation registers)
-- cpu68.vhd (6800 compatible CPU core)
-- timer.vhd (timer module)
--
-- Author : John E. Kent
--
--===========================================================================----
--
-- Revision History:
--===========================================================================--
--
-- Date: Revision Author
-- 22 September 2002 0.1 John Kent
-- Initial design.
-- 31 March 2003 0.2 John Kent
-- Removed Parallel I/O port
-- Added Compact Flash Interface
-- Added IO register to commit unused inputs
-- Used 16 byte port mapping
--
-- 28th June 2003 0.3 John Kent
-- updated CPU to include Halt and Hold signals
--
-- 9th January 2004 0.4 John Kent
-- Removed Redundant Map Switch Code.
-- Rearrange DAT
-- Added dual port IO at $8030 - $803F
--
-- 25th April 2004 0.5 John Kent
-- Changed CPU clock to run at 25MHz / 2 = 12.5 MHz
-- Added baud rate divider for 57.6 Kbaud.
--
-------------------------------------------------------------------------------
--
-- Memory Map:
--
-- $0000 - $7FFF RAM
-- $8000 - $8FFF IO
-- $8000 - $800F MiniUart / Acia
-- $8010 - $801F Compact Flash
-- $8020 - $802F Timer
-- $8030 - $803F IO port
-- $8040 - $804F Trap hardware
-- $9000 - $BFFF RAM
-- $C000 - $CFFF ROM
-- $D000 - $DFFF RAM
-- $E000 - $FFFF ROM (read) & DAT (write)
--
library ieee;
use ieee.std_logic_1164.all;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use ieee.numeric_std.all;
entity Sys68 is
port(
SysClk : in Std_Logic; -- System Clock input
Reset_n : in Std_logic; -- Master Reset input (active low)
-- Memory Interface signals B3-SRAM
ram_csn : out Std_Logic; -- RAM Chip select (active low)
ram_wrln : out Std_Logic; -- lower byte write strobe (active low)
ram_wrun : out Std_Logic; -- upper byte write strobe (active low)
ram_addr : out Std_Logic_Vector(16 downto 0); -- RAM Address bus
ram_data : inout Std_Logic_Vector(15 downto 0); -- RAM Data bus
-- Signals defined on B3-CPU-IO Module
LED : out std_logic; -- Diagnostic LED Flasher
-- Uart Interface
rxbit : in Std_Logic; -- UART receive data
txbit : out Std_Logic; -- UART transmit data
rts_n : out Std_Logic; -- Request to send (active low)
cts_n : in Std_Logic; -- Clear to send (active low)
-- CRTC output signals
-- v_drive : out Std_Logic;
-- h_drive : out Std_Logic;
-- blue_lo : out std_logic;
-- blue_hi : out std_logic;
-- green_lo : out std_logic;
-- green_hi : out std_logic;
-- red_lo : out std_logic;
-- red_hi : out std_logic;
-- buzzer : out std_logic;
-- Compact Flash B5-CF Module
cf_rst_n : out std_logic;
cf_cs0_n : out std_logic;
cf_cs1_n : out std_logic;
cf_rd_n : out std_logic;
cf_wr_n : out std_logic;
cf_cs16_n : out std_logic;
cf_a : out std_logic_vector(2 downto 0);
cf_d : inout std_logic_vector(15 downto 0);
-- cf_intrq : in std_logic;
-- cf_iordy : in std_logic;
-- cf_dase : in std_logic;
-- cf_pdiag : in std_logic;
-- cf_present : in std_logic;
--- IOPort Pins
porta : inout std_logic_vector(7 downto 0);
portb : inout std_logic_vector(7 downto 0);
--- Timer output
timer_out : out std_logic;
-- External Bus
bus_addr : out std_logic_vector(15 downto 0);
bus_data : inout std_logic_vector(7 downto 0);
bus_rw : out std_logic;
bus_cs : out std_logic;
bus_clk : out std_logic;
bus_reset : out std_logic
);
end;
-------------------------------------------------------------------------------
-- Architecture for memio Controller Unit
-------------------------------------------------------------------------------
architecture my_computer of Sys68 is
-----------------------------------------------------------------------------
-- Signals
-----------------------------------------------------------------------------
-- SWTBUG in Slices
signal monitor_cs : Std_Logic;
signal monitor_data_out : Std_Logic_Vector(7 downto 0);
-- SWTBUG in Block RAM
signal swtbug_cs : Std_Logic;
signal swtbug_data_out : Std_Logic_Vector(7 downto 0);
-- UART Interface signals
signal uart_cs : Std_Logic;
signal uart_data_out : Std_Logic_Vector(7 downto 0);
signal uart_irq : Std_Logic;
signal dcd_n : Std_Logic;
signal baudclk : Std_Logic;
-- timer
signal timer_cs : std_logic;
signal timer_data_out : std_logic_vector(7 downto 0);
signal timer_irq : std_logic;
-- trap
signal trap_cs : std_logic;
signal trap_data_out : std_logic_vector(7 downto 0);
signal trap_irq : std_logic;
-- ioport
signal ioport_cs : std_logic;
signal ioport_data_out : std_logic_vector(7 downto 0);
-- compact flash port
signal cf_cs : std_logic;
signal cf_rd : std_logic;
signal cf_wr : std_logic;
signal cf_data_out : std_logic_vector(7 downto 0);
-- RAM
signal ram_cs : std_logic; -- memory chip select
signal ram_wrl : std_logic; -- memory write lower
signal ram_wru : std_logic; -- memory write upper
signal ram_data_out : std_logic_vector(7 downto 0);
-- CPU Interface signals
signal cpu_reset : Std_Logic;
signal cpu_clk : Std_Logic;
signal cpu_rw : std_logic;
signal cpu_vma : std_logic;
signal cpu_halt : std_logic;
signal cpu_hold : std_logic;
signal cpu_irq : std_logic;
signal cpu_nmi : std_logic;
signal cpu_addr : Std_Logic_Vector(15 downto 0);
signal cpu_data_in : Std_Logic_Vector(7 downto 0);
signal cpu_data_out : Std_Logic_Vector(7 downto 0);
-- Dynamic Address Translation RAM
signal dat_cs : std_logic;
signal dat_addr : std_logic_vector(7 downto 0);
-- Flashing Led test signals
signal countL : std_logic_vector(23 downto 0);
signal BaudCount : std_logic_vector(4 downto 0);
-----------------------------------------------------------------
--
-- CPU68 CPU core
--
-----------------------------------------------------------------
component cpu68
port (
clk: in std_logic;
rst: in std_logic;
rw: out std_logic; -- Asynchronous memory interface
vma: out std_logic;
address: out std_logic_vector(15 downto 0);
data_in: in std_logic_vector(7 downto 0);
data_out: out std_logic_vector(7 downto 0);
hold: in std_logic;
halt: in std_logic;
irq: in std_logic;
nmi: in std_logic
);
end component;
-----------------------------------------------------------------
--
-- Open Cores Mini UART
--
-----------------------------------------------------------------
component miniUART
port (
clk : in Std_Logic; -- System Clock
rst : in Std_Logic; -- Reset input (active high)
cs : in Std_Logic; -- miniUART Chip Select
rw : in Std_Logic; -- Read / Not Write
irq : out Std_Logic; -- Interrupt
Addr : in Std_Logic; -- Register Select
DataIn : in Std_Logic_Vector(7 downto 0); -- Data Bus In
DataOut : out Std_Logic_Vector(7 downto 0); -- Data Bus Out
RxC : in Std_Logic; -- Receive Baud Clock
TxC : in Std_Logic; -- Transmit Baud Clock
RxD : in Std_Logic; -- Receive Data
TxD : out Std_Logic; -- Transmit Data
DCD_n : in Std_Logic; -- Data Carrier Detect
CTS_n : in Std_Logic; -- Clear To Send
RTS_n : out Std_Logic ); -- Request To send
end component;
----------------------------------------
--
-- Timer module
--
----------------------------------------
component timer
port (
clk : in std_logic;
rst : in std_logic;
cs : in std_logic;
rw : in std_logic;
addr : in std_logic;
data_in : in std_logic_vector(7 downto 0);
data_out : out std_logic_vector(7 downto 0);
irq : out std_logic;
timer_in : in std_logic;
timer_out : out std_logic
);
end component;
component trap
port (
clk : in std_logic;
rst : in std_logic;
cs : in std_logic;
rw : in std_logic;
vma : in std_logic;
addr : in std_logic_vector(15 downto 0);
data_in : in std_logic_vector(7 downto 0);
data_out : out std_logic_vector(7 downto 0);
irq : out std_logic
);
end component;
component ioport
port (
clk : in std_logic;
rst : in std_logic;
cs : in std_logic;
rw : in std_logic;
addr : in std_logic_vector(1 downto 0);
data_in : in std_logic_vector(7 downto 0);
data_out : out std_logic_vector(7 downto 0);
porta_io : inout std_logic_vector(7 downto 0);
portb_io : inout std_logic_vector(7 downto 0) );
end component;
component dat_ram
port (
clk: in std_logic;
rst: in std_logic;
cs: in std_logic;
rw: in std_logic;
addr_lo: in std_logic_vector(3 downto 0);
addr_hi: in std_logic_vector(3 downto 0);
data_in: in std_logic_vector(7 downto 0);
data_out: out std_logic_vector(7 downto 0)
);
end component;
--
-- SWTBug Monitor ROM at $E000
--
component monitor_rom
port (
cs : in std_logic;
addr : in Std_Logic_Vector(9 downto 0); -- 1K byte boot rom
data : out Std_Logic_Vector(7 downto 0)
);
end component;
component BUFG
port (
i: in std_logic;
o: out std_logic
);
end component;
--
-- SWTBUG Monitor in Block RAM at $C000
--
component swtbug_rom
port (
clk : in std_logic;
rst : in std_logic;
cs : in std_logic;
rw : in std_logic;
addr : in std_logic_vector (9 downto 0);
wdata : in std_logic_vector (7 downto 0);
rdata : out std_logic_vector (7 downto 0)
);
end component;
begin
-----------------------------------------------------------------------------
-- Instantiation of internal components
-----------------------------------------------------------------------------
my_cpu : cpu68 port map (
clk => cpu_clk,
rst => cpu_reset,
rw => cpu_rw,
vma => cpu_vma,
address => cpu_addr(15 downto 0),
data_in => cpu_data_in,
data_out => cpu_data_out,
hold => cpu_hold,
halt => cpu_halt,
irq => cpu_irq,
nmi => cpu_nmi
);
my_uart : miniUART port map (
clk => cpu_clk,
rst => cpu_reset,
cs => uart_cs,
rw => cpu_rw,
irq => uart_irq,
Addr => cpu_addr(0),
Datain => cpu_data_out,
DataOut => uart_data_out,
RxC => baudclk,
TxC => baudclk,
RxD => rxbit,
TxD => txbit,
DCD_n => dcd_n,
CTS_n => cts_n,
RTS_n => rts_n
);
my_timer : timer port map (
clk => cpu_clk,
rst => cpu_reset,
cs => timer_cs,
rw => cpu_rw,
addr => cpu_addr(0),
data_in => cpu_data_out,
data_out => timer_data_out,
irq => timer_irq,
timer_in => CountL(5),
timer_out => timer_out
);
my_trap : trap port map (
clk => cpu_clk,
rst => cpu_reset,
cs => trap_cs,
rw => cpu_rw,
vma => cpu_vma,
addr => cpu_addr,
data_in => cpu_data_out,
data_out => trap_data_out,
irq => trap_irq
);
my_ioport : ioport port map (
clk => cpu_clk,
rst => cpu_reset,
cs => ioport_cs,
rw => cpu_rw,
addr => cpu_addr(1 downto 0),
data_in => cpu_data_out,
data_out => ioport_data_out,
porta_io => porta,
portb_io => portb
);
my_dat : dat_ram port map (
clk => cpu_clk,
rst => cpu_reset,
cs => dat_cs,
rw => cpu_rw,
addr_hi => cpu_addr(15 downto 12),
addr_lo => cpu_addr(3 downto 0),
data_in => cpu_data_out,
data_out => dat_addr(7 downto 0)
);
--
-- SWTBUG Monitor
--
my_monitor_rom : monitor_rom port map (
cs => monitor_cs,
addr => cpu_addr(9 downto 0),
data => monitor_data_out
);
--
-- SWTBUG Monitor using BLOCKRAM
--
my_swtbug_rom : swtbug_rom port map (
clk => cpu_clk,
rst => cpu_reset,
cs => swtbug_cs,
rw => cpu_rw,
addr => cpu_addr(9 downto 0),
wdata => cpu_data_out,
rdata => swtbug_data_out
);
clock_buffer : BUFG port map (
i => CountL(0),
o => cpu_clk
);
----------------------------------------------------------------------
--
-- Processes to decode the CPU address
--
----------------------------------------------------------------------
decode: process( cpu_addr, cpu_rw, cpu_vma, cpu_data_in,
monitor_data_out,
ram_data_out,
swtbug_data_out,
uart_data_out,
cf_data_out,
timer_data_out,
trap_data_out,
bus_data,
dat_cs )
begin
--
-- Memory Map
--
case cpu_addr(15 downto 12) is
when "1111" | "1110" => -- $E000 - $FFFF
cpu_data_in <= monitor_data_out; -- read ROM
monitor_cs <= cpu_vma;
swtbug_cs <= '0';
dat_cs <= cpu_vma; -- write DAT
ram_cs <= '0';
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
when "1100" => -- $C000 - $CFFF
cpu_data_in <= swtbug_data_out;
monitor_cs <= '0';
swtbug_cs <= cpu_vma;
dat_cs <= '0';
ram_cs <= '0';
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
when "1000" => -- $8000 - $8FFF
monitor_cs <= '0';
swtbug_cs <= '0';
dat_cs <= '0';
ram_cs <= '0';
case cpu_addr(6 downto 4) is
--
-- UART
--
when "000" => -- ($8000 - $800F)
if cpu_addr(3 downto 2) = "01" then
cpu_data_in <= uart_data_out;
uart_cs <= cpu_vma;
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
else
cpu_data_in <= "00000000";
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
end if;
--
-- Compact Flash
--
when "001" => -- ($8010 - $801F)
cpu_data_in <= cf_data_out;
uart_cs <= '0';
cf_cs <= cpu_vma;
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
--
-- Timer
--
when "010" => -- ($8020 - $802F)
cpu_data_in <= timer_data_out;
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= cpu_vma;
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= '0';
--
-- IO Port
--
when "011" => -- ($8030 - $803F)
cpu_data_in <= ioport_data_out;
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= cpu_vma;
bus_cs <= '0';
--
-- Trap hardware
--
when "100" => -- ($8040 - $804F)
cpu_data_in <= trap_data_out;
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= cpu_vma;
ioport_cs <= '0';
bus_cs <= '0';
--
-- Null devices
--
when others => -- $8050 to $9FFF
cpu_data_in <= bus_data;
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
bus_cs <= cpu_vma;
end case;
when others =>
cpu_data_in <= ram_data_out;
monitor_cs <= '0';
swtbug_cs <= '0';
ram_cs <= cpu_vma;
dat_cs <= '0';
uart_cs <= '0';
cf_cs <= '0';
timer_cs <= '0';
trap_cs <= '0';
ioport_cs <= '0';
end case;
end process;
----------------------------------------------------------------------
--
-- Processes to read and write B5_SRAM
--
----------------------------------------------------------------------
b5_sram: process( cpu_clk, Reset_n,
cpu_addr, cpu_rw, cpu_data_out,
ram_cs, ram_wrl, ram_wru,
dat_cs, dat_addr, ram_data_out )
begin
ram_csn <= not( ram_cs and Reset_n);
ram_wrl <= dat_addr(0) and (not cpu_rw) and cpu_clk;
ram_wrln <= not ram_wrl;
ram_wru <= (not dat_addr(0)) and (not cpu_rw) and cpu_clk;
ram_wrun <= not ram_wru;
ram_addr(16 downto 12) <= dat_addr(5 downto 1);
ram_addr(11 downto 0 ) <= cpu_addr(11 downto 0);
if ram_wrl = '1' then
ram_data(7 downto 0) <= cpu_data_out;
else
ram_data(7 downto 0) <= "ZZZZZZZZ";
end if;
if ram_wru = '1' then
ram_data(15 downto 8) <= cpu_data_out;
else
ram_data(15 downto 8) <= "ZZZZZZZZ";
end if;
if dat_addr(0) = '0' then
ram_data_out <= ram_data(15 downto 8);
else
ram_data_out <= ram_data(7 downto 0);
end if;
end process;
--
-- B5-CF Compact Flash Control
--
b5_cf: process( Reset_n,
cpu_addr, cpu_rw, cpu_data_out,
cf_cs, cf_rd, cf_wr, cf_d )
begin
cf_rst_n <= Reset_n;
cf_cs0_n <= not( cf_cs ) or cpu_addr(3);
cf_cs1_n <= not( cf_cs and cpu_addr(3));
cf_cs16_n <= '1';
cf_wr <= cf_cs and (not cpu_rw);
cf_rd <= cf_cs and cpu_rw;
cf_wr_n <= not cf_wr;
cf_rd_n <= not cf_rd;
cf_a <= cpu_addr(2 downto 0);
if cf_wr = '1' then
cf_d(7 downto 0) <= cpu_data_out;
else
cf_d(7 downto 0) <= "ZZZZZZZZ";
end if;
cf_data_out <= cf_d(7 downto 0);
cf_d(15 downto 8) <= "ZZZZZZZZ";
end process;
--
-- CPU bus signals
--
my_bus : process( cpu_clk, cpu_reset, cpu_rw, cpu_addr, cpu_data_out )
begin
bus_clk <= cpu_clk;
bus_reset <= cpu_reset;
bus_rw <= cpu_rw;
bus_addr <= cpu_addr;
if( cpu_rw = '1' ) then
bus_data <= "ZZZZZZZZ";
else
bus_data <= cpu_data_out;
end if;
end process;
--
-- Interrupts and Reset.
--
interrupts : process( Reset_n,
trap_irq, timer_irq, uart_irq )
begin
cpu_halt <= '0';
cpu_hold <= '0';
cpu_irq <= uart_irq or timer_irq;
cpu_nmi <= trap_irq;
cpu_reset <= not Reset_n; -- CPU reset is active high
end process;
--
-- flash led to indicate code is working
--
flash: process (SysClk, Reset_n, CountL )
begin
if(SysClk'event and SysClk = '0') then
-- if Reset_n = '0' then
-- countL <= "000000000000000000000000";
-- else
countL <= countL + 1;
-- end if;
end if;
LED <= countL(21);
-- baudclk <= countL(5); -- 9.8MHz / 64 = 153,600 KHz = 9600Bd * 16
-- baudclk <= countL(4); -- 9.8MHz / 32 = 307,200 KHz = 19200Bd * 16
-- baudclk <= countL(3); -- 9.8MHz / 16 = 614,400 KHz = 38400Bd * 16
-- baudclk <= countL(2); -- 4.9MHz / 8 = 614,400 KHz = 38400Bd * 16
dcd_n <= '0';
end process;
--
-- 57.6 Kbaud * 16 divider for 25 MHz system clock
--
my_clock: process( SysClk )
begin
if(SysClk'event and SysClk = '0') then
if( BaudCount = 26 ) then
BaudCount <= "00000";
else
BaudCount <= BaudCount + 1;
end if;
end if;
baudclk <= BaudCount(4); -- 25MHz / 27 = 926,000 KHz = 57,870Bd * 16
dcd_n <= '0';
end process;
end my_computer; --===================== End of architecture =======================--