OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [processor/] [VHDL/] [ext_modules/] [ext_miniUART/] [ext_miniUART_tb.vhd] - Blame information for rev 3

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 3 jlechner
-----------------------------------------------------------------------
2
-- This file is part of SCARTS.
3
-- 
4
-- SCARTS is free software: you can redistribute it and/or modify
5
-- it under the terms of the GNU General Public License as published by
6
-- the Free Software Foundation, either version 3 of the License, or
7
-- (at your option) any later version.
8
-- 
9
-- SCARTS is distributed in the hope that it will be useful,
10
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
-- GNU General Public License for more details.
13
-- 
14
-- You should have received a copy of the GNU General Public License
15
-- along with SCARTS.  If not, see <http://www.gnu.org/licenses/>.
16
-----------------------------------------------------------------------
17
 
18
 
19
-------------------------------------------------------------------------------
20
-- Title      : miniUART Testbench
21
-- Module     : ext_miniUART
22
-- Project    : HW/SW-Codesign
23
-------------------------------------------------------------------------------
24
-- File       : ext_miniUART_tb.vhd
25
-- Author     : Roman Seiger
26
-- Company    : TU Wien - Institut für Technische Informatik
27
-- Created    : 2005-03-24
28
-- Last update: 2008-05-29
29
-------------------------------------------------------------------------------
30
 
31
-------------------------------------------------------------------------------
32
-- Tests:
33
-------------------------------------------------------------------------------
34
--General:
35
-- OFF (wrong Addr, not ExtEna)
36
-- Access Violation: write
37
-- Access Violation: read
38
-- ID
39
-- LooW/LooR
40
-- transmitting -> Output Disable
41
-- transmitting -> FSS
42
-- transmitting -> SoftReset
43
-------------------------------------------------------------------------------
44
--Transmit:
45
-- NOEVENT, transmit, polling, 8 P 1S (Even Parity)
46
-- NOEVENT, transmit, polling, 8 P 1S (Odd Parity)
47
-- NOEVENT, transmit, polling, 8 P 2S (alle weiteren P: Even Parity)
48
-- NOEVENT, transmit, polling, 8 1S 
49
-- NOEVENT, transmit, polling, 8 2S 
50
-- NOEVENT, transmit, polling, 1 P 1S 
51
-- NOEVENT, transmit, polling, 1 P 2S 
52
-- NOEVENT, transmit, polling, 1 1S 
53
-- NOEVENT, transmit, polling, 1 2S 
54
-- NOEVENT, transmit, polling, 16 P 1S 
55
-- NOEVENT, transmit, polling, 16 P 2S 
56
-- NOEVENT, transmit, polling, 16 1S 
57
-- NOEVENT, transmit, polling, 16 2S 
58
-- EV_TRCOMP, transmit, polling, 1 P 1S
59
-- EV_TRCOMP, transmit, interrupt, 1 P 1S
60
-- EV_TRCOMP -> start transmission, transmit, polling, 1 P 1S
61
-------------------------------------------------------------------------------
62
--Receive:
63
-- NOEVENT, receive, polling, 8 P 1S (Even Parity)
64
-- NOEVENT, receive, polling, 8 P 1S (Odd Parity)
65
-- NOEVENT, receive, polling, 8 P 2S (alle weiteren P: Even Parity)
66
-- NOEVENT, receive, polling, 8 1S
67
-- NOEVENT, receive, polling, 8 2S
68
-- NOEVENT, receive, polling, 1 P 1S
69
-- NOEVENT, receive, polling, 1 P 2S
70
-- NOEVENT, receive, polling, 1 1S
71
-- NOEVENT, receive, polling, 1 2S
72
-- NOEVENT, receive, polling, 16 P 1S
73
-- NOEVENT, receive, polling, 16 P 2S
74
-- NOEVENT, receive, polling, 16 1S
75
-- NOEVENT, receive, polling, 16 2S
76
-- NOEVENT, receive, polling, 1 P 1S, Parity Error + Frame Error, noTrCtrl
77
-- NOEVENT, receive, polling, 1 P 1S, Parity Error
78
-- NOEVENT, receive, polling, 1 P 1S, Frame Error
79
-- NOEVENT, receive, polling, 1 P 1S, Parity Error + ERRI
80
-- NOEVENT, receive, polling, 1 P 1S, Frame Error + ERRI
81
-- NOEVENT, receive, polling, 2 P 1S, Overflow
82
-- STARTBITDETECTION, receive, polling, 1 P 1S
83
-- STARTBITDETECTION, receive, interrupt, 1 P 1S
84
-- STARTBITDETECTION -> disable receiver, receive, polling, 1 P 1S
85
-- EV_RCOMP, receive, polling, 1 P 1S
86
-- EV_RCOMP, receive, interrupt, 1 P 1S
87
-- EV_RCOMP -> disable receiver, receive, polling, 1 P 1S
88
------------------------------------------------------------------------------- 
89
--Receive & Transmit
90
-- EV_TRCOMP -> enable receiver, 1 P 1S
91
-- EV_TRCOMP -> disable receiver, 1 P 1S
92
-- STARTBITDETECTION -> start transmission, 1 P 1S
93
-- EV_RCOMP -> start transmission, 1 P 1S
94
-- NOEVENT, receive & transmit, 8 P 1S
95
-------------------------------------------------------------------------------
96
 
97
----------------------------------------------------------------------------------
98
-- LIBRARY
99
----------------------------------------------------------------------------------
100
LIBRARY IEEE;
101
USE IEEE.std_logic_1164.all;
102
USE IEEE.std_logic_arith.all;
103
 
104
use work.pkg_basic.all;
105
use work.pkg_miniUART.all;
106
 
107
-------------------------------------------------------------------------------
108
-- ENTITY
109
-------------------------------------------------------------------------------
110
entity ext_miniUART_tb is
111
 
112
end ext_miniUART_tb;
113
 
114
-------------------------------------------------------------------------------
115
-- ARCHITECTURE
116
-------------------------------------------------------------------------------
117
architecture behaviour of ext_miniUART_tb is
118
 
119
  -- Baudraten (@ 25Mhz)
120
  -- 9600 bit/s: UBRS = 2604.16(.125)
121
--  constant BITCLK : integer := 2604;
122
--  constant UBRS_CONST : std_logic_vector(15 downto 0) := "1010001011000010";
123
 
124
  -- 19200 bit/s: UBRS = 1302.083(.0625)
125
  constant BITCLK : integer := 1302;
126
  constant UBRS_CONST : std_logic_vector(15 downto 0) := "0101000101100001";
127
 
128
  -- 115200 bit/s: UBRS = 217.0138(.0)
129
--  constant BITCLK : integer := 217;
130
--  constant UBRS_CONST : std_logic_vector(15 downto 0) := "0000110110010000";
131
 
132
  -- Daten
133
  constant DATA_CONST1 : std_logic_vector(15 downto 0) := "0000000000000001";
134
  constant DATA_CONST8 : std_logic_vector(15 downto 0) := "0000000001010101";
135
  constant DATA_CONST16 : std_logic_vector(15 downto 0) := "0101010101010101";
136
 
137
  -- BaseAddress (bei MINIUART_BASE = 51)
138
  constant MINIUART_BADDR_TB : std_logic_vector(15 downto 3) := "1111111110011";
139
 
140
  -- allgemein
141
  signal clk : std_logic := '0';
142
  -- clock constant: Dauer eines Clockticks (25Mhz = 40ns) 
143
  constant cc : time := 40 ns;
144
 
145
  constant DADDR_W : integer := 16;
146
  constant ACCVIOL_ACT : std_logic := '1';
147
  constant RES_ACT : std_logic := RST_ACT;
148
 
149
-------------------------------------------------------------------------------
150
  -- Device under Test: signale
151
  signal reset : std_logic;
152
  signal AccViol : std_logic;
153
  signal ExtEna : std_logic;
154
  signal ExtWr : std_logic;
155
  signal ExtAddr : std_logic_vector(DADDR_W-1 DOWNTO 0);
156
  signal Data2Ext : std_logic_vector(DATA_W-1 DOWNTO 0);
157
  signal ExtIntReq : std_logic;
158
  signal WrBData : std_logic_vector(DATA_W-1 DOWNTO 0);
159
 
160
  signal RxD : std_logic;  -- Empfangsleitung
161
  signal TxD : std_logic;  -- Sendeleitung
162
 
163
 
164
 
165
  signal extsel : std_logic;
166
  signal exti   : module_in_type;
167
  signal exto   : module_out_type;
168
 
169
  -- Device under Test
170
  component ext_miniUART
171
    port (
172
      clk    : IN  std_logic;
173
      extsel : in  std_logic;
174
      exti   : in  module_in_type;
175
      exto   : out module_out_type;
176
      RxD    : IN  std_logic;
177
      TxD    : OUT std_logic);
178
  end component;
179
 
180
 
181
 
182
-------------------------------------------------------------------------------
183
 
184
-------------------------------------------------------------------------------
185
-- BEGIN ARCHITECTURE
186
-------------------------------------------------------------------------------
187
  begin  -- behaviour
188
 
189
-------------------------------------------------------------------------------
190
    -- DuT: Port map
191
    ext_miniUART_1: ext_miniUART
192
      port map (
193
        clk    => clk,
194
        extsel => extsel,
195
        exti   => exti,
196
        exto   => exto,
197
        RxD    => RxD,
198
        TxD    => TxD);
199
 
200
 
201
 
202
-------------------------------------------------------------------------------
203
 
204
    -- Clock Generator
205
    CLKGEN : PROCESS
206
     BEGIN
207
       clk <= '1';
208
       wait for cc/2;
209
       clk <= '0';
210
       wait for cc/2;
211
     END PROCESS CLKGEN;
212
 
213
 
214
     interface_wrapper: process (reset, AccViol, ExtAddr, ExtWr, ExtEna, Data2Ext)
215
     begin  -- process interface_wrapper
216
       extsel           <= ExtEna;
217
       exti.reset       <= reset;
218
       exti.write_en    <= ExtWr;
219
       exti.byte_en     <= "0011";
220
       exti.data        <= Data2Ext&Data2Ext;
221
       exti.addr        <= ExtAddr(14 downto 0);
222
     end process interface_wrapper;
223
 
224
 
225
     -- Testprocess
226
     test: process
227
       -- "cycles" Clockcycles abwarten
228
       procedure icwait(cycles: Natural) is
229
       begin
230
         for i in 1 to cycles loop
231
           wait until clk= '0' and clk'event;
232
         end loop;
233
       end icwait;
234
 
235
     begin  -- test
236
 
237
-------------------------------------------------------------------------------       
238
--GENERAL:
239
-- OFF (wrong Addr, not ExtEna)
240
       reset <= RES_ACT;
241
       icwait(5);
242
 
243
       reset <= not RES_ACT;
244
       AccViol <= not ACCVIOL_ACT;
245
       RxD <= '1';
246
       Data2Ext <= (others => '0');
247
       ExtEna <= not EXT_ACT;
248
 
249
       -- irgendwas lesen (wrong Addr)
250
       ExtAddr <= ("0000000000000000");
251
       ExtWr <= '0';
252
       ExtEna <= EXT_ACT;
253
       icwait(2);
254
       ExtEna <= not EXT_ACT;
255
       icwait(2);
256
 
257
       -- Status lesen (not ExtEna)
258
       ExtAddr <= "1111111110011000";
259
       ExtWr <= '0';
260
       ExtEna <= not EXT_ACT;
261
       icwait(2);
262
       ExtEna <= not EXT_ACT;
263
       icwait(2);
264
 
265
       icwait(BITCLK/2);
266
 
267
-- Access Violation: write
268
       reset <= not RES_ACT;
269
       AccViol <= not ACCVIOL_ACT;
270
       RxD <= '1';
271
       Data2Ext <= (others => '0');
272
       ExtEna <= not EXT_ACT;
273
 
274
       -- MSGREG setzen (AccViol)
275
       ExtAddr <= "1111111110011100";
276
       ExtWr <= '1';
277
       Data2Ext <= "1000100010001000";
278
       AccViol <= ACCVIOL_ACT;
279
       ExtEna <= EXT_ACT;
280
       icwait(2);
281
       ExtEna <= not EXT_ACT;
282
       icwait(2);
283
 
284
       AccViol <= not ACCVIOL_ACT;
285
 
286
       -- MSGREG lesen
287
       ExtAddr <= "1111111110011100";
288
       ExtWr <= '0';
289
       ExtEna <= EXT_ACT;
290
       icwait(2);
291
       ExtEna <= not EXT_ACT;
292
       icwait(2);
293
 
294
       icwait(BITCLK/2);
295
 
296
-- Access Violation: read
297
       reset <= not RES_ACT;
298
       AccViol <= not ACCVIOL_ACT;
299
       RxD <= '1';
300
       Data2Ext <= (others => '0');
301
       ExtEna <= not EXT_ACT;
302
 
303
       -- Status lesen (AccViol)
304
       ExtAddr <= "1111111110011000";
305
       ExtWr <= '0';
306
       AccViol <= ACCVIOL_ACT;
307
       ExtEna <= EXT_ACT;
308
       icwait(2);
309
       ExtEna <= not EXT_ACT;
310
       icwait(2);
311
 
312
       AccViol <= not ACCVIOL_ACT;
313
 
314
       icwait(BITCLK/2);
315
 
316
-- ID
317
       reset <= not RES_ACT;
318
       AccViol <= not ACCVIOL_ACT;
319
       RxD <= '1';
320
       Data2Ext <= (others => '0');
321
       ExtEna <= not EXT_ACT;
322
 
323
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, Id, noINTA
324
       ExtAddr <= "1111111110011001";
325
       ExtWr <= '1';
326
       Data2Ext <= "0000000000000010";
327
       ExtEna <= EXT_ACT;
328
       icwait(2);
329
       ExtEna <= not EXT_ACT;
330
       icwait(2);
331
 
332
       -- DATA0 lesen
333
       ExtAddr <= "1111111110011010";
334
       ExtWr <= '0';
335
       ExtEna <= EXT_ACT;
336
       icwait(2);
337
       ExtEna <= not EXT_ACT;
338
       icwait(2);
339
 
340
       -- DATA1 lesen
341
       ExtAddr <= "1111111110011011";
342
       ExtWr <= '0';
343
       ExtEna <= EXT_ACT;
344
       icwait(2);
345
       ExtEna <= not EXT_ACT;
346
       icwait(2);
347
 
348
       icwait(BITCLK/2);
349
 
350
-- LooW/LooR
351
       reset <= not RES_ACT;
352
       AccViol <= not ACCVIOL_ACT;
353
       RxD <= '1';
354
       Data2Ext <= (others => '0');
355
       ExtEna <= not EXT_ACT;
356
 
357
       -- CONF setzen: LooW, noEFSS, noOutD, noSRes, noId, noINTA
358
       ExtAddr <= "1111111110011001";
359
       ExtWr <= '1';
360
       Data2Ext <= "0000000010000000";
361
       ExtEna <= EXT_ACT;
362
       icwait(2);
363
       ExtEna <= not EXT_ACT;
364
       icwait(2);
365
 
366
       -- Status lesen
367
       ExtAddr <= "1111111110011000";
368
       ExtWr <= '0';
369
       ExtEna <= EXT_ACT;
370
       icwait(2);
371
       ExtEna <= not EXT_ACT;
372
       icwait(2);
373
 
374
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, noINTA
375
       ExtAddr <= "1111111110011001";
376
       ExtWr <= '1';
377
       Data2Ext <= "0000000000000000";
378
       ExtEna <= EXT_ACT;
379
       icwait(2);
380
       ExtEna <= not EXT_ACT;
381
       icwait(2);
382
 
383
       -- Status lesen
384
       ExtAddr <= "1111111110011000";
385
       ExtWr <= '0';
386
       ExtEna <= EXT_ACT;
387
       icwait(2);
388
       ExtEna <= not EXT_ACT;
389
       icwait(2);
390
 
391
       icwait(BITCLK/2);
392
 
393
-- transmitting -> Output Disable
394
       reset <= not RES_ACT;
395
       AccViol <= not ACCVIOL_ACT;
396
       RxD <= '1';
397
       Data2Ext <= (others => '0');
398
       ExtEna <= not EXT_ACT;
399
 
400
       -- UBRS setzen
401
       ExtAddr <= "1111111110011111";
402
       ExtWr <= '1';
403
       Data2Ext <= UBRS_CONST;
404
       ExtEna <= EXT_ACT;
405
       icwait(2);
406
       ExtEna <= not EXT_ACT;
407
       icwait(2);
408
 
409
       -- UARTCONF setzen: 8 P Even 1S, noTrCtrl
410
       ExtAddr <= "1111111110011010";
411
       ExtWr <= '1';
412
       Data2Ext <= "1000011100000000";
413
       ExtEna <= EXT_ACT;
414
       icwait(2);
415
       ExtEna <= not EXT_ACT;
416
       icwait(2);
417
 
418
       -- MSGREG setzen
419
       ExtAddr <= "1111111110011100";
420
       ExtWr <= '1';
421
       Data2Ext <= DATA_CONST8;
422
       ExtEna <= EXT_ACT;
423
       icwait(2);
424
       ExtEna <= not EXT_ACT;
425
       icwait(2);
426
 
427
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
428
       ExtAddr <= "1111111110011011";
429
       ExtWr <= '1';
430
       Data2Ext <= "0000000000011000";
431
       ExtEna <= EXT_ACT;
432
       icwait(2);
433
       ExtEna <= not EXT_ACT;
434
       icwait(2);
435
 
436
       icwait(3*BITCLK);
437
 
438
       -- CONF setzen: noLooW, noEFSS, OutD, noSRes, noId, noINTA
439
       ExtAddr <= "1111111110011001";
440
       ExtWr <= '1';
441
       Data2Ext <= "0000000000001000";
442
       ExtEna <= EXT_ACT;
443
       icwait(2);
444
       ExtEna <= not EXT_ACT;
445
       icwait(2);
446
 
447
       icwait(2*BITCLK);
448
 
449
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, noINTA
450
       ExtAddr <= "1111111110011001";
451
       ExtWr <= '1';
452
       Data2Ext <= "0000000000000000";
453
       ExtEna <= EXT_ACT;
454
       icwait(2);
455
       ExtEna <= not EXT_ACT;
456
       icwait(2);
457
 
458
       icwait(BITCLK/2);
459
 
460
       reset <= RES_ACT;
461
       icwait(5);
462
 
463
-- transmitting -> FSS
464
       reset <= not RES_ACT;
465
       AccViol <= not ACCVIOL_ACT;
466
       RxD <= '1';
467
       Data2Ext <= (others => '0');
468
       ExtEna <= not EXT_ACT;
469
 
470
       -- UBRS setzen
471
       ExtAddr <= "1111111110011111";
472
       ExtWr <= '1';
473
       Data2Ext <= UBRS_CONST;
474
       ExtEna <= EXT_ACT;
475
       icwait(2);
476
       ExtEna <= not EXT_ACT;
477
       icwait(2);
478
 
479
       -- UARTCONF setzen: 8 P Even 1S, noTrCtrl
480
       ExtAddr <= "1111111110011010";
481
       ExtWr <= '1';
482
       Data2Ext <= "1000011100000000";
483
       ExtEna <= EXT_ACT;
484
       icwait(2);
485
       ExtEna <= not EXT_ACT;
486
       icwait(2);
487
 
488
       -- MSGREG setzen
489
       ExtAddr <= "1111111110011100";
490
       ExtWr <= '1';
491
       Data2Ext <= DATA_CONST8;
492
       ExtEna <= EXT_ACT;
493
       icwait(2);
494
       ExtEna <= not EXT_ACT;
495
       icwait(2);
496
 
497
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
498
       ExtAddr <= "1111111110011011";
499
       ExtWr <= '1';
500
       Data2Ext <= "0000000000011000";
501
       ExtEna <= EXT_ACT;
502
       icwait(2);
503
       ExtEna <= not EXT_ACT;
504
       icwait(2);
505
 
506
       icwait(3*BITCLK);
507
 
508
       -- CONF setzen: noLooW, EFSS, noOutD, noSRes, noId, noINTA
509
       ExtAddr <= "1111111110011001";
510
       ExtWr <= '1';
511
       Data2Ext <= "0000000000010000";
512
       ExtEna <= EXT_ACT;
513
       icwait(2);
514
       ExtEna <= not EXT_ACT;
515
       icwait(2);
516
 
517
       -- Status lesen
518
       ExtAddr <= "1111111110011000";
519
       ExtWr <= '0';
520
       ExtEna <= EXT_ACT;
521
       icwait(2);
522
       ExtEna <= not EXT_ACT;
523
       icwait(2);
524
 
525
       icwait(BITCLK/2);
526
 
527
       reset <= RES_ACT;
528
       icwait(5);
529
 
530
-- transmitting -> SoftReset
531
       reset <= not RES_ACT;
532
       AccViol <= not ACCVIOL_ACT;
533
       RxD <= '1';
534
       Data2Ext <= (others => '0');
535
       ExtEna <= not EXT_ACT;
536
 
537
       -- UBRS setzen
538
       ExtAddr <= "1111111110011111";
539
       ExtWr <= '1';
540
       Data2Ext <= UBRS_CONST;
541
       ExtEna <= EXT_ACT;
542
       icwait(2);
543
       ExtEna <= not EXT_ACT;
544
       icwait(2);
545
 
546
       -- UARTCONF setzen: 8 P Even 1S, noTrCtrl
547
       ExtAddr <= "1111111110011010";
548
       ExtWr <= '1';
549
       Data2Ext <= "1000011100000000";
550
       ExtEna <= EXT_ACT;
551
       icwait(2);
552
       ExtEna <= not EXT_ACT;
553
       icwait(2);
554
 
555
       -- MSGREG setzen
556
       ExtAddr <= "1111111110011100";
557
       ExtWr <= '1';
558
       Data2Ext <= DATA_CONST8;
559
       ExtEna <= EXT_ACT;
560
       icwait(2);
561
       ExtEna <= not EXT_ACT;
562
       icwait(2);
563
 
564
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
565
       ExtAddr <= "1111111110011011";
566
       ExtWr <= '1';
567
       Data2Ext <= "0000000000011000";
568
       ExtEna <= EXT_ACT;
569
       icwait(2);
570
       ExtEna <= not EXT_ACT;
571
       icwait(2);
572
 
573
       icwait(3*BITCLK);
574
 
575
       -- CONF setzen: noLooW, noEFSS, noOutD, SRes, noId, noINTA
576
       ExtAddr <= "1111111110011001";
577
       ExtWr <= '1';
578
       Data2Ext <= "0000000000000100";
579
       ExtEna <= EXT_ACT;
580
       icwait(2);
581
       ExtEna <= not EXT_ACT;
582
       icwait(2);
583
 
584
       icwait(BITCLK/2);
585
 
586
       reset <= RES_ACT;
587
       icwait(5);
588
 
589
-------------------------------------------------------------------------------
590
--Transmit:
591
-- NOEVENT, transmit, polling, 8 P 1S (Even Parity)
592
       reset <= not RES_ACT;
593
       AccViol <= not ACCVIOL_ACT;
594
       RxD <= '1';
595
       Data2Ext <= (others => '0');
596
       ExtEna <= not EXT_ACT;
597
 
598
       -- UBRS setzen
599
       ExtAddr <= "1111111110011111";
600
       ExtWr <= '1';
601
       Data2Ext <= UBRS_CONST;
602
       ExtEna <= EXT_ACT;
603
       icwait(2);
604
       ExtEna <= not EXT_ACT;
605
       icwait(2);
606
 
607
       -- UARTCONF setzen: 8 P Even 1S, noTrCtrl
608
       ExtAddr <= "1111111110011010";
609
       ExtWr <= '1';
610
       Data2Ext <= "1000011100000000";
611
       ExtEna <= EXT_ACT;
612
       icwait(2);
613
       ExtEna <= not EXT_ACT;
614
       icwait(2);
615
 
616
       -- MSGREG setzen
617
       ExtAddr <= "1111111110011100";
618
       ExtWr <= '1';
619
       Data2Ext <= DATA_CONST8;
620
       ExtEna <= EXT_ACT;
621
       icwait(2);
622
       ExtEna <= not EXT_ACT;
623
       icwait(2);
624
 
625
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
626
       ExtAddr <= "1111111110011011";
627
       ExtWr <= '1';
628
       Data2Ext <= "0000000000011000";
629
       ExtEna <= EXT_ACT;
630
       icwait(2);
631
       ExtEna <= not EXT_ACT;
632
       icwait(2);
633
 
634
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
635
       ExtAddr <= "1111111110011011";
636
       ExtWr <= '1';
637
       Data2Ext <= "0000000000000000";
638
       ExtEna <= EXT_ACT;
639
       icwait(2);
640
       ExtEna <= not EXT_ACT;
641
       icwait(2);
642
 
643
       -- 12 bits warten (1 start + 8 data + 1 parity + 1 Stop = 11 + 1 zum Überprüfen)
644
       icwait(12*BITCLK);
645
 
646
-- NOEVENT, transmit, polling, 8 P 1S (Odd Parity)
647
       reset <= not RES_ACT;
648
       AccViol <= not ACCVIOL_ACT;
649
       RxD <= '1';
650
       Data2Ext <= (others => '0');
651
       ExtEna <= not EXT_ACT;
652
 
653
       -- UBRS setzen
654
       ExtAddr <= "1111111110011111";
655
       ExtWr <= '1';
656
       Data2Ext <= UBRS_CONST;
657
       ExtEna <= EXT_ACT;
658
       icwait(2);
659
       ExtEna <= not EXT_ACT;
660
       icwait(2);
661
 
662
       -- UARTCONF setzen: 8 P Odd 1S, noTrCtrl
663
       ExtAddr <= "1111111110011010";
664
       ExtWr <= '1';
665
       Data2Ext <= "1100011100000000";
666
       ExtEna <= EXT_ACT;
667
       icwait(2);
668
       ExtEna <= not EXT_ACT;
669
       icwait(2);
670
 
671
       -- MSGREG setzen
672
       ExtAddr <= "1111111110011100";
673
       ExtWr <= '1';
674
       Data2Ext <= DATA_CONST8;
675
       ExtEna <= EXT_ACT;
676
       icwait(2);
677
       ExtEna <= not EXT_ACT;
678
       icwait(2);
679
 
680
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
681
       ExtAddr <= "1111111110011011";
682
       ExtWr <= '1';
683
       Data2Ext <= "0000000000011000";
684
       ExtEna <= EXT_ACT;
685
       icwait(2);
686
       ExtEna <= not EXT_ACT;
687
       icwait(2);
688
 
689
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
690
       ExtAddr <= "1111111110011011";
691
       ExtWr <= '1';
692
       Data2Ext <= "0000000000000000";
693
       ExtEna <= EXT_ACT;
694
       icwait(2);
695
       ExtEna <= not EXT_ACT;
696
       icwait(2);
697
 
698
       -- 12 bits warten (1 start + 8 data + 1 parity + 1 Stop = 11 + 1 zum Überprüfen)
699
       icwait(12*BITCLK);
700
 
701
-- NOEVENT, transmit, polling, 8 P 2S (alle weiteren P: Even Parity)
702
       reset <= not RES_ACT;
703
       AccViol <= not ACCVIOL_ACT;
704
       RxD <= '1';
705
       Data2Ext <= (others => '0');
706
       ExtEna <= not EXT_ACT;
707
 
708
       -- UBRS setzen
709
       ExtAddr <= "1111111110011111";
710
       ExtWr <= '1';
711
       Data2Ext <= UBRS_CONST;
712
       ExtEna <= EXT_ACT;
713
       icwait(2);
714
       ExtEna <= not EXT_ACT;
715
       icwait(2);
716
 
717
       -- UARTCONF setzen: 8 P Even 2S, noTrCtrl
718
       ExtAddr <= "1111111110011010";
719
       ExtWr <= '1';
720
       Data2Ext <= "1010011100000000";
721
       ExtEna <= EXT_ACT;
722
       icwait(2);
723
       ExtEna <= not EXT_ACT;
724
       icwait(2);
725
 
726
       -- MSGREG setzen
727
       ExtAddr <= "1111111110011100";
728
       ExtWr <= '1';
729
       Data2Ext <= DATA_CONST8;
730
       ExtEna <= EXT_ACT;
731
       icwait(2);
732
       ExtEna <= not EXT_ACT;
733
       icwait(2);
734
 
735
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
736
       ExtAddr <= "1111111110011011";
737
       ExtWr <= '1';
738
       Data2Ext <= "0000000000011000";
739
       ExtEna <= EXT_ACT;
740
       icwait(2);
741
       ExtEna <= not EXT_ACT;
742
       icwait(2);
743
 
744
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
745
       ExtAddr <= "1111111110011011";
746
       ExtWr <= '1';
747
       Data2Ext <= "0000000000000000";
748
       ExtEna <= EXT_ACT;
749
       icwait(2);
750
       ExtEna <= not EXT_ACT;
751
       icwait(2);
752
 
753
       -- 13 bits warten (1 start + 8 data + 1 parity + 2 Stop = 12 + 1 zum Überprüfen)
754
       icwait(13*BITCLK);
755
 
756
-- NOEVENT, transmit, polling, 8 1S 
757
       reset <= not RES_ACT;
758
       AccViol <= not ACCVIOL_ACT;
759
       RxD <= '1';
760
       Data2Ext <= (others => '0');
761
       ExtEna <= not EXT_ACT;
762
 
763
       -- UBRS setzen
764
       ExtAddr <= "1111111110011111";
765
       ExtWr <= '1';
766
       Data2Ext <= UBRS_CONST;
767
       ExtEna <= EXT_ACT;
768
       icwait(2);
769
       ExtEna <= not EXT_ACT;
770
       icwait(2);
771
 
772
       -- UARTCONF setzen: 8 1S, noTrCtrl
773
       ExtAddr <= "1111111110011010";
774
       ExtWr <= '1';
775
       Data2Ext <= "0000011100000000";
776
       ExtEna <= EXT_ACT;
777
       icwait(2);
778
       ExtEna <= not EXT_ACT;
779
       icwait(2);
780
 
781
       -- MSGREG setzen
782
       ExtAddr <= "1111111110011100";
783
       ExtWr <= '1';
784
       Data2Ext <= DATA_CONST8;
785
       ExtEna <= EXT_ACT;
786
       icwait(2);
787
       ExtEna <= not EXT_ACT;
788
       icwait(2);
789
 
790
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
791
       ExtAddr <= "1111111110011011";
792
       ExtWr <= '1';
793
       Data2Ext <= "0000000000011000";
794
       ExtEna <= EXT_ACT;
795
       icwait(2);
796
       ExtEna <= not EXT_ACT;
797
       icwait(2);
798
 
799
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
800
       ExtAddr <= "1111111110011011";
801
       ExtWr <= '1';
802
       Data2Ext <= "0000000000000000";
803
       ExtEna <= EXT_ACT;
804
       icwait(2);
805
       ExtEna <= not EXT_ACT;
806
       icwait(2);
807
 
808
       -- 11 bits warten (1 start + 8 data + 1 Stop = 10 + 1 zum Überprüfen)
809
       icwait(11*BITCLK);
810
 
811
-- NOEVENT, transmit, polling, 8 2S 
812
       reset <= not RES_ACT;
813
       AccViol <= not ACCVIOL_ACT;
814
       RxD <= '1';
815
       Data2Ext <= (others => '0');
816
       ExtEna <= not EXT_ACT;
817
 
818
       -- UBRS setzen
819
       ExtAddr <= "1111111110011111";
820
       ExtWr <= '1';
821
       Data2Ext <= UBRS_CONST;
822
       ExtEna <= EXT_ACT;
823
       icwait(2);
824
       ExtEna <= not EXT_ACT;
825
       icwait(2);
826
 
827
       -- UARTCONF setzen: 8 2S, noTrCtrl
828
       ExtAddr <= "1111111110011010";
829
       ExtWr <= '1';
830
       Data2Ext <= "0010011100000000";
831
       ExtEna <= EXT_ACT;
832
       icwait(2);
833
       ExtEna <= not EXT_ACT;
834
       icwait(2);
835
 
836
       -- MSGREG setzen
837
       ExtAddr <= "1111111110011100";
838
       ExtWr <= '1';
839
       Data2Ext <= DATA_CONST8;
840
       ExtEna <= EXT_ACT;
841
       icwait(2);
842
       ExtEna <= not EXT_ACT;
843
       icwait(2);
844
 
845
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
846
       ExtAddr <= "1111111110011011";
847
       ExtWr <= '1';
848
       Data2Ext <= "0000000000011000";
849
       ExtEna <= EXT_ACT;
850
       icwait(2);
851
       ExtEna <= not EXT_ACT;
852
       icwait(2);
853
 
854
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
855
       ExtAddr <= "1111111110011011";
856
       ExtWr <= '1';
857
       Data2Ext <= "0000000000000000";
858
       ExtEna <= EXT_ACT;
859
       icwait(2);
860
       ExtEna <= not EXT_ACT;
861
       icwait(2);
862
 
863
       -- 12 bits warten (1 start + 8 data + 2 Stop = 11 + 1 zum Überprüfen)
864
       icwait(12*BITCLK);
865
 
866
-- NOEVENT, transmit, polling, 1 P 1S 
867
       reset <= not RES_ACT;
868
       AccViol <= not ACCVIOL_ACT;
869
       RxD <= '1';
870
       Data2Ext <= (others => '0');
871
       ExtEna <= not EXT_ACT;
872
 
873
       -- UBRS setzen
874
       ExtAddr <= "1111111110011111";
875
       ExtWr <= '1';
876
       Data2Ext <= UBRS_CONST;
877
       ExtEna <= EXT_ACT;
878
       icwait(2);
879
       ExtEna <= not EXT_ACT;
880
       icwait(2);
881
 
882
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
883
       ExtAddr <= "1111111110011010";
884
       ExtWr <= '1';
885
       Data2Ext <= "1000000000000000";
886
       ExtEna <= EXT_ACT;
887
       icwait(2);
888
       ExtEna <= not EXT_ACT;
889
       icwait(2);
890
 
891
       -- MSGREG setzen
892
       ExtAddr <= "1111111110011100";
893
       ExtWr <= '1';
894
       Data2Ext <= DATA_CONST1;
895
       ExtEna <= EXT_ACT;
896
       icwait(2);
897
       ExtEna <= not EXT_ACT;
898
       icwait(2);
899
 
900
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
901
       ExtAddr <= "1111111110011011";
902
       ExtWr <= '1';
903
       Data2Ext <= "0000000000011000";
904
       ExtEna <= EXT_ACT;
905
       icwait(2);
906
       ExtEna <= not EXT_ACT;
907
       icwait(2);
908
 
909
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
910
       ExtAddr <= "1111111110011011";
911
       ExtWr <= '1';
912
       Data2Ext <= "0000000000000000";
913
       ExtEna <= EXT_ACT;
914
       icwait(2);
915
       ExtEna <= not EXT_ACT;
916
       icwait(2);
917
 
918
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
919
       icwait(5*BITCLK);
920
 
921
-- NOEVENT, transmit, polling, 1 P 2S 
922
       reset <= not RES_ACT;
923
       AccViol <= not ACCVIOL_ACT;
924
       RxD <= '1';
925
       Data2Ext <= (others => '0');
926
       ExtEna <= not EXT_ACT;
927
 
928
       -- UBRS setzen
929
       ExtAddr <= "1111111110011111";
930
       ExtWr <= '1';
931
       Data2Ext <= UBRS_CONST;
932
       ExtEna <= EXT_ACT;
933
       icwait(2);
934
       ExtEna <= not EXT_ACT;
935
       icwait(2);
936
 
937
       -- UARTCONF setzen: 1 P Even 2S, noTrCtrl
938
       ExtAddr <= "1111111110011010";
939
       ExtWr <= '1';
940
       Data2Ext <= "1010000000000000";
941
       ExtEna <= EXT_ACT;
942
       icwait(2);
943
       ExtEna <= not EXT_ACT;
944
       icwait(2);
945
 
946
       -- MSGREG setzen
947
       ExtAddr <= "1111111110011100";
948
       ExtWr <= '1';
949
       Data2Ext <= DATA_CONST1;
950
       ExtEna <= EXT_ACT;
951
       icwait(2);
952
       ExtEna <= not EXT_ACT;
953
       icwait(2);
954
 
955
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
956
       ExtAddr <= "1111111110011011";
957
       ExtWr <= '1';
958
       Data2Ext <= "0000000000011000";
959
       ExtEna <= EXT_ACT;
960
       icwait(2);
961
       ExtEna <= not EXT_ACT;
962
       icwait(2);
963
 
964
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
965
       ExtAddr <= "1111111110011011";
966
       ExtWr <= '1';
967
       Data2Ext <= "0000000000000000";
968
       ExtEna <= EXT_ACT;
969
       icwait(2);
970
       ExtEna <= not EXT_ACT;
971
       icwait(2);
972
 
973
       -- 6 bits warten (1 start + 1 data + 1 parity + 2 Stop = 5 + 1 zum Überprüfen)
974
       icwait(6*BITCLK);
975
 
976
-- NOEVENT, transmit, polling, 1 1S 
977
       reset <= not RES_ACT;
978
       AccViol <= not ACCVIOL_ACT;
979
       RxD <= '1';
980
       Data2Ext <= (others => '0');
981
       ExtEna <= not EXT_ACT;
982
 
983
       -- UBRS setzen
984
       ExtAddr <= "1111111110011111";
985
       ExtWr <= '1';
986
       Data2Ext <= UBRS_CONST;
987
       ExtEna <= EXT_ACT;
988
       icwait(2);
989
       ExtEna <= not EXT_ACT;
990
       icwait(2);
991
 
992
       -- UARTCONF setzen: 1 1S, noTrCtrl
993
       ExtAddr <= "1111111110011010";
994
       ExtWr <= '1';
995
       Data2Ext <= "0000000000000000";
996
       ExtEna <= EXT_ACT;
997
       icwait(2);
998
       ExtEna <= not EXT_ACT;
999
       icwait(2);
1000
 
1001
       -- MSGREG setzen
1002
       ExtAddr <= "1111111110011100";
1003
       ExtWr <= '1';
1004
       Data2Ext <= DATA_CONST1;
1005
       ExtEna <= EXT_ACT;
1006
       icwait(2);
1007
       ExtEna <= not EXT_ACT;
1008
       icwait(2);
1009
 
1010
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1011
       ExtAddr <= "1111111110011011";
1012
       ExtWr <= '1';
1013
       Data2Ext <= "0000000000011000";
1014
       ExtEna <= EXT_ACT;
1015
       icwait(2);
1016
       ExtEna <= not EXT_ACT;
1017
       icwait(2);
1018
 
1019
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1020
       ExtAddr <= "1111111110011011";
1021
       ExtWr <= '1';
1022
       Data2Ext <= "0000000000000000";
1023
       ExtEna <= EXT_ACT;
1024
       icwait(2);
1025
       ExtEna <= not EXT_ACT;
1026
       icwait(2);
1027
 
1028
       -- 4 bits warten (1 start + 1 data + 1 Stop = 3 + 1 zum Überprüfen)
1029
       icwait(4*BITCLK);
1030
 
1031
-- NOEVENT, transmit, polling, 1 2S 
1032
       reset <= not RES_ACT;
1033
       AccViol <= not ACCVIOL_ACT;
1034
       RxD <= '1';
1035
       Data2Ext <= (others => '0');
1036
       ExtEna <= not EXT_ACT;
1037
 
1038
       -- UBRS setzen
1039
       ExtAddr <= "1111111110011111";
1040
       ExtWr <= '1';
1041
       Data2Ext <= UBRS_CONST;
1042
       ExtEna <= EXT_ACT;
1043
       icwait(2);
1044
       ExtEna <= not EXT_ACT;
1045
       icwait(2);
1046
 
1047
       -- UARTCONF setzen: 1  2S, noTrCtrl
1048
       ExtAddr <= "1111111110011010";
1049
       ExtWr <= '1';
1050
       Data2Ext <= "0010000000000000";
1051
       ExtEna <= EXT_ACT;
1052
       icwait(2);
1053
       ExtEna <= not EXT_ACT;
1054
       icwait(2);
1055
 
1056
       -- MSGREG setzen
1057
       ExtAddr <= "1111111110011100";
1058
       ExtWr <= '1';
1059
       Data2Ext <= DATA_CONST1;
1060
       ExtEna <= EXT_ACT;
1061
       icwait(2);
1062
       ExtEna <= not EXT_ACT;
1063
       icwait(2);
1064
 
1065
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1066
       ExtAddr <= "1111111110011011";
1067
       ExtWr <= '1';
1068
       Data2Ext <= "0000000000011000";
1069
       ExtEna <= EXT_ACT;
1070
       icwait(2);
1071
       ExtEna <= not EXT_ACT;
1072
       icwait(2);
1073
 
1074
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1075
       ExtAddr <= "1111111110011011";
1076
       ExtWr <= '1';
1077
       Data2Ext <= "0000000000000000";
1078
       ExtEna <= EXT_ACT;
1079
       icwait(2);
1080
       ExtEna <= not EXT_ACT;
1081
       icwait(2);
1082
 
1083
       -- 5 bits warten (1 start + 1 data + 2 Stop = 4 + 1 zum Überprüfen)
1084
       icwait(5*BITCLK);
1085
 
1086
-- NOEVENT, transmit, polling, 16 P 1S 
1087
       reset <= not RES_ACT;
1088
       AccViol <= not ACCVIOL_ACT;
1089
       RxD <= '1';
1090
       Data2Ext <= (others => '0');
1091
       ExtEna <= not EXT_ACT;
1092
 
1093
       -- UBRS setzen
1094
       ExtAddr <= "1111111110011111";
1095
       ExtWr <= '1';
1096
       Data2Ext <= UBRS_CONST;
1097
       ExtEna <= EXT_ACT;
1098
       icwait(2);
1099
       ExtEna <= not EXT_ACT;
1100
       icwait(2);
1101
 
1102
       -- UARTCONF setzen: 16 P Even 1S, noTrCtrl
1103
       ExtAddr <= "1111111110011010";
1104
       ExtWr <= '1';
1105
       Data2Ext <= "1000111100000000";
1106
       ExtEna <= EXT_ACT;
1107
       icwait(2);
1108
       ExtEna <= not EXT_ACT;
1109
       icwait(2);
1110
 
1111
       -- MSGREG setzen
1112
       ExtAddr <= "1111111110011100";
1113
       ExtWr <= '1';
1114
       Data2Ext <= DATA_CONST16;
1115
       ExtEna <= EXT_ACT;
1116
       icwait(2);
1117
       ExtEna <= not EXT_ACT;
1118
       icwait(2);
1119
 
1120
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1121
       ExtAddr <= "1111111110011011";
1122
       ExtWr <= '1';
1123
       Data2Ext <= "0000000000011000";
1124
       ExtEna <= EXT_ACT;
1125
       icwait(2);
1126
       ExtEna <= not EXT_ACT;
1127
       icwait(2);
1128
 
1129
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1130
       ExtAddr <= "1111111110011011";
1131
       ExtWr <= '1';
1132
       Data2Ext <= "0000000000000000";
1133
       ExtEna <= EXT_ACT;
1134
       icwait(2);
1135
       ExtEna <= not EXT_ACT;
1136
       icwait(2);
1137
 
1138
       -- 20 bits warten (1 start + 16 data + 1 parity + 1 Stop = 19 + 1 zum Überprüfen)
1139
       icwait(20*BITCLK);
1140
 
1141
-- NOEVENT, transmit, polling, 16 P 2S 
1142
       reset <= not RES_ACT;
1143
       AccViol <= not ACCVIOL_ACT;
1144
       RxD <= '1';
1145
       Data2Ext <= (others => '0');
1146
       ExtEna <= not EXT_ACT;
1147
 
1148
       -- UBRS setzen
1149
       ExtAddr <= "1111111110011111";
1150
       ExtWr <= '1';
1151
       Data2Ext <= UBRS_CONST;
1152
       ExtEna <= EXT_ACT;
1153
       icwait(2);
1154
       ExtEna <= not EXT_ACT;
1155
       icwait(2);
1156
 
1157
       -- UARTCONF setzen: 16 P Even 2S, noTrCtrl
1158
       ExtAddr <= "1111111110011010";
1159
       ExtWr <= '1';
1160
       Data2Ext <= "1010111100000000";
1161
       ExtEna <= EXT_ACT;
1162
       icwait(2);
1163
       ExtEna <= not EXT_ACT;
1164
       icwait(2);
1165
 
1166
       -- MSGREG setzen
1167
       ExtAddr <= "1111111110011100";
1168
       ExtWr <= '1';
1169
       Data2Ext <= DATA_CONST16;
1170
       ExtEna <= EXT_ACT;
1171
       icwait(2);
1172
       ExtEna <= not EXT_ACT;
1173
       icwait(2);
1174
 
1175
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1176
       ExtAddr <= "1111111110011011";
1177
       ExtWr <= '1';
1178
       Data2Ext <= "0000000000011000";
1179
       ExtEna <= EXT_ACT;
1180
       icwait(2);
1181
       ExtEna <= not EXT_ACT;
1182
       icwait(2);
1183
 
1184
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1185
       ExtAddr <= "1111111110011011";
1186
       ExtWr <= '1';
1187
       Data2Ext <= "0000000000000000";
1188
       ExtEna <= EXT_ACT;
1189
       icwait(2);
1190
       ExtEna <= not EXT_ACT;
1191
       icwait(2);
1192
 
1193
       -- 21 bits warten (1 start + 16 data + 1 parity + 2 Stop = 20 + 1 zum Überprüfen)
1194
       icwait(21*BITCLK);
1195
 
1196
-- NOEVENT, transmit, polling, 16 1S 
1197
       reset <= not RES_ACT;
1198
       AccViol <= not ACCVIOL_ACT;
1199
       RxD <= '1';
1200
       Data2Ext <= (others => '0');
1201
       ExtEna <= not EXT_ACT;
1202
 
1203
       -- UBRS setzen
1204
       ExtAddr <= "1111111110011111";
1205
       ExtWr <= '1';
1206
       Data2Ext <= UBRS_CONST;
1207
       ExtEna <= EXT_ACT;
1208
       icwait(2);
1209
       ExtEna <= not EXT_ACT;
1210
       icwait(2);
1211
 
1212
       -- UARTCONF setzen: 16 1S, noTrCtrl
1213
       ExtAddr <= "1111111110011010";
1214
       ExtWr <= '1';
1215
       Data2Ext <= "0000111100000000";
1216
       ExtEna <= EXT_ACT;
1217
       icwait(2);
1218
       ExtEna <= not EXT_ACT;
1219
       icwait(2);
1220
 
1221
       -- MSGREG setzen
1222
       ExtAddr <= "1111111110011100";
1223
       ExtWr <= '1';
1224
       Data2Ext <= DATA_CONST16;
1225
       ExtEna <= EXT_ACT;
1226
       icwait(2);
1227
       ExtEna <= not EXT_ACT;
1228
       icwait(2);
1229
 
1230
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1231
       ExtAddr <= "1111111110011011";
1232
       ExtWr <= '1';
1233
       Data2Ext <= "0000000000011000";
1234
       ExtEna <= EXT_ACT;
1235
       icwait(2);
1236
       ExtEna <= not EXT_ACT;
1237
       icwait(2);
1238
 
1239
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1240
       ExtAddr <= "1111111110011011";
1241
       ExtWr <= '1';
1242
       Data2Ext <= "0000000000000000";
1243
       ExtEna <= EXT_ACT;
1244
       icwait(2);
1245
       ExtEna <= not EXT_ACT;
1246
       icwait(2);
1247
 
1248
       -- 19 bits warten (1 start + 16 data + 1 Stop = 18 + 1 zum Überprüfen)
1249
       icwait(19*BITCLK);
1250
 
1251
-- NOEVENT, transmit, polling, 16 2S 
1252
       reset <= not RES_ACT;
1253
       AccViol <= not ACCVIOL_ACT;
1254
       RxD <= '1';
1255
       Data2Ext <= (others => '0');
1256
       ExtEna <= not EXT_ACT;
1257
 
1258
       -- UBRS setzen
1259
       ExtAddr <= "1111111110011111";
1260
       ExtWr <= '1';
1261
       Data2Ext <= UBRS_CONST;
1262
       ExtEna <= EXT_ACT;
1263
       icwait(2);
1264
       ExtEna <= not EXT_ACT;
1265
       icwait(2);
1266
 
1267
       -- UARTCONF setzen: 16 2S, noTrCtrl
1268
       ExtAddr <= "1111111110011010";
1269
       ExtWr <= '1';
1270
       Data2Ext <= "0010111100000000";
1271
       ExtEna <= EXT_ACT;
1272
       icwait(2);
1273
       ExtEna <= not EXT_ACT;
1274
       icwait(2);
1275
 
1276
       -- MSGREG setzen
1277
       ExtAddr <= "1111111110011100";
1278
       ExtWr <= '1';
1279
       Data2Ext <= DATA_CONST16;
1280
       ExtEna <= EXT_ACT;
1281
       icwait(2);
1282
       ExtEna <= not EXT_ACT;
1283
       icwait(2);
1284
 
1285
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1286
       ExtAddr <= "1111111110011011";
1287
       ExtWr <= '1';
1288
       Data2Ext <= "0000000000011000";
1289
       ExtEna <= EXT_ACT;
1290
       icwait(2);
1291
       ExtEna <= not EXT_ACT;
1292
       icwait(2);
1293
 
1294
       -- UARTCMD setzen: noERRI, noEI, NOACTION, NOEVENT
1295
       ExtAddr <= "1111111110011011";
1296
       ExtWr <= '1';
1297
       Data2Ext <= "0000000000000000";
1298
       ExtEna <= EXT_ACT;
1299
       icwait(2);
1300
       ExtEna <= not EXT_ACT;
1301
       icwait(2);
1302
 
1303
       -- 20 bits warten (1 start + 16 data + 2 Stop = 19 + 1 zum Überprüfen)
1304
       icwait(20*BITCLK);
1305
 
1306
-- EV_TRCOMP, transmit, polling, 1 P 1S
1307
       reset <= not RES_ACT;
1308
       AccViol <= not ACCVIOL_ACT;
1309
       RxD <= '1';
1310
       Data2Ext <= (others => '0');
1311
       ExtEna <= not EXT_ACT;
1312
 
1313
       -- UBRS setzen
1314
       ExtAddr <= "1111111110011111";
1315
       ExtWr <= '1';
1316
       Data2Ext <= UBRS_CONST;
1317
       ExtEna <= EXT_ACT;
1318
       icwait(2);
1319
       ExtEna <= not EXT_ACT;
1320
       icwait(2);
1321
 
1322
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
1323
       ExtAddr <= "1111111110011010";
1324
       ExtWr <= '1';
1325
       Data2Ext <= "1000000000000000";
1326
       ExtEna <= EXT_ACT;
1327
       icwait(2);
1328
       ExtEna <= not EXT_ACT;
1329
       icwait(2);
1330
 
1331
       -- MSGREG setzen
1332
       ExtAddr <= "1111111110011100";
1333
       ExtWr <= '1';
1334
       Data2Ext <= DATA_CONST1;
1335
       ExtEna <= EXT_ACT;
1336
       icwait(2);
1337
       ExtEna <= not EXT_ACT;
1338
       icwait(2);
1339
 
1340
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1341
       ExtAddr <= "1111111110011011";
1342
       ExtWr <= '1';
1343
       Data2Ext <= "0000000000011000";
1344
       ExtEna <= EXT_ACT;
1345
       icwait(2);
1346
       ExtEna <= not EXT_ACT;
1347
       icwait(2);
1348
 
1349
       -- UARTCMD setzen: noERRI, noEI, NOACTION, TRCOMP
1350
       ExtAddr <= "1111111110011011";
1351
       ExtWr <= '1';
1352
       Data2Ext <= "0000000000000110";
1353
       ExtEna <= EXT_ACT;
1354
       icwait(2);
1355
       ExtEna <= not EXT_ACT;
1356
       icwait(2);
1357
 
1358
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
1359
       icwait(5*BITCLK);
1360
 
1361
       -- Status lesen
1362
       ExtAddr <= "1111111110011000";
1363
       ExtWr <= '0';
1364
       ExtEna <= EXT_ACT;
1365
       icwait(2);
1366
       ExtEna <= not EXT_ACT;
1367
       icwait(2);
1368
 
1369
       icwait(BITCLK/2);
1370
 
1371
-- EV_TRCOMP, transmit, interrupt, 1 P 1S
1372
       reset <= not RES_ACT;
1373
       AccViol <= not ACCVIOL_ACT;
1374
       RxD <= '1';
1375
       Data2Ext <= (others => '0');
1376
       ExtEna <= not EXT_ACT;
1377
 
1378
       -- UBRS setzen
1379
       ExtAddr <= "1111111110011111";
1380
       ExtWr <= '1';
1381
       Data2Ext <= UBRS_CONST;
1382
       ExtEna <= EXT_ACT;
1383
       icwait(2);
1384
       ExtEna <= not EXT_ACT;
1385
       icwait(2);
1386
 
1387
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
1388
       ExtAddr <= "1111111110011010";
1389
       ExtWr <= '1';
1390
       Data2Ext <= "1000000000000000";
1391
       ExtEna <= EXT_ACT;
1392
       icwait(2);
1393
       ExtEna <= not EXT_ACT;
1394
       icwait(2);
1395
 
1396
       -- MSGREG setzen
1397
       ExtAddr <= "1111111110011100";
1398
       ExtWr <= '1';
1399
       Data2Ext <= DATA_CONST1;
1400
       ExtEna <= EXT_ACT;
1401
       icwait(2);
1402
       ExtEna <= not EXT_ACT;
1403
       icwait(2);
1404
 
1405
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1406
       ExtAddr <= "1111111110011011";
1407
       ExtWr <= '1';
1408
       Data2Ext <= "0000000000011000";
1409
       ExtEna <= EXT_ACT;
1410
       icwait(2);
1411
       ExtEna <= not EXT_ACT;
1412
       icwait(2);
1413
 
1414
       -- UARTCMD setzen: noERRI, EI, NOACTION, TRCOMP
1415
       ExtAddr <= "1111111110011011";
1416
       ExtWr <= '1';
1417
       Data2Ext <= "0000000001000110";
1418
       ExtEna <= EXT_ACT;
1419
       icwait(2);
1420
       ExtEna <= not EXT_ACT;
1421
       icwait(2);
1422
 
1423
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
1424
       icwait(5*BITCLK);
1425
 
1426
       -- Status lesen
1427
       ExtAddr <= "1111111110011000";
1428
       ExtWr <= '0';
1429
       ExtEna <= EXT_ACT;
1430
       icwait(2);
1431
       ExtEna <= not EXT_ACT;
1432
       icwait(2);
1433
 
1434
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, INTA
1435
       ExtAddr <= "1111111110011001";
1436
       ExtWr <= '1';
1437
       Data2Ext <= "0000000000000001";
1438
       ExtEna <= EXT_ACT;
1439
       icwait(2);
1440
       ExtEna <= not EXT_ACT;
1441
       icwait(2);
1442
 
1443
       -- Status lesen
1444
       ExtAddr <= "1111111110011000";
1445
       ExtWr <= '0';
1446
       ExtEna <= EXT_ACT;
1447
       icwait(2);
1448
       ExtEna <= not EXT_ACT;
1449
       icwait(2);
1450
 
1451
       icwait(BITCLK/2);
1452
 
1453
-- EV_TRCOMP -> start transmission, transmit, polling, 1 P 1S
1454
       reset <= not RES_ACT;
1455
       AccViol <= not ACCVIOL_ACT;
1456
       RxD <= '1';
1457
       Data2Ext <= (others => '0');
1458
       ExtEna <= not EXT_ACT;
1459
 
1460
       -- UBRS setzen
1461
       ExtAddr <= "1111111110011111";
1462
       ExtWr <= '1';
1463
       Data2Ext <= UBRS_CONST;
1464
       ExtEna <= EXT_ACT;
1465
       icwait(2);
1466
       ExtEna <= not EXT_ACT;
1467
       icwait(2);
1468
 
1469
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
1470
       ExtAddr <= "1111111110011010";
1471
       ExtWr <= '1';
1472
       Data2Ext <= "1000000000000000";
1473
       ExtEna <= EXT_ACT;
1474
       icwait(2);
1475
       ExtEna <= not EXT_ACT;
1476
       icwait(2);
1477
 
1478
       -- MSGREG setzen
1479
       ExtAddr <= "1111111110011100";
1480
       ExtWr <= '1';
1481
       Data2Ext <= DATA_CONST1;
1482
       ExtEna <= EXT_ACT;
1483
       icwait(2);
1484
       ExtEna <= not EXT_ACT;
1485
       icwait(2);
1486
 
1487
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
1488
       ExtAddr <= "1111111110011011";
1489
       ExtWr <= '1';
1490
       Data2Ext <= "0000000000011000";
1491
       ExtEna <= EXT_ACT;
1492
       icwait(2);
1493
       ExtEna <= not EXT_ACT;
1494
       icwait(20);
1495
 
1496
       -- UARTCMD setzen: noERRI, noEI, STRANS, TRCOMP
1497
       ExtAddr <= "1111111110011011";
1498
       ExtWr <= '1';
1499
       Data2Ext <= "0000000000011110";
1500
       ExtEna <= EXT_ACT;
1501
       icwait(2);
1502
       ExtEna <= not EXT_ACT;
1503
       icwait(2);
1504
 
1505
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
1506
       icwait(5*BITCLK);
1507
 
1508
       -- UARTCMD setzen: noERRI, noEI, NOACTION, TRCOMP
1509
       ExtAddr <= "1111111110011011";
1510
       ExtWr <= '1';
1511
       Data2Ext <= "0000000000000110";
1512
       ExtEna <= EXT_ACT;
1513
       icwait(2);
1514
       ExtEna <= not EXT_ACT;
1515
       icwait(2);
1516
 
1517
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
1518
       icwait(5*BITCLK);
1519
 
1520
       -- Status lesen
1521
       ExtAddr <= "1111111110011000";
1522
       ExtWr <= '0';
1523
       ExtEna <= EXT_ACT;
1524
       icwait(2);
1525
       ExtEna <= not EXT_ACT;
1526
       icwait(2);
1527
 
1528
       icwait(BITCLK/2);
1529
 
1530
-------------------------------------------------------------------------------
1531
--Receive:
1532
-- NOEVENT, receive, polling, 8 P 1S (Even Parity)
1533
       reset <= not RES_ACT;
1534
       AccViol <= not ACCVIOL_ACT;
1535
       RxD <= '1';
1536
       Data2Ext <= (others => '0');
1537
       ExtEna <= not EXT_ACT;
1538
 
1539
       -- UBRS setzen
1540
       ExtAddr <= "1111111110011111";
1541
       ExtWr <= '1';
1542
       Data2Ext <= UBRS_CONST;
1543
       ExtEna <= EXT_ACT;
1544
       icwait(2);
1545
       ExtEna <= not EXT_ACT;
1546
       icwait(2);
1547
 
1548
       -- UARTCONF setzen: 8 P Even 1S, TrCtrl
1549
       ExtAddr <= "1111111110011010";
1550
       ExtWr <= '1';
1551
       Data2Ext <= "1001011100000000";
1552
       ExtEna <= EXT_ACT;
1553
       icwait(2);
1554
       ExtEna <= not EXT_ACT;
1555
       icwait(2);
1556
 
1557
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
1558
       ExtAddr <= "1111111110011011";
1559
       ExtWr <= '1';
1560
       Data2Ext <= "0000000000100000";
1561
       ExtEna <= EXT_ACT;
1562
       icwait(2);
1563
       ExtEna <= not EXT_ACT;
1564
       icwait(2);
1565
 
1566
       RxD <= '0';                      -- Startbit
1567
       icwait(BITCLK);
1568
       RxD <= '1';                      -- Message (1)
1569
       icwait(BITCLK);
1570
       RxD <= '0';
1571
       icwait(BITCLK);
1572
       RxD <= '1';
1573
 
1574
       -- Status lesen
1575
       ExtAddr <= "1111111110011000";
1576
       ExtWr <= '0';
1577
       ExtEna <= EXT_ACT;
1578
       icwait(BITCLK);
1579
       ExtEna <= not EXT_ACT;
1580
 
1581
       RxD <= '0';
1582
       icwait(BITCLK);
1583
       RxD <= '1';
1584
       icwait(BITCLK);
1585
       RxD <= '0';
1586
       icwait(BITCLK);
1587
       RxD <= '1';
1588
       icwait(BITCLK);
1589
       RxD <= '0';                      -- Message (8)
1590
       icwait(BITCLK);
1591
       RxD <= '0';                      -- Paritybit (Even)
1592
       icwait(BITCLK);
1593
       RxD <= '1';                      -- Stopbit
1594
 
1595
       icwait(BITCLK);
1596
 
1597
       -- Status lesen
1598
       ExtAddr <= "1111111110011000";
1599
       ExtWr <= '0';
1600
       ExtEna <= EXT_ACT;
1601
       icwait(2);
1602
       ExtEna <= not EXT_ACT;
1603
       icwait(2);
1604
 
1605
       -- MSGREG lesen
1606
       ExtAddr <= "1111111110011100";
1607
       ExtWr <= '0';
1608
       ExtEna <= EXT_ACT;
1609
       icwait(2);
1610
       ExtEna <= not EXT_ACT;
1611
       icwait(2);
1612
 
1613
       -- Status lesen
1614
       ExtAddr <= "1111111110011000";
1615
       ExtWr <= '0';
1616
       ExtEna <= EXT_ACT;
1617
       icwait(2);
1618
       ExtEna <= not EXT_ACT;
1619
       icwait(2);
1620
 
1621
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
1622
       ExtAddr <= "1111111110011011";
1623
       ExtWr <= '1';
1624
       Data2Ext <= "0000000000101000";
1625
       ExtEna <= EXT_ACT;
1626
       icwait(2);
1627
       ExtEna <= not EXT_ACT;
1628
       icwait(2);
1629
 
1630
       RxD <= '1';
1631
       icwait(BITCLK/2);
1632
 
1633
-- NOEVENT, receive, polling, 8 P 1S (Odd Parity)
1634
       reset <= not RES_ACT;
1635
       AccViol <= not ACCVIOL_ACT;
1636
       RxD <= '1';
1637
       Data2Ext <= (others => '0');
1638
       ExtEna <= not EXT_ACT;
1639
 
1640
       -- UBRS setzen
1641
       ExtAddr <= "1111111110011111";
1642
       ExtWr <= '1';
1643
       Data2Ext <= UBRS_CONST;
1644
       ExtEna <= EXT_ACT;
1645
       icwait(2);
1646
       ExtEna <= not EXT_ACT;
1647
       icwait(2);
1648
 
1649
       -- UARTCONF setzen: 8 P Odd 1S, TrCtrl
1650
       ExtAddr <= "1111111110011010";
1651
       ExtWr <= '1';
1652
       Data2Ext <= "1101011100000000";
1653
       ExtEna <= EXT_ACT;
1654
       icwait(2);
1655
       ExtEna <= not EXT_ACT;
1656
       icwait(2);
1657
 
1658
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
1659
       ExtAddr <= "1111111110011011";
1660
       ExtWr <= '1';
1661
       Data2Ext <= "0000000000100000";
1662
       ExtEna <= EXT_ACT;
1663
       icwait(2);
1664
       ExtEna <= not EXT_ACT;
1665
       icwait(2);
1666
 
1667
       RxD <= '0';                      -- Startbit
1668
       icwait(BITCLK);
1669
       RxD <= '1';                      -- Message (1)
1670
       icwait(BITCLK);
1671
       RxD <= '0';
1672
       icwait(BITCLK);
1673
       RxD <= '1';
1674
       icwait(BITCLK);
1675
       RxD <= '0';
1676
       icwait(BITCLK);
1677
       RxD <= '1';
1678
       icwait(BITCLK);
1679
       RxD <= '0';
1680
       icwait(BITCLK);
1681
       RxD <= '1';
1682
       icwait(BITCLK);
1683
       RxD <= '0';                      -- Message (8)
1684
       icwait(BITCLK);
1685
       RxD <= '1';                      -- Paritybit (Odd)
1686
       icwait(BITCLK);
1687
       RxD <= '1';                      -- Stopbit
1688
 
1689
       icwait(BITCLK);
1690
 
1691
       -- Status lesen
1692
       ExtAddr <= "1111111110011000";
1693
       ExtWr <= '0';
1694
       ExtEna <= EXT_ACT;
1695
       icwait(2);
1696
       ExtEna <= not EXT_ACT;
1697
       icwait(2);
1698
 
1699
       -- MSGREG lesen
1700
       ExtAddr <= "1111111110011100";
1701
       ExtWr <= '0';
1702
       ExtEna <= EXT_ACT;
1703
       icwait(2);
1704
       ExtEna <= not EXT_ACT;
1705
       icwait(2);
1706
 
1707
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
1708
       ExtAddr <= "1111111110011011";
1709
       ExtWr <= '1';
1710
       Data2Ext <= "0000000000101000";
1711
       ExtEna <= EXT_ACT;
1712
       icwait(2);
1713
       ExtEna <= not EXT_ACT;
1714
       icwait(2);
1715
 
1716
       RxD <= '1';
1717
       icwait(BITCLK/2);
1718
 
1719
-- NOEVENT, receive, polling, 8 P 2S (alle weiteren P: Even Parity)
1720
       reset <= not RES_ACT;
1721
       AccViol <= not ACCVIOL_ACT;
1722
       RxD <= '1';
1723
       Data2Ext <= (others => '0');
1724
       ExtEna <= not EXT_ACT;
1725
 
1726
       -- UBRS setzen
1727
       ExtAddr <= "1111111110011111";
1728
       ExtWr <= '1';
1729
       Data2Ext <= UBRS_CONST;
1730
       ExtEna <= EXT_ACT;
1731
       icwait(2);
1732
       ExtEna <= not EXT_ACT;
1733
       icwait(2);
1734
 
1735
       -- UARTCONF setzen: 8 P Even 2S, TrCtrl
1736
       ExtAddr <= "1111111110011010";
1737
       ExtWr <= '1';
1738
       Data2Ext <= "1011011100000000";
1739
       ExtEna <= EXT_ACT;
1740
       icwait(2);
1741
       ExtEna <= not EXT_ACT;
1742
       icwait(2);
1743
 
1744
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
1745
       ExtAddr <= "1111111110011011";
1746
       ExtWr <= '1';
1747
       Data2Ext <= "0000000000100000";
1748
       ExtEna <= EXT_ACT;
1749
       icwait(2);
1750
       ExtEna <= not EXT_ACT;
1751
       icwait(2);
1752
 
1753
       RxD <= '0';                      -- Startbit
1754
       icwait(BITCLK);
1755
       RxD <= '1';                      -- Message (1)
1756
       icwait(BITCLK);
1757
       RxD <= '0';
1758
       icwait(BITCLK);
1759
       RxD <= '1';
1760
       icwait(BITCLK);
1761
       RxD <= '0';
1762
       icwait(BITCLK);
1763
       RxD <= '1';
1764
       icwait(BITCLK);
1765
       RxD <= '0';
1766
       icwait(BITCLK);
1767
       RxD <= '1';
1768
       icwait(BITCLK);
1769
       RxD <= '0';                      -- Message (8)
1770
       icwait(BITCLK);
1771
       RxD <= '0';                      -- Paritybit (Even)
1772
       icwait(BITCLK);
1773
       RxD <= '1';                      -- 1. Stopbit
1774
       icwait(BITCLK);
1775
       RxD <= '1';                      -- 2. Stopbit
1776
 
1777
       icwait(BITCLK);
1778
 
1779
       -- Status lesen
1780
       ExtAddr <= "1111111110011000";
1781
       ExtWr <= '0';
1782
       ExtEna <= EXT_ACT;
1783
       icwait(2);
1784
       ExtEna <= not EXT_ACT;
1785
       icwait(2);
1786
 
1787
       -- MSGREG lesen
1788
       ExtAddr <= "1111111110011100";
1789
       ExtWr <= '0';
1790
       ExtEna <= EXT_ACT;
1791
       icwait(2);
1792
       ExtEna <= not EXT_ACT;
1793
       icwait(2);
1794
 
1795
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
1796
       ExtAddr <= "1111111110011011";
1797
       ExtWr <= '1';
1798
       Data2Ext <= "0000000000101000";
1799
       ExtEna <= EXT_ACT;
1800
       icwait(2);
1801
       ExtEna <= not EXT_ACT;
1802
       icwait(2);
1803
 
1804
       RxD <= '1';
1805
       icwait(BITCLK/2);
1806
 
1807
-- NOEVENT, receive, polling, 8 1S
1808
       reset <= not RES_ACT;
1809
       AccViol <= not ACCVIOL_ACT;
1810
       RxD <= '1';
1811
       Data2Ext <= (others => '0');
1812
       ExtEna <= not EXT_ACT;
1813
 
1814
       -- UBRS setzen
1815
       ExtAddr <= "1111111110011111";
1816
       ExtWr <= '1';
1817
       Data2Ext <= UBRS_CONST;
1818
       ExtEna <= EXT_ACT;
1819
       icwait(2);
1820
       ExtEna <= not EXT_ACT;
1821
       icwait(2);
1822
 
1823
       -- UARTCONF setzen: 8 1S, TrCtrl
1824
       ExtAddr <= "1111111110011010";
1825
       ExtWr <= '1';
1826
       Data2Ext <= "0001011100000000";
1827
       ExtEna <= EXT_ACT;
1828
       icwait(2);
1829
       ExtEna <= not EXT_ACT;
1830
       icwait(2);
1831
 
1832
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
1833
       ExtAddr <= "1111111110011011";
1834
       ExtWr <= '1';
1835
       Data2Ext <= "0000000000100000";
1836
       ExtEna <= EXT_ACT;
1837
       icwait(2);
1838
       ExtEna <= not EXT_ACT;
1839
       icwait(2);
1840
 
1841
       RxD <= '0';                      -- Startbit
1842
       icwait(BITCLK);
1843
       RxD <= '1';                      -- Message (1)
1844
       icwait(BITCLK);
1845
       RxD <= '0';
1846
       icwait(BITCLK);
1847
       RxD <= '1';
1848
       icwait(BITCLK);
1849
       RxD <= '0';
1850
       icwait(BITCLK);
1851
       RxD <= '1';
1852
       icwait(BITCLK);
1853
       RxD <= '0';
1854
       icwait(BITCLK);
1855
       RxD <= '1';
1856
       icwait(BITCLK);
1857
       RxD <= '0';                      -- Message (8)
1858
       icwait(BITCLK);
1859
       RxD <= '1';                      -- Stopbit
1860
 
1861
       icwait(BITCLK);
1862
 
1863
       -- Status lesen
1864
       ExtAddr <= "1111111110011000";
1865
       ExtWr <= '0';
1866
       ExtEna <= EXT_ACT;
1867
       icwait(2);
1868
       ExtEna <= not EXT_ACT;
1869
       icwait(2);
1870
 
1871
       -- MSGREG lesen
1872
       ExtAddr <= "1111111110011100";
1873
       ExtWr <= '0';
1874
       ExtEna <= EXT_ACT;
1875
       icwait(2);
1876
       ExtEna <= not EXT_ACT;
1877
       icwait(2);
1878
 
1879
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
1880
       ExtAddr <= "1111111110011011";
1881
       ExtWr <= '1';
1882
       Data2Ext <= "0000000000101000";
1883
       ExtEna <= EXT_ACT;
1884
       icwait(2);
1885
       ExtEna <= not EXT_ACT;
1886
       icwait(2);
1887
 
1888
       RxD <= '1';
1889
       icwait(BITCLK/2);
1890
 
1891
-- NOEVENT, receive, polling, 8 2S
1892
       reset <= not RES_ACT;
1893
       AccViol <= not ACCVIOL_ACT;
1894
       RxD <= '1';
1895
       Data2Ext <= (others => '0');
1896
       ExtEna <= not EXT_ACT;
1897
 
1898
       -- UBRS setzen
1899
       ExtAddr <= "1111111110011111";
1900
       ExtWr <= '1';
1901
       Data2Ext <= UBRS_CONST;
1902
       ExtEna <= EXT_ACT;
1903
       icwait(2);
1904
       ExtEna <= not EXT_ACT;
1905
       icwait(2);
1906
 
1907
       -- UARTCONF setzen: 8 2S, TrCtrl
1908
       ExtAddr <= "1111111110011010";
1909
       ExtWr <= '1';
1910
       Data2Ext <= "0011011100000000";
1911
       ExtEna <= EXT_ACT;
1912
       icwait(2);
1913
       ExtEna <= not EXT_ACT;
1914
       icwait(2);
1915
 
1916
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
1917
       ExtAddr <= "1111111110011011";
1918
       ExtWr <= '1';
1919
       Data2Ext <= "0000000000100000";
1920
       ExtEna <= EXT_ACT;
1921
       icwait(2);
1922
       ExtEna <= not EXT_ACT;
1923
       icwait(2);
1924
 
1925
       RxD <= '0';                      -- Startbit
1926
       icwait(BITCLK);
1927
       RxD <= '1';                      -- Message (1)
1928
       icwait(BITCLK);
1929
       RxD <= '0';
1930
       icwait(BITCLK);
1931
       RxD <= '1';
1932
       icwait(BITCLK);
1933
       RxD <= '0';
1934
       icwait(BITCLK);
1935
       RxD <= '1';
1936
       icwait(BITCLK);
1937
       RxD <= '0';
1938
       icwait(BITCLK);
1939
       RxD <= '1';
1940
       icwait(BITCLK);
1941
       RxD <= '0';                      -- Message (8)
1942
       icwait(BITCLK);
1943
       RxD <= '1';                      -- 1. Stopbit
1944
       icwait(BITCLK);
1945
       RxD <= '1';                      -- 2. Stopbit
1946
 
1947
       icwait(BITCLK);
1948
 
1949
       -- Status lesen
1950
       ExtAddr <= "1111111110011000";
1951
       ExtWr <= '0';
1952
       ExtEna <= EXT_ACT;
1953
       icwait(2);
1954
       ExtEna <= not EXT_ACT;
1955
       icwait(2);
1956
 
1957
       -- MSGREG lesen
1958
       ExtAddr <= "1111111110011100";
1959
       ExtWr <= '0';
1960
       ExtEna <= EXT_ACT;
1961
       icwait(2);
1962
       ExtEna <= not EXT_ACT;
1963
       icwait(2);
1964
 
1965
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
1966
       ExtAddr <= "1111111110011011";
1967
       ExtWr <= '1';
1968
       Data2Ext <= "0000000000101000";
1969
       ExtEna <= EXT_ACT;
1970
       icwait(2);
1971
       ExtEna <= not EXT_ACT;
1972
       icwait(2);
1973
 
1974
       RxD <= '1';
1975
       icwait(BITCLK/2);
1976
 
1977
-- NOEVENT, receive, polling, 1 P 1S
1978
       reset <= not RES_ACT;
1979
       AccViol <= not ACCVIOL_ACT;
1980
       RxD <= '1';
1981
       Data2Ext <= (others => '0');
1982
       ExtEna <= not EXT_ACT;
1983
 
1984
       -- UBRS setzen
1985
       ExtAddr <= "1111111110011111";
1986
       ExtWr <= '1';
1987
       Data2Ext <= UBRS_CONST;
1988
       ExtEna <= EXT_ACT;
1989
       icwait(2);
1990
       ExtEna <= not EXT_ACT;
1991
       icwait(2);
1992
 
1993
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
1994
       ExtAddr <= "1111111110011010";
1995
       ExtWr <= '1';
1996
       Data2Ext <= "1001000000000000";
1997
       ExtEna <= EXT_ACT;
1998
       icwait(2);
1999
       ExtEna <= not EXT_ACT;
2000
       icwait(2);
2001
 
2002
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2003
       ExtAddr <= "1111111110011011";
2004
       ExtWr <= '1';
2005
       Data2Ext <= "0000000000100000";
2006
       ExtEna <= EXT_ACT;
2007
       icwait(2);
2008
       ExtEna <= not EXT_ACT;
2009
       icwait(2);
2010
 
2011
       RxD <= '0';                      -- Startbit
2012
       icwait(BITCLK);
2013
       RxD <= '1';                      -- Message (1)
2014
       icwait(BITCLK);
2015
       RxD <= '1';                      -- Paritybit (Even)
2016
       icwait(BITCLK);
2017
       RxD <= '1';                      -- Stopbit
2018
 
2019
       icwait(BITCLK);
2020
 
2021
       -- Status lesen
2022
       ExtAddr <= "1111111110011000";
2023
       ExtWr <= '0';
2024
       ExtEna <= EXT_ACT;
2025
       icwait(2);
2026
       ExtEna <= not EXT_ACT;
2027
       icwait(2);
2028
 
2029
       -- MSGREG lesen
2030
       ExtAddr <= "1111111110011100";
2031
       ExtWr <= '0';
2032
       ExtEna <= EXT_ACT;
2033
       icwait(2);
2034
       ExtEna <= not EXT_ACT;
2035
       icwait(2);
2036
 
2037
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2038
       ExtAddr <= "1111111110011011";
2039
       ExtWr <= '1';
2040
       Data2Ext <= "0000000000101000";
2041
       ExtEna <= EXT_ACT;
2042
       icwait(2);
2043
       ExtEna <= not EXT_ACT;
2044
       icwait(2);
2045
 
2046
       RxD <= '1';
2047
       icwait(BITCLK/2);
2048
 
2049
-- NOEVENT, receive, polling, 1 P 2S
2050
       reset <= not RES_ACT;
2051
       AccViol <= not ACCVIOL_ACT;
2052
       RxD <= '1';
2053
       Data2Ext <= (others => '0');
2054
       ExtEna <= not EXT_ACT;
2055
 
2056
       -- UBRS setzen
2057
       ExtAddr <= "1111111110011111";
2058
       ExtWr <= '1';
2059
       Data2Ext <= UBRS_CONST;
2060
       ExtEna <= EXT_ACT;
2061
       icwait(2);
2062
       ExtEna <= not EXT_ACT;
2063
       icwait(2);
2064
 
2065
       -- UARTCONF setzen: 1 P Even 2S, TrCtrl
2066
       ExtAddr <= "1111111110011010";
2067
       ExtWr <= '1';
2068
       Data2Ext <= "1011000000000000";
2069
       ExtEna <= EXT_ACT;
2070
       icwait(2);
2071
       ExtEna <= not EXT_ACT;
2072
       icwait(2);
2073
 
2074
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2075
       ExtAddr <= "1111111110011011";
2076
       ExtWr <= '1';
2077
       Data2Ext <= "0000000000100000";
2078
       ExtEna <= EXT_ACT;
2079
       icwait(2);
2080
       ExtEna <= not EXT_ACT;
2081
       icwait(2);
2082
 
2083
       RxD <= '0';                      -- Startbit
2084
       icwait(BITCLK);
2085
       RxD <= '1';                      -- Message (1)
2086
       icwait(BITCLK);
2087
       RxD <= '1';                      -- Paritybit (Even)
2088
       icwait(BITCLK);
2089
       RxD <= '1';                      -- 1.Stopbit
2090
       icwait(BITCLK);
2091
       RxD <= '1';                      -- 2.Stopbit
2092
 
2093
       icwait(BITCLK);
2094
 
2095
       -- Status lesen
2096
       ExtAddr <= "1111111110011000";
2097
       ExtWr <= '0';
2098
       ExtEna <= EXT_ACT;
2099
       icwait(2);
2100
       ExtEna <= not EXT_ACT;
2101
       icwait(2);
2102
 
2103
       -- MSGREG lesen
2104
       ExtAddr <= "1111111110011100";
2105
       ExtWr <= '0';
2106
       ExtEna <= EXT_ACT;
2107
       icwait(2);
2108
       ExtEna <= not EXT_ACT;
2109
       icwait(2);
2110
 
2111
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2112
       ExtAddr <= "1111111110011011";
2113
       ExtWr <= '1';
2114
       Data2Ext <= "0000000000101000";
2115
       ExtEna <= EXT_ACT;
2116
       icwait(2);
2117
       ExtEna <= not EXT_ACT;
2118
       icwait(2);
2119
 
2120
       RxD <= '1';
2121
       icwait(BITCLK/2);
2122
 
2123
-- NOEVENT, receive, polling, 1 1S
2124
       reset <= not RES_ACT;
2125
       AccViol <= not ACCVIOL_ACT;
2126
       RxD <= '1';
2127
       Data2Ext <= (others => '0');
2128
       ExtEna <= not EXT_ACT;
2129
 
2130
       -- UBRS setzen
2131
       ExtAddr <= "1111111110011111";
2132
       ExtWr <= '1';
2133
       Data2Ext <= UBRS_CONST;
2134
       ExtEna <= EXT_ACT;
2135
       icwait(2);
2136
       ExtEna <= not EXT_ACT;
2137
       icwait(2);
2138
 
2139
       -- UARTCONF setzen: 1 1S, TrCtrl
2140
       ExtAddr <= "1111111110011010";
2141
       ExtWr <= '1';
2142
       Data2Ext <= "0001000000000000";
2143
       ExtEna <= EXT_ACT;
2144
       icwait(2);
2145
       ExtEna <= not EXT_ACT;
2146
       icwait(2);
2147
 
2148
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2149
       ExtAddr <= "1111111110011011";
2150
       ExtWr <= '1';
2151
       Data2Ext <= "0000000000100000";
2152
       ExtEna <= EXT_ACT;
2153
       icwait(2);
2154
       ExtEna <= not EXT_ACT;
2155
       icwait(2);
2156
 
2157
       RxD <= '0';                      -- Startbit
2158
       icwait(BITCLK);
2159
       RxD <= '1';                      -- Message (1)
2160
       icwait(BITCLK);
2161
       RxD <= '1';                      -- Stopbit
2162
 
2163
       icwait(BITCLK);
2164
 
2165
       -- Status lesen
2166
       ExtAddr <= "1111111110011000";
2167
       ExtWr <= '0';
2168
       ExtEna <= EXT_ACT;
2169
       icwait(2);
2170
       ExtEna <= not EXT_ACT;
2171
       icwait(2);
2172
 
2173
       -- MSGREG lesen
2174
       ExtAddr <= "1111111110011100";
2175
       ExtWr <= '0';
2176
       ExtEna <= EXT_ACT;
2177
       icwait(2);
2178
       ExtEna <= not EXT_ACT;
2179
       icwait(2);
2180
 
2181
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2182
       ExtAddr <= "1111111110011011";
2183
       ExtWr <= '1';
2184
       Data2Ext <= "0000000000101000";
2185
       ExtEna <= EXT_ACT;
2186
       icwait(2);
2187
       ExtEna <= not EXT_ACT;
2188
       icwait(2);
2189
 
2190
       RxD <= '1';
2191
       icwait(BITCLK/2);
2192
 
2193
-- NOEVENT, receive, polling, 1 2S
2194
       reset <= not RES_ACT;
2195
       AccViol <= not ACCVIOL_ACT;
2196
       RxD <= '1';
2197
       Data2Ext <= (others => '0');
2198
       ExtEna <= not EXT_ACT;
2199
 
2200
       -- UBRS setzen
2201
       ExtAddr <= "1111111110011111";
2202
       ExtWr <= '1';
2203
       Data2Ext <= UBRS_CONST;
2204
       ExtEna <= EXT_ACT;
2205
       icwait(2);
2206
       ExtEna <= not EXT_ACT;
2207
       icwait(2);
2208
 
2209
       -- UARTCONF setzen: 1 2S, TrCtrl
2210
       ExtAddr <= "1111111110011010";
2211
       ExtWr <= '1';
2212
       Data2Ext <= "0011000000000000";
2213
       ExtEna <= EXT_ACT;
2214
       icwait(2);
2215
       ExtEna <= not EXT_ACT;
2216
       icwait(2);
2217
 
2218
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2219
       ExtAddr <= "1111111110011011";
2220
       ExtWr <= '1';
2221
       Data2Ext <= "0000000000100000";
2222
       ExtEna <= EXT_ACT;
2223
       icwait(2);
2224
       ExtEna <= not EXT_ACT;
2225
       icwait(2);
2226
 
2227
       RxD <= '0';                      -- Startbit
2228
       icwait(BITCLK);
2229
       RxD <= '1';                      -- Message (1)
2230
       icwait(BITCLK);
2231
       RxD <= '1';                      -- 1.Stopbit
2232
       icwait(BITCLK);
2233
       RxD <= '1';                      -- 2.Stopbit
2234
 
2235
       icwait(BITCLK);
2236
 
2237
       -- Status lesen
2238
       ExtAddr <= "1111111110011000";
2239
       ExtWr <= '0';
2240
       ExtEna <= EXT_ACT;
2241
       icwait(2);
2242
       ExtEna <= not EXT_ACT;
2243
       icwait(2);
2244
 
2245
       -- MSGREG lesen
2246
       ExtAddr <= "1111111110011100";
2247
       ExtWr <= '0';
2248
       ExtEna <= EXT_ACT;
2249
       icwait(2);
2250
       ExtEna <= not EXT_ACT;
2251
       icwait(2);
2252
 
2253
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2254
       ExtAddr <= "1111111110011011";
2255
       ExtWr <= '1';
2256
       Data2Ext <= "0000000000101000";
2257
       ExtEna <= EXT_ACT;
2258
       icwait(2);
2259
       ExtEna <= not EXT_ACT;
2260
       icwait(2);
2261
 
2262
       RxD <= '1';
2263
       icwait(BITCLK/2);
2264
 
2265
-- NOEVENT, receive, polling, 16 P 1S
2266
       reset <= not RES_ACT;
2267
       AccViol <= not ACCVIOL_ACT;
2268
       RxD <= '1';
2269
       Data2Ext <= (others => '0');
2270
       ExtEna <= not EXT_ACT;
2271
 
2272
       -- UBRS setzen
2273
       ExtAddr <= "1111111110011111";
2274
       ExtWr <= '1';
2275
       Data2Ext <= UBRS_CONST;
2276
       ExtEna <= EXT_ACT;
2277
       icwait(2);
2278
       ExtEna <= not EXT_ACT;
2279
       icwait(2);
2280
 
2281
       -- UARTCONF setzen: 16 P Even 1S, TrCtrl
2282
       ExtAddr <= "1111111110011010";
2283
       ExtWr <= '1';
2284
       Data2Ext <= "1001111100000000";
2285
       ExtEna <= EXT_ACT;
2286
       icwait(2);
2287
       ExtEna <= not EXT_ACT;
2288
       icwait(2);
2289
 
2290
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2291
       ExtAddr <= "1111111110011011";
2292
       ExtWr <= '1';
2293
       Data2Ext <= "0000000000100000";
2294
       ExtEna <= EXT_ACT;
2295
       icwait(2);
2296
       ExtEna <= not EXT_ACT;
2297
       icwait(2);
2298
 
2299
       RxD <= '0';                      -- Startbit
2300
       icwait(BITCLK);
2301
       RxD <= '1';                      -- Message (1)
2302
       icwait(BITCLK);
2303
       RxD <= '0';
2304
       icwait(BITCLK);
2305
       RxD <= '1';
2306
       icwait(BITCLK);
2307
       RxD <= '0';
2308
       icwait(BITCLK);
2309
       RxD <= '1';
2310
       icwait(BITCLK);
2311
       RxD <= '0';
2312
       icwait(BITCLK);
2313
       RxD <= '1';
2314
       icwait(BITCLK);
2315
       RxD <= '0';                      -- Message (8)
2316
       icwait(BITCLK);
2317
       RxD <= '1';                      -- Message (9)
2318
       icwait(BITCLK);
2319
       RxD <= '0';
2320
       icwait(BITCLK);
2321
       RxD <= '1';
2322
       icwait(BITCLK);
2323
       RxD <= '0';
2324
       icwait(BITCLK);
2325
       RxD <= '1';
2326
       icwait(BITCLK);
2327
       RxD <= '0';
2328
       icwait(BITCLK);
2329
       RxD <= '1';
2330
       icwait(BITCLK);
2331
       RxD <= '0';                      -- Message (16)
2332
       icwait(BITCLK);
2333
       RxD <= '0';                      -- Paritybit (Even)
2334
       icwait(BITCLK);
2335
       RxD <= '1';                      -- Stopbit
2336
 
2337
       icwait(BITCLK);
2338
 
2339
       -- Status lesen
2340
       ExtAddr <= "1111111110011000";
2341
       ExtWr <= '0';
2342
       ExtEna <= EXT_ACT;
2343
       icwait(2);
2344
       ExtEna <= not EXT_ACT;
2345
       icwait(2);
2346
 
2347
       -- MSGREG lesen
2348
       ExtAddr <= "1111111110011100";
2349
       ExtWr <= '0';
2350
       ExtEna <= EXT_ACT;
2351
       icwait(2);
2352
       ExtEna <= not EXT_ACT;
2353
       icwait(2);
2354
 
2355
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2356
       ExtAddr <= "1111111110011011";
2357
       ExtWr <= '1';
2358
       Data2Ext <= "0000000000101000";
2359
       ExtEna <= EXT_ACT;
2360
       icwait(2);
2361
       ExtEna <= not EXT_ACT;
2362
       icwait(2);
2363
 
2364
       RxD <= '1';
2365
       icwait(BITCLK/2);
2366
 
2367
-- NOEVENT, receive, polling, 16 P 2S
2368
       reset <= not RES_ACT;
2369
       AccViol <= not ACCVIOL_ACT;
2370
       RxD <= '1';
2371
       Data2Ext <= (others => '0');
2372
       ExtEna <= not EXT_ACT;
2373
 
2374
       -- UBRS setzen
2375
       ExtAddr <= "1111111110011111";
2376
       ExtWr <= '1';
2377
       Data2Ext <= UBRS_CONST;
2378
       ExtEna <= EXT_ACT;
2379
       icwait(2);
2380
       ExtEna <= not EXT_ACT;
2381
       icwait(2);
2382
 
2383
       -- UARTCONF setzen: 16 P Even 2S, TrCtrl
2384
       ExtAddr <= "1111111110011010";
2385
       ExtWr <= '1';
2386
       Data2Ext <= "1011111100000000";
2387
       ExtEna <= EXT_ACT;
2388
       icwait(2);
2389
       ExtEna <= not EXT_ACT;
2390
       icwait(2);
2391
 
2392
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2393
       ExtAddr <= "1111111110011011";
2394
       ExtWr <= '1';
2395
       Data2Ext <= "0000000000100000";
2396
       ExtEna <= EXT_ACT;
2397
       icwait(2);
2398
       ExtEna <= not EXT_ACT;
2399
       icwait(2);
2400
 
2401
       RxD <= '0';                      -- Startbit
2402
       icwait(BITCLK);
2403
       RxD <= '1';                      -- Message (1)
2404
       icwait(BITCLK);
2405
       RxD <= '0';
2406
       icwait(BITCLK);
2407
       RxD <= '1';
2408
       icwait(BITCLK);
2409
       RxD <= '0';
2410
       icwait(BITCLK);
2411
       RxD <= '1';
2412
       icwait(BITCLK);
2413
       RxD <= '0';
2414
       icwait(BITCLK);
2415
       RxD <= '1';
2416
       icwait(BITCLK);
2417
       RxD <= '0';                      -- Message (8)
2418
       icwait(BITCLK);
2419
       RxD <= '1';                      -- Message (9)
2420
       icwait(BITCLK);
2421
       RxD <= '0';
2422
       icwait(BITCLK);
2423
       RxD <= '1';
2424
       icwait(BITCLK);
2425
       RxD <= '0';
2426
       icwait(BITCLK);
2427
       RxD <= '1';
2428
       icwait(BITCLK);
2429
       RxD <= '0';
2430
       icwait(BITCLK);
2431
       RxD <= '1';
2432
       icwait(BITCLK);
2433
       RxD <= '0';                      -- Message (16)
2434
       icwait(BITCLK);
2435
       RxD <= '0';                      -- Paritybit (Even)
2436
       icwait(BITCLK);
2437
       RxD <= '1';                      -- 1.Stopbit
2438
       icwait(BITCLK);
2439
       RxD <= '1';                      -- 2.Stopbit
2440
 
2441
       icwait(BITCLK);
2442
 
2443
       -- Status lesen
2444
       ExtAddr <= "1111111110011000";
2445
       ExtWr <= '0';
2446
       ExtEna <= EXT_ACT;
2447
       icwait(2);
2448
       ExtEna <= not EXT_ACT;
2449
       icwait(2);
2450
 
2451
       -- MSGREG lesen
2452
       ExtAddr <= "1111111110011100";
2453
       ExtWr <= '0';
2454
       ExtEna <= EXT_ACT;
2455
       icwait(2);
2456
       ExtEna <= not EXT_ACT;
2457
       icwait(2);
2458
 
2459
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2460
       ExtAddr <= "1111111110011011";
2461
       ExtWr <= '1';
2462
       Data2Ext <= "0000000000101000";
2463
       ExtEna <= EXT_ACT;
2464
       icwait(2);
2465
       ExtEna <= not EXT_ACT;
2466
       icwait(2);
2467
 
2468
       RxD <= '1';
2469
       icwait(BITCLK/2);
2470
 
2471
-- NOEVENT, receive, polling, 16 1S
2472
       reset <= not RES_ACT;
2473
       AccViol <= not ACCVIOL_ACT;
2474
       RxD <= '1';
2475
       Data2Ext <= (others => '0');
2476
       ExtEna <= not EXT_ACT;
2477
 
2478
       -- UBRS setzen
2479
       ExtAddr <= "1111111110011111";
2480
       ExtWr <= '1';
2481
       Data2Ext <= UBRS_CONST;
2482
       ExtEna <= EXT_ACT;
2483
       icwait(2);
2484
       ExtEna <= not EXT_ACT;
2485
       icwait(2);
2486
 
2487
       -- UARTCONF setzen: 16 1S, TrCtrl
2488
       ExtAddr <= "1111111110011010";
2489
       ExtWr <= '1';
2490
       Data2Ext <= "0001111100000000";
2491
       ExtEna <= EXT_ACT;
2492
       icwait(2);
2493
       ExtEna <= not EXT_ACT;
2494
       icwait(2);
2495
 
2496
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2497
       ExtAddr <= "1111111110011011";
2498
       ExtWr <= '1';
2499
       Data2Ext <= "0000000000100000";
2500
       ExtEna <= EXT_ACT;
2501
       icwait(2);
2502
       ExtEna <= not EXT_ACT;
2503
       icwait(2);
2504
 
2505
       RxD <= '0';                      -- Startbit
2506
       icwait(BITCLK);
2507
       RxD <= '1';                      -- Message (1)
2508
       icwait(BITCLK);
2509
       RxD <= '0';
2510
       icwait(BITCLK);
2511
       RxD <= '1';
2512
       icwait(BITCLK);
2513
       RxD <= '0';
2514
       icwait(BITCLK);
2515
       RxD <= '1';
2516
       icwait(BITCLK);
2517
       RxD <= '0';
2518
       icwait(BITCLK);
2519
       RxD <= '1';
2520
       icwait(BITCLK);
2521
       RxD <= '0';                      -- Message (8)
2522
       icwait(BITCLK);
2523
       RxD <= '1';                      -- Message (9)
2524
       icwait(BITCLK);
2525
       RxD <= '0';
2526
       icwait(BITCLK);
2527
       RxD <= '1';
2528
       icwait(BITCLK);
2529
       RxD <= '0';
2530
       icwait(BITCLK);
2531
       RxD <= '1';
2532
       icwait(BITCLK);
2533
       RxD <= '0';
2534
       icwait(BITCLK);
2535
       RxD <= '1';
2536
       icwait(BITCLK);
2537
       RxD <= '0';                      -- Message (16)
2538
       icwait(BITCLK);
2539
       RxD <= '1';                      -- Stopbit
2540
 
2541
       icwait(BITCLK);
2542
 
2543
       -- Status lesen
2544
       ExtAddr <= "1111111110011000";
2545
       ExtWr <= '0';
2546
       ExtEna <= EXT_ACT;
2547
       icwait(2);
2548
       ExtEna <= not EXT_ACT;
2549
       icwait(2);
2550
 
2551
       -- MSGREG lesen
2552
       ExtAddr <= "1111111110011100";
2553
       ExtWr <= '0';
2554
       ExtEna <= EXT_ACT;
2555
       icwait(2);
2556
       ExtEna <= not EXT_ACT;
2557
       icwait(2);
2558
 
2559
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2560
       ExtAddr <= "1111111110011011";
2561
       ExtWr <= '1';
2562
       Data2Ext <= "0000000000101000";
2563
       ExtEna <= EXT_ACT;
2564
       icwait(2);
2565
       ExtEna <= not EXT_ACT;
2566
       icwait(2);
2567
 
2568
       RxD <= '1';
2569
       icwait(BITCLK/2);
2570
 
2571
-- NOEVENT, receive, polling, 16 2S
2572
       reset <= not RES_ACT;
2573
       AccViol <= not ACCVIOL_ACT;
2574
       RxD <= '1';
2575
       Data2Ext <= (others => '0');
2576
       ExtEna <= not EXT_ACT;
2577
 
2578
       -- UBRS setzen
2579
       ExtAddr <= "1111111110011111";
2580
       ExtWr <= '1';
2581
       Data2Ext <= UBRS_CONST;
2582
       ExtEna <= EXT_ACT;
2583
       icwait(2);
2584
       ExtEna <= not EXT_ACT;
2585
       icwait(2);
2586
 
2587
       -- UARTCONF setzen: 16 2S, TrCtrl
2588
       ExtAddr <= "1111111110011010";
2589
       ExtWr <= '1';
2590
       Data2Ext <= "0011111100000000";
2591
       ExtEna <= EXT_ACT;
2592
       icwait(2);
2593
       ExtEna <= not EXT_ACT;
2594
       icwait(2);
2595
 
2596
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2597
       ExtAddr <= "1111111110011011";
2598
       ExtWr <= '1';
2599
       Data2Ext <= "0000000000100000";
2600
       ExtEna <= EXT_ACT;
2601
       icwait(2);
2602
       ExtEna <= not EXT_ACT;
2603
       icwait(2);
2604
 
2605
       RxD <= '0';                      -- Startbit
2606
       icwait(BITCLK);
2607
       RxD <= '1';                      -- Message (1)
2608
       icwait(BITCLK);
2609
       RxD <= '0';
2610
       icwait(BITCLK);
2611
       RxD <= '1';
2612
       icwait(BITCLK);
2613
       RxD <= '0';
2614
       icwait(BITCLK);
2615
       RxD <= '1';
2616
       icwait(BITCLK);
2617
       RxD <= '0';
2618
       icwait(BITCLK);
2619
       RxD <= '1';
2620
       icwait(BITCLK);
2621
       RxD <= '0';                      -- Message (8)
2622
       icwait(BITCLK);
2623
       RxD <= '1';                      -- Message (9)
2624
       icwait(BITCLK);
2625
       RxD <= '0';
2626
       icwait(BITCLK);
2627
       RxD <= '1';
2628
       icwait(BITCLK);
2629
       RxD <= '0';
2630
       icwait(BITCLK);
2631
       RxD <= '1';
2632
       icwait(BITCLK);
2633
       RxD <= '0';
2634
       icwait(BITCLK);
2635
       RxD <= '1';
2636
       icwait(BITCLK);
2637
       RxD <= '0';                      -- Message (16)
2638
       icwait(BITCLK);
2639
       RxD <= '1';                      -- 1.Stopbit
2640
       icwait(BITCLK);
2641
       RxD <= '1';                      -- 2.Stopbit
2642
 
2643
       icwait(BITCLK);
2644
 
2645
       -- Status lesen
2646
       ExtAddr <= "1111111110011000";
2647
       ExtWr <= '0';
2648
       ExtEna <= EXT_ACT;
2649
       icwait(2);
2650
       ExtEna <= not EXT_ACT;
2651
       icwait(2);
2652
 
2653
       -- MSGREG lesen
2654
       ExtAddr <= "1111111110011100";
2655
       ExtWr <= '0';
2656
       ExtEna <= EXT_ACT;
2657
       icwait(2);
2658
       ExtEna <= not EXT_ACT;
2659
       icwait(2);
2660
 
2661
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2662
       ExtAddr <= "1111111110011011";
2663
       ExtWr <= '1';
2664
       Data2Ext <= "0000000000101000";
2665
       ExtEna <= EXT_ACT;
2666
       icwait(2);
2667
       ExtEna <= not EXT_ACT;
2668
       icwait(2);
2669
 
2670
       RxD <= '1';
2671
       icwait(BITCLK/2);
2672
 
2673
-- NOEVENT, receive, polling, 1 P 1S, Parity Error + Frame Error, noTrCtrl
2674
       reset <= not RES_ACT;
2675
       AccViol <= not ACCVIOL_ACT;
2676
       RxD <= '1';
2677
       Data2Ext <= (others => '0');
2678
       ExtEna <= not EXT_ACT;
2679
 
2680
       -- UBRS setzen
2681
       ExtAddr <= "1111111110011111";
2682
       ExtWr <= '1';
2683
       Data2Ext <= UBRS_CONST;
2684
       ExtEna <= EXT_ACT;
2685
       icwait(2);
2686
       ExtEna <= not EXT_ACT;
2687
       icwait(2);
2688
 
2689
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
2690
       ExtAddr <= "1111111110011010";
2691
       ExtWr <= '1';
2692
       Data2Ext <= "1000000000000000";
2693
       ExtEna <= EXT_ACT;
2694
       icwait(2);
2695
       ExtEna <= not EXT_ACT;
2696
       icwait(2);
2697
 
2698
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2699
       ExtAddr <= "1111111110011011";
2700
       ExtWr <= '1';
2701
       Data2Ext <= "0000000000100000";
2702
       ExtEna <= EXT_ACT;
2703
       icwait(2);
2704
       ExtEna <= not EXT_ACT;
2705
       icwait(2);
2706
 
2707
       RxD <= '0';                      -- Startbit
2708
       icwait(BITCLK);
2709
       RxD <= '1';                      -- Message (1)
2710
       icwait(BITCLK);
2711
       RxD <= '0';                      -- wrong Paritybit (Even)
2712
       icwait(BITCLK);
2713
       RxD <= '0';                      -- wrong Stopbit
2714
 
2715
       icwait(BITCLK);
2716
 
2717
       -- Status lesen
2718
       ExtAddr <= "1111111110011000";
2719
       ExtWr <= '0';
2720
       ExtEna <= EXT_ACT;
2721
       icwait(2);
2722
       ExtEna <= not EXT_ACT;
2723
       icwait(2);
2724
 
2725
       -- MSGREG lesen
2726
       ExtAddr <= "1111111110011100";
2727
       ExtWr <= '0';
2728
       ExtEna <= EXT_ACT;
2729
       icwait(2);
2730
       ExtEna <= not EXT_ACT;
2731
       icwait(2);
2732
 
2733
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2734
       ExtAddr <= "1111111110011011";
2735
       ExtWr <= '1';
2736
       Data2Ext <= "0000000000101000";
2737
       ExtEna <= EXT_ACT;
2738
       icwait(2);
2739
       ExtEna <= not EXT_ACT;
2740
       icwait(2);
2741
 
2742
       RxD <= '1';
2743
       icwait(BITCLK/2);
2744
 
2745
-- NOEVENT, receive, polling, 1 P 1S, Parity Error
2746
       reset <= not RES_ACT;
2747
       AccViol <= not ACCVIOL_ACT;
2748
       RxD <= '1';
2749
       Data2Ext <= (others => '0');
2750
       ExtEna <= not EXT_ACT;
2751
 
2752
       -- UBRS setzen
2753
       ExtAddr <= "1111111110011111";
2754
       ExtWr <= '1';
2755
       Data2Ext <= UBRS_CONST;
2756
       ExtEna <= EXT_ACT;
2757
       icwait(2);
2758
       ExtEna <= not EXT_ACT;
2759
       icwait(2);
2760
 
2761
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
2762
       ExtAddr <= "1111111110011010";
2763
       ExtWr <= '1';
2764
       Data2Ext <= "1001000000000000";
2765
       ExtEna <= EXT_ACT;
2766
       icwait(2);
2767
       ExtEna <= not EXT_ACT;
2768
       icwait(2);
2769
 
2770
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2771
       ExtAddr <= "1111111110011011";
2772
       ExtWr <= '1';
2773
       Data2Ext <= "0000000000100000";
2774
       ExtEna <= EXT_ACT;
2775
       icwait(2);
2776
       ExtEna <= not EXT_ACT;
2777
       icwait(2);
2778
 
2779
       RxD <= '0';                      -- Startbit
2780
       icwait(BITCLK);
2781
       RxD <= '1';                      -- Message (1)
2782
       icwait(BITCLK);
2783
       RxD <= '0';                      -- wrong Paritybit (Even)
2784
       icwait(BITCLK);
2785
       RxD <= '1';                      -- Stopbit
2786
 
2787
       icwait(BITCLK);
2788
 
2789
       -- Status lesen
2790
       ExtAddr <= "1111111110011000";
2791
       ExtWr <= '0';
2792
       ExtEna <= EXT_ACT;
2793
       icwait(2);
2794
       ExtEna <= not EXT_ACT;
2795
       icwait(2);
2796
 
2797
       -- MSGREG lesen
2798
       ExtAddr <= "1111111110011100";
2799
       ExtWr <= '0';
2800
       ExtEna <= EXT_ACT;
2801
       icwait(2);
2802
       ExtEna <= not EXT_ACT;
2803
       icwait(2);
2804
 
2805
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2806
       ExtAddr <= "1111111110011011";
2807
       ExtWr <= '1';
2808
       Data2Ext <= "0000000000101000";
2809
       ExtEna <= EXT_ACT;
2810
       icwait(2);
2811
       ExtEna <= not EXT_ACT;
2812
       icwait(2);
2813
 
2814
       RxD <= '1';
2815
       icwait(BITCLK/2);
2816
 
2817
-- NOEVENT, receive, polling, 1 P 1S, Frame Error
2818
       reset <= not RES_ACT;
2819
       AccViol <= not ACCVIOL_ACT;
2820
       RxD <= '1';
2821
       Data2Ext <= (others => '0');
2822
       ExtEna <= not EXT_ACT;
2823
 
2824
       -- UBRS setzen
2825
       ExtAddr <= "1111111110011111";
2826
       ExtWr <= '1';
2827
       Data2Ext <= UBRS_CONST;
2828
       ExtEna <= EXT_ACT;
2829
       icwait(2);
2830
       ExtEna <= not EXT_ACT;
2831
       icwait(2);
2832
 
2833
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
2834
       ExtAddr <= "1111111110011010";
2835
       ExtWr <= '1';
2836
       Data2Ext <= "1001000000000000";
2837
       ExtEna <= EXT_ACT;
2838
       icwait(2);
2839
       ExtEna <= not EXT_ACT;
2840
       icwait(2);
2841
 
2842
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
2843
       ExtAddr <= "1111111110011011";
2844
       ExtWr <= '1';
2845
       Data2Ext <= "0000000000100000";
2846
       ExtEna <= EXT_ACT;
2847
       icwait(2);
2848
       ExtEna <= not EXT_ACT;
2849
       icwait(2);
2850
 
2851
       RxD <= '0';                      -- Startbit
2852
       icwait(BITCLK);
2853
       RxD <= '1';                      -- Message (1)
2854
       icwait(BITCLK);
2855
       RxD <= '1';                      -- Paritybit (Even)
2856
       icwait(BITCLK);
2857
       RxD <= '0';                      -- wrong Stopbit
2858
 
2859
       icwait(BITCLK);
2860
 
2861
       -- Status lesen
2862
       ExtAddr <= "1111111110011000";
2863
       ExtWr <= '0';
2864
       ExtEna <= EXT_ACT;
2865
       icwait(2);
2866
       ExtEna <= not EXT_ACT;
2867
       icwait(2);
2868
 
2869
       -- MSGREG lesen
2870
       ExtAddr <= "1111111110011100";
2871
       ExtWr <= '0';
2872
       ExtEna <= EXT_ACT;
2873
       icwait(2);
2874
       ExtEna <= not EXT_ACT;
2875
       icwait(2);
2876
 
2877
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2878
       ExtAddr <= "1111111110011011";
2879
       ExtWr <= '1';
2880
       Data2Ext <= "0000000000101000";
2881
       ExtEna <= EXT_ACT;
2882
       icwait(2);
2883
       ExtEna <= not EXT_ACT;
2884
       icwait(2);
2885
 
2886
       RxD <= '1';
2887
       icwait(BITCLK/2);
2888
 
2889
-- NOEVENT, receive, polling, 1 P 1S, Parity Error + ERRI
2890
       reset <= not RES_ACT;
2891
       AccViol <= not ACCVIOL_ACT;
2892
       RxD <= '1';
2893
       Data2Ext <= (others => '0');
2894
       ExtEna <= not EXT_ACT;
2895
 
2896
       -- UBRS setzen
2897
       ExtAddr <= "1111111110011111";
2898
       ExtWr <= '1';
2899
       Data2Ext <= UBRS_CONST;
2900
       ExtEna <= EXT_ACT;
2901
       icwait(2);
2902
       ExtEna <= not EXT_ACT;
2903
       icwait(2);
2904
 
2905
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
2906
       ExtAddr <= "1111111110011010";
2907
       ExtWr <= '1';
2908
       Data2Ext <= "1001000000000000";
2909
       ExtEna <= EXT_ACT;
2910
       icwait(2);
2911
       ExtEna <= not EXT_ACT;
2912
       icwait(2);
2913
 
2914
       -- UARTCMD setzen: ERRI, noEI, ENAREC, NOEVENT
2915
       ExtAddr <= "1111111110011011";
2916
       ExtWr <= '1';
2917
       Data2Ext <= "0000000010100000";
2918
       ExtEna <= EXT_ACT;
2919
       icwait(2);
2920
       ExtEna <= not EXT_ACT;
2921
       icwait(2);
2922
 
2923
       RxD <= '0';                      -- Startbit
2924
       icwait(BITCLK);
2925
       RxD <= '1';                      -- Message (1)
2926
       icwait(BITCLK);
2927
       RxD <= '0';                      -- wrong Paritybit (Even)
2928
       icwait(BITCLK);
2929
       RxD <= '1';                      -- Stopbit
2930
 
2931
       icwait(BITCLK);
2932
 
2933
       -- Status lesen
2934
       ExtAddr <= "1111111110011000";
2935
       ExtWr <= '0';
2936
       ExtEna <= EXT_ACT;
2937
       icwait(2);
2938
       ExtEna <= not EXT_ACT;
2939
       icwait(2);
2940
 
2941
       -- MSGREG lesen
2942
       ExtAddr <= "1111111110011100";
2943
       ExtWr <= '0';
2944
       ExtEna <= EXT_ACT;
2945
       icwait(2);
2946
       ExtEna <= not EXT_ACT;
2947
       icwait(2);
2948
 
2949
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, INTA
2950
       ExtAddr <= "1111111110011001";
2951
       ExtWr <= '1';
2952
       Data2Ext <= "0000000000000001";
2953
       ExtEna <= EXT_ACT;
2954
       icwait(2);
2955
       ExtEna <= not EXT_ACT;
2956
       icwait(2);
2957
 
2958
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
2959
       ExtAddr <= "1111111110011011";
2960
       ExtWr <= '1';
2961
       Data2Ext <= "0000000000101000";
2962
       ExtEna <= EXT_ACT;
2963
       icwait(2);
2964
       ExtEna <= not EXT_ACT;
2965
       icwait(2);
2966
 
2967
       -- Status lesen
2968
       ExtAddr <= "1111111110011000";
2969
       ExtWr <= '0';
2970
       ExtEna <= EXT_ACT;
2971
       icwait(2);
2972
       ExtEna <= not EXT_ACT;
2973
       icwait(2);
2974
 
2975
       RxD <= '1';
2976
       icwait(BITCLK/2);
2977
 
2978
-- NOEVENT, receive, polling, 1 P 1S, Frame Error + ERRI
2979
       reset <= not RES_ACT;
2980
       AccViol <= not ACCVIOL_ACT;
2981
       RxD <= '1';
2982
       Data2Ext <= (others => '0');
2983
       ExtEna <= not EXT_ACT;
2984
 
2985
       -- UBRS setzen
2986
       ExtAddr <= "1111111110011111";
2987
       ExtWr <= '1';
2988
       Data2Ext <= UBRS_CONST;
2989
       ExtEna <= EXT_ACT;
2990
       icwait(2);
2991
       ExtEna <= not EXT_ACT;
2992
       icwait(2);
2993
 
2994
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
2995
       ExtAddr <= "1111111110011010";
2996
       ExtWr <= '1';
2997
       Data2Ext <= "1001000000000000";
2998
       ExtEna <= EXT_ACT;
2999
       icwait(2);
3000
       ExtEna <= not EXT_ACT;
3001
       icwait(2);
3002
 
3003
       -- UARTCMD setzen: ERRI, noEI, ENAREC, NOEVENT
3004
       ExtAddr <= "1111111110011011";
3005
       ExtWr <= '1';
3006
       Data2Ext <= "0000000010100000";
3007
       ExtEna <= EXT_ACT;
3008
       icwait(2);
3009
       ExtEna <= not EXT_ACT;
3010
       icwait(2);
3011
 
3012
       RxD <= '0';                      -- Startbit
3013
       icwait(BITCLK);
3014
       RxD <= '1';                      -- Message (1)
3015
       icwait(BITCLK);
3016
       RxD <= '1';                      -- Paritybit (Even)
3017
       icwait(BITCLK);
3018
       RxD <= '0';                      -- wrong Stopbit
3019
 
3020
       icwait(BITCLK);
3021
 
3022
       -- Status lesen
3023
       ExtAddr <= "1111111110011000";
3024
       ExtWr <= '0';
3025
       ExtEna <= EXT_ACT;
3026
       icwait(2);
3027
       ExtEna <= not EXT_ACT;
3028
       icwait(2);
3029
 
3030
       -- MSGREG lesen
3031
       ExtAddr <= "1111111110011100";
3032
       ExtWr <= '0';
3033
       ExtEna <= EXT_ACT;
3034
       icwait(2);
3035
       ExtEna <= not EXT_ACT;
3036
       icwait(2);
3037
 
3038
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, INTA
3039
       ExtAddr <= "1111111110011001";
3040
       ExtWr <= '1';
3041
       Data2Ext <= "0000000000000001";
3042
       ExtEna <= EXT_ACT;
3043
       icwait(2);
3044
       ExtEna <= not EXT_ACT;
3045
       icwait(2);
3046
 
3047
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3048
       ExtAddr <= "1111111110011011";
3049
       ExtWr <= '1';
3050
       Data2Ext <= "0000000000101000";
3051
       ExtEna <= EXT_ACT;
3052
       icwait(2);
3053
       ExtEna <= not EXT_ACT;
3054
       icwait(2);
3055
 
3056
       -- Status lesen
3057
       ExtAddr <= "1111111110011000";
3058
       ExtWr <= '0';
3059
       ExtEna <= EXT_ACT;
3060
       icwait(2);
3061
       ExtEna <= not EXT_ACT;
3062
       icwait(2);
3063
 
3064
       RxD <= '1';
3065
       icwait(BITCLK/2);
3066
 
3067
-- NOEVENT, receive, polling, 2 P 1S, Overflow
3068
       reset <= not RES_ACT;
3069
       AccViol <= not ACCVIOL_ACT;
3070
       RxD <= '1';
3071
       Data2Ext <= (others => '0');
3072
       ExtEna <= not EXT_ACT;
3073
 
3074
       -- UBRS setzen
3075
       ExtAddr <= "1111111110011111";
3076
       ExtWr <= '1';
3077
       Data2Ext <= UBRS_CONST;
3078
       ExtEna <= EXT_ACT;
3079
       icwait(2);
3080
       ExtEna <= not EXT_ACT;
3081
       icwait(2);
3082
 
3083
       -- UARTCONF setzen: 2 P Even 1S, TrCtrl
3084
       ExtAddr <= "1111111110011010";
3085
       ExtWr <= '1';
3086
       Data2Ext <= "1001000100000000";
3087
       ExtEna <= EXT_ACT;
3088
       icwait(2);
3089
       ExtEna <= not EXT_ACT;
3090
       icwait(2);
3091
 
3092
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3093
       ExtAddr <= "1111111110011011";
3094
       ExtWr <= '1';
3095
       Data2Ext <= "0000000000100000";
3096
       ExtEna <= EXT_ACT;
3097
       icwait(2);
3098
       ExtEna <= not EXT_ACT;
3099
       icwait(2);
3100
 
3101
       RxD <= '0';                      -- Startbit
3102
       icwait(BITCLK);
3103
       RxD <= '1';                      -- Message (1)
3104
       icwait(BITCLK);
3105
       RxD <= '0';                      -- Message (2)
3106
       icwait(BITCLK);
3107
       RxD <= '1';                      -- Paritybit (Even)
3108
       icwait(BITCLK);
3109
       RxD <= '1';                      -- Stopbit
3110
 
3111
       icwait(BITCLK);
3112
 
3113
       -- Status lesen
3114
       ExtAddr <= "1111111110011000";
3115
       ExtWr <= '0';
3116
       ExtEna <= EXT_ACT;
3117
       icwait(2);
3118
       ExtEna <= not EXT_ACT;
3119
       icwait(2);
3120
 
3121
       RxD <= '0';                      -- Startbit
3122
       icwait(BITCLK);
3123
       RxD <= '0';                      -- Message (1)
3124
       icwait(BITCLK);
3125
       RxD <= '1';                      -- Message (2)
3126
       icwait(BITCLK);
3127
       RxD <= '1';                      -- Paritybit (Even)
3128
       icwait(BITCLK);
3129
       RxD <= '1';                      -- Stopbit
3130
 
3131
       icwait(BITCLK);
3132
 
3133
       -- Status lesen
3134
       ExtAddr <= "1111111110011000";
3135
       ExtWr <= '0';
3136
       ExtEna <= EXT_ACT;
3137
       icwait(2);
3138
       ExtEna <= not EXT_ACT;
3139
       icwait(2);
3140
 
3141
       -- MSGREG lesen
3142
       ExtAddr <= "1111111110011100";
3143
       ExtWr <= '0';
3144
       ExtEna <= EXT_ACT;
3145
       icwait(2);
3146
       ExtEna <= not EXT_ACT;
3147
       icwait(2);
3148
 
3149
       -- Status lesen
3150
       ExtAddr <= "1111111110011000";
3151
       ExtWr <= '0';
3152
       ExtEna <= EXT_ACT;
3153
       icwait(2);
3154
       ExtEna <= not EXT_ACT;
3155
       icwait(2);
3156
 
3157
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3158
       ExtAddr <= "1111111110011011";
3159
       ExtWr <= '1';
3160
       Data2Ext <= "0000000000101000";
3161
       ExtEna <= EXT_ACT;
3162
       icwait(2);
3163
       ExtEna <= not EXT_ACT;
3164
       icwait(2);
3165
 
3166
       RxD <= '1';
3167
       icwait(BITCLK/2);
3168
 
3169
-- STARTBITDETECTION, receive, polling, 1 P 1S
3170
       reset <= not RES_ACT;
3171
       AccViol <= not ACCVIOL_ACT;
3172
       RxD <= '1';
3173
       Data2Ext <= (others => '0');
3174
       ExtEna <= not EXT_ACT;
3175
 
3176
       -- UBRS setzen
3177
       ExtAddr <= "1111111110011111";
3178
       ExtWr <= '1';
3179
       Data2Ext <= UBRS_CONST;
3180
       ExtEna <= EXT_ACT;
3181
       icwait(2);
3182
       ExtEna <= not EXT_ACT;
3183
       icwait(2);
3184
 
3185
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3186
       ExtAddr <= "1111111110011010";
3187
       ExtWr <= '1';
3188
       Data2Ext <= "1001000000000000";
3189
       ExtEna <= EXT_ACT;
3190
       icwait(2);
3191
       ExtEna <= not EXT_ACT;
3192
       icwait(2);
3193
 
3194
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3195
       ExtAddr <= "1111111110011011";
3196
       ExtWr <= '1';
3197
       Data2Ext <= "0000000000100000";
3198
       ExtEna <= EXT_ACT;
3199
       icwait(2);
3200
       ExtEna <= not EXT_ACT;
3201
       icwait(2);
3202
 
3203
       -- UARTCMD setzen: noERRI, noEI, NOACTION, SBD
3204
       ExtAddr <= "1111111110011011";
3205
       ExtWr <= '1';
3206
       Data2Ext <= "0000000000000010";
3207
       ExtEna <= EXT_ACT;
3208
       icwait(2);
3209
       ExtEna <= not EXT_ACT;
3210
       icwait(2);
3211
 
3212
       RxD <= '0';                      -- Startbit
3213
       icwait(BITCLK-4);
3214
 
3215
       -- Status lesen
3216
       ExtAddr <= "1111111110011000";
3217
       ExtWr <= '0';
3218
       ExtEna <= EXT_ACT;
3219
       icwait(2);
3220
       ExtEna <= not EXT_ACT;
3221
       icwait(2);
3222
 
3223
       RxD <= '1';                      -- Message (1)
3224
       icwait(BITCLK);
3225
       RxD <= '1';                      -- Paritybit (Even)
3226
       icwait(BITCLK);
3227
       RxD <= '1';                      -- Stopbit
3228
 
3229
       icwait(BITCLK);
3230
 
3231
       -- Status lesen
3232
       ExtAddr <= "1111111110011000";
3233
       ExtWr <= '0';
3234
       ExtEna <= EXT_ACT;
3235
       icwait(2);
3236
       ExtEna <= not EXT_ACT;
3237
       icwait(2);
3238
 
3239
       -- MSGREG lesen
3240
       ExtAddr <= "1111111110011100";
3241
       ExtWr <= '0';
3242
       ExtEna <= EXT_ACT;
3243
       icwait(2);
3244
       ExtEna <= not EXT_ACT;
3245
       icwait(2);
3246
 
3247
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3248
       ExtAddr <= "1111111110011011";
3249
       ExtWr <= '1';
3250
       Data2Ext <= "0000000000101000";
3251
       ExtEna <= EXT_ACT;
3252
       icwait(2);
3253
       ExtEna <= not EXT_ACT;
3254
       icwait(2);
3255
 
3256
       RxD <= '1';
3257
       icwait(BITCLK/2);
3258
 
3259
-- STARTBITDETECTION, receive, interrupt, 1 P 1S
3260
       reset <= not RES_ACT;
3261
       AccViol <= not ACCVIOL_ACT;
3262
       RxD <= '1';
3263
       Data2Ext <= (others => '0');
3264
       ExtEna <= not EXT_ACT;
3265
 
3266
       -- UBRS setzen
3267
       ExtAddr <= "1111111110011111";
3268
       ExtWr <= '1';
3269
       Data2Ext <= UBRS_CONST;
3270
       ExtEna <= EXT_ACT;
3271
       icwait(2);
3272
       ExtEna <= not EXT_ACT;
3273
       icwait(2);
3274
 
3275
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3276
       ExtAddr <= "1111111110011010";
3277
       ExtWr <= '1';
3278
       Data2Ext <= "1001000000000000";
3279
       ExtEna <= EXT_ACT;
3280
       icwait(2);
3281
       ExtEna <= not EXT_ACT;
3282
       icwait(2);
3283
 
3284
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3285
       ExtAddr <= "1111111110011011";
3286
       ExtWr <= '1';
3287
       Data2Ext <= "0000000000100000";
3288
       ExtEna <= EXT_ACT;
3289
       icwait(2);
3290
       ExtEna <= not EXT_ACT;
3291
       icwait(2);
3292
 
3293
       -- UARTCMD setzen: noERRI, EI, NOACTION, SBD
3294
       ExtAddr <= "1111111110011011";
3295
       ExtWr <= '1';
3296
       Data2Ext <= "0000000001000010";
3297
       ExtEna <= EXT_ACT;
3298
       icwait(2);
3299
       ExtEna <= not EXT_ACT;
3300
       icwait(2);
3301
 
3302
       RxD <= '0';                      -- Startbit
3303
       icwait(BITCLK-4);
3304
       RxD <= '1';                      -- Message (1)
3305
       icwait(BITCLK);
3306
       RxD <= '1';                      -- Paritybit (Even)
3307
       icwait(BITCLK);
3308
       RxD <= '1';                      -- Stopbit
3309
 
3310
       icwait(BITCLK);
3311
 
3312
       -- Status lesen
3313
       ExtAddr <= "1111111110011000";
3314
       ExtWr <= '0';
3315
       ExtEna <= EXT_ACT;
3316
       icwait(2);
3317
       ExtEna <= not EXT_ACT;
3318
       icwait(2);
3319
 
3320
       -- MSGREG lesen
3321
       ExtAddr <= "1111111110011100";
3322
       ExtWr <= '0';
3323
       ExtEna <= EXT_ACT;
3324
       icwait(2);
3325
       ExtEna <= not EXT_ACT;
3326
       icwait(2);
3327
 
3328
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, INTA
3329
       ExtAddr <= "1111111110011001";
3330
       ExtWr <= '1';
3331
       Data2Ext <= "0000000000000001";
3332
       ExtEna <= EXT_ACT;
3333
       icwait(2);
3334
       ExtEna <= not EXT_ACT;
3335
       icwait(2);
3336
 
3337
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3338
       ExtAddr <= "1111111110011011";
3339
       ExtWr <= '1';
3340
       Data2Ext <= "0000000000101000";
3341
       ExtEna <= EXT_ACT;
3342
       icwait(2);
3343
       ExtEna <= not EXT_ACT;
3344
       icwait(2);
3345
 
3346
       -- Status lesen
3347
       ExtAddr <= "1111111110011000";
3348
       ExtWr <= '0';
3349
       ExtEna <= EXT_ACT;
3350
       icwait(2);
3351
       ExtEna <= not EXT_ACT;
3352
       icwait(2);
3353
 
3354
       RxD <= '1';
3355
       icwait(BITCLK/2);
3356
 
3357
-- STARTBITDETECTION -> disable receiver, receive, polling, 1 P 1S
3358
       reset <= not RES_ACT;
3359
       AccViol <= not ACCVIOL_ACT;
3360
       RxD <= '1';
3361
       Data2Ext <= (others => '0');
3362
       ExtEna <= not EXT_ACT;
3363
 
3364
       -- UBRS setzen
3365
       ExtAddr <= "1111111110011111";
3366
       ExtWr <= '1';
3367
       Data2Ext <= UBRS_CONST;
3368
       ExtEna <= EXT_ACT;
3369
       icwait(2);
3370
       ExtEna <= not EXT_ACT;
3371
       icwait(2);
3372
 
3373
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3374
       ExtAddr <= "1111111110011010";
3375
       ExtWr <= '1';
3376
       Data2Ext <= "1001000000000000";
3377
       ExtEna <= EXT_ACT;
3378
       icwait(2);
3379
       ExtEna <= not EXT_ACT;
3380
       icwait(2);
3381
 
3382
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3383
       ExtAddr <= "1111111110011011";
3384
       ExtWr <= '1';
3385
       Data2Ext <= "0000000000100000";
3386
       ExtEna <= EXT_ACT;
3387
       icwait(2);
3388
       ExtEna <= not EXT_ACT;
3389
       icwait(2);
3390
 
3391
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, SBD
3392
       ExtAddr <= "1111111110011011";
3393
       ExtWr <= '1';
3394
       Data2Ext <= "0000000000101010";
3395
       ExtEna <= EXT_ACT;
3396
       icwait(2);
3397
       ExtEna <= not EXT_ACT;
3398
       icwait(2);
3399
 
3400
       RxD <= '0';                      -- Startbit
3401
       icwait(BITCLK-4);
3402
       RxD <= '1';                      -- Message (1)
3403
       icwait(BITCLK);
3404
       RxD <= '1';                      -- Paritybit (Even)
3405
       icwait(BITCLK);
3406
       RxD <= '1';                      -- Stopbit
3407
 
3408
       icwait(BITCLK);
3409
 
3410
       -- Status lesen
3411
       ExtAddr <= "1111111110011000";
3412
       ExtWr <= '0';
3413
       ExtEna <= EXT_ACT;
3414
       icwait(2);
3415
       ExtEna <= not EXT_ACT;
3416
       icwait(2);
3417
 
3418
       -- MSGREG lesen
3419
       ExtAddr <= "1111111110011100";
3420
       ExtWr <= '0';
3421
       ExtEna <= EXT_ACT;
3422
       icwait(2);
3423
       ExtEna <= not EXT_ACT;
3424
       icwait(2);
3425
 
3426
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3427
       ExtAddr <= "1111111110011011";
3428
       ExtWr <= '1';
3429
       Data2Ext <= "0000000000101000";
3430
       ExtEna <= EXT_ACT;
3431
       icwait(2);
3432
       ExtEna <= not EXT_ACT;
3433
       icwait(2);
3434
 
3435
       RxD <= '1';
3436
       icwait(BITCLK/2);
3437
 
3438
-- EV_RCOMP, receive, polling, 1 P 1S
3439
       reset <= not RES_ACT;
3440
       AccViol <= not ACCVIOL_ACT;
3441
       RxD <= '1';
3442
       Data2Ext <= (others => '0');
3443
       ExtEna <= not EXT_ACT;
3444
 
3445
       -- UBRS setzen
3446
       ExtAddr <= "1111111110011111";
3447
       ExtWr <= '1';
3448
       Data2Ext <= UBRS_CONST;
3449
       ExtEna <= EXT_ACT;
3450
       icwait(2);
3451
       ExtEna <= not EXT_ACT;
3452
       icwait(2);
3453
 
3454
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3455
       ExtAddr <= "1111111110011010";
3456
       ExtWr <= '1';
3457
       Data2Ext <= "1001000000000000";
3458
       ExtEna <= EXT_ACT;
3459
       icwait(2);
3460
       ExtEna <= not EXT_ACT;
3461
       icwait(2);
3462
 
3463
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3464
       ExtAddr <= "1111111110011011";
3465
       ExtWr <= '1';
3466
       Data2Ext <= "0000000000100000";
3467
       ExtEna <= EXT_ACT;
3468
       icwait(2);
3469
       ExtEna <= not EXT_ACT;
3470
       icwait(2);
3471
 
3472
       -- UARTCMD setzen: noERRI, noEI, NOACTION, RCOMP
3473
       ExtAddr <= "1111111110011011";
3474
       ExtWr <= '1';
3475
       Data2Ext <= "0000000000000100";
3476
       ExtEna <= EXT_ACT;
3477
       icwait(2);
3478
       ExtEna <= not EXT_ACT;
3479
       icwait(2);
3480
 
3481
       RxD <= '0';                      -- Startbit
3482
       icwait(BITCLK-4);
3483
       RxD <= '1';                      -- Message (1)
3484
       icwait(BITCLK);
3485
       RxD <= '1';                      -- Paritybit (Even)
3486
       icwait(BITCLK);
3487
       RxD <= '1';                      -- Stopbit
3488
 
3489
       icwait(BITCLK);
3490
 
3491
       -- Status lesen
3492
       ExtAddr <= "1111111110011000";
3493
       ExtWr <= '0';
3494
       ExtEna <= EXT_ACT;
3495
       icwait(2);
3496
       ExtEna <= not EXT_ACT;
3497
       icwait(2);
3498
 
3499
       -- MSGREG lesen
3500
       ExtAddr <= "1111111110011100";
3501
       ExtWr <= '0';
3502
       ExtEna <= EXT_ACT;
3503
       icwait(2);
3504
       ExtEna <= not EXT_ACT;
3505
       icwait(2);
3506
 
3507
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3508
       ExtAddr <= "1111111110011011";
3509
       ExtWr <= '1';
3510
       Data2Ext <= "0000000000101000";
3511
       ExtEna <= EXT_ACT;
3512
       icwait(2);
3513
       ExtEna <= not EXT_ACT;
3514
       icwait(2);
3515
 
3516
       RxD <= '1';
3517
       icwait(BITCLK/2);
3518
 
3519
-- EV_RCOMP, receive, interrupt, 1 P 1S
3520
       reset <= not RES_ACT;
3521
       AccViol <= not ACCVIOL_ACT;
3522
       RxD <= '1';
3523
       Data2Ext <= (others => '0');
3524
       ExtEna <= not EXT_ACT;
3525
 
3526
       -- UBRS setzen
3527
       ExtAddr <= "1111111110011111";
3528
       ExtWr <= '1';
3529
       Data2Ext <= UBRS_CONST;
3530
       ExtEna <= EXT_ACT;
3531
       icwait(2);
3532
       ExtEna <= not EXT_ACT;
3533
       icwait(2);
3534
 
3535
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3536
       ExtAddr <= "1111111110011010";
3537
       ExtWr <= '1';
3538
       Data2Ext <= "1001000000000000";
3539
       ExtEna <= EXT_ACT;
3540
       icwait(2);
3541
       ExtEna <= not EXT_ACT;
3542
       icwait(2);
3543
 
3544
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3545
       ExtAddr <= "1111111110011011";
3546
       ExtWr <= '1';
3547
       Data2Ext <= "0000000000100000";
3548
       ExtEna <= EXT_ACT;
3549
       icwait(2);
3550
       ExtEna <= not EXT_ACT;
3551
       icwait(2);
3552
 
3553
       -- UARTCMD setzen: noERRI, EI, NOACTION, RCOMP
3554
       ExtAddr <= "1111111110011011";
3555
       ExtWr <= '1';
3556
       Data2Ext <= "0000000001000100";
3557
       ExtEna <= EXT_ACT;
3558
       icwait(2);
3559
       ExtEna <= not EXT_ACT;
3560
       icwait(2);
3561
 
3562
       RxD <= '0';                      -- Startbit
3563
       icwait(BITCLK-4);
3564
       RxD <= '1';                      -- Message (1)
3565
       icwait(BITCLK);
3566
       RxD <= '1';                      -- Paritybit (Even)
3567
       icwait(BITCLK);
3568
       RxD <= '1';                      -- Stopbit
3569
 
3570
       icwait(BITCLK);
3571
 
3572
       -- Status lesen
3573
       ExtAddr <= "1111111110011000";
3574
       ExtWr <= '0';
3575
       ExtEna <= EXT_ACT;
3576
       icwait(2);
3577
       ExtEna <= not EXT_ACT;
3578
       icwait(2);
3579
 
3580
       -- MSGREG lesen
3581
       ExtAddr <= "1111111110011100";
3582
       ExtWr <= '0';
3583
       ExtEna <= EXT_ACT;
3584
       icwait(2);
3585
       ExtEna <= not EXT_ACT;
3586
       icwait(2);
3587
 
3588
       -- CONF setzen: noLooW, noEFSS, noOutD, noSRes, noId, INTA
3589
       ExtAddr <= "1111111110011001";
3590
       ExtWr <= '1';
3591
       Data2Ext <= "0000000000000001";
3592
       ExtEna <= EXT_ACT;
3593
       icwait(2);
3594
       ExtEna <= not EXT_ACT;
3595
       icwait(2);
3596
 
3597
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3598
       ExtAddr <= "1111111110011011";
3599
       ExtWr <= '1';
3600
       Data2Ext <= "0000000000101000";
3601
       ExtEna <= EXT_ACT;
3602
       icwait(2);
3603
       ExtEna <= not EXT_ACT;
3604
       icwait(2);
3605
 
3606
       -- Status lesen
3607
       ExtAddr <= "1111111110011000";
3608
       ExtWr <= '0';
3609
       ExtEna <= EXT_ACT;
3610
       icwait(2);
3611
       ExtEna <= not EXT_ACT;
3612
       icwait(2);
3613
 
3614
       RxD <= '1';
3615
       icwait(BITCLK/2);
3616
 
3617
-- EV_RCOMP -> disable receiver, receive, polling, 1 P 1S
3618
       reset <= not RES_ACT;
3619
       AccViol <= not ACCVIOL_ACT;
3620
       RxD <= '1';
3621
       Data2Ext <= (others => '0');
3622
       ExtEna <= not EXT_ACT;
3623
 
3624
       -- UBRS setzen
3625
       ExtAddr <= "1111111110011111";
3626
       ExtWr <= '1';
3627
       Data2Ext <= UBRS_CONST;
3628
       ExtEna <= EXT_ACT;
3629
       icwait(2);
3630
       ExtEna <= not EXT_ACT;
3631
       icwait(2);
3632
 
3633
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3634
       ExtAddr <= "1111111110011010";
3635
       ExtWr <= '1';
3636
       Data2Ext <= "1001000000000000";
3637
       ExtEna <= EXT_ACT;
3638
       icwait(2);
3639
       ExtEna <= not EXT_ACT;
3640
       icwait(2);
3641
 
3642
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3643
       ExtAddr <= "1111111110011011";
3644
       ExtWr <= '1';
3645
       Data2Ext <= "0000000000100000";
3646
       ExtEna <= EXT_ACT;
3647
       icwait(2);
3648
       ExtEna <= not EXT_ACT;
3649
       icwait(2);
3650
 
3651
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, RCOMP
3652
       ExtAddr <= "1111111110011011";
3653
       ExtWr <= '1';
3654
       Data2Ext <= "0000000000101100";
3655
       ExtEna <= EXT_ACT;
3656
       icwait(2);
3657
       ExtEna <= not EXT_ACT;
3658
       icwait(2);
3659
 
3660
       RxD <= '0';                      -- Startbit
3661
       icwait(BITCLK-4);
3662
       RxD <= '1';                      -- Message (1)
3663
       icwait(BITCLK);
3664
       RxD <= '1';                      -- Paritybit (Even)
3665
       icwait(BITCLK);
3666
       RxD <= '1';                      -- Stopbit
3667
 
3668
       icwait(BITCLK);
3669
 
3670
       -- Status lesen
3671
       ExtAddr <= "1111111110011000";
3672
       ExtWr <= '0';
3673
       ExtEna <= EXT_ACT;
3674
       icwait(2);
3675
       ExtEna <= not EXT_ACT;
3676
       icwait(2);
3677
 
3678
       -- MSGREG lesen
3679
       ExtAddr <= "1111111110011100";
3680
       ExtWr <= '0';
3681
       ExtEna <= EXT_ACT;
3682
       icwait(2);
3683
       ExtEna <= not EXT_ACT;
3684
       icwait(2);
3685
 
3686
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3687
       ExtAddr <= "1111111110011011";
3688
       ExtWr <= '1';
3689
       Data2Ext <= "0000000000101000";
3690
       ExtEna <= EXT_ACT;
3691
       icwait(2);
3692
       ExtEna <= not EXT_ACT;
3693
       icwait(2);
3694
 
3695
       RxD <= '1';
3696
       icwait(BITCLK/2);
3697
 
3698
       reset <= RES_ACT;
3699
       icwait(5);
3700
 
3701
------------------------------------------------------------------------------- 
3702
--Receive & Transmit
3703
-- EV_TRCOMP -> enable receiver, 1 P 1S
3704
       reset <= not RES_ACT;
3705
       AccViol <= not ACCVIOL_ACT;
3706
       RxD <= '1';
3707
       Data2Ext <= (others => '0');
3708
       ExtEna <= not EXT_ACT;
3709
 
3710
       -- UBRS setzen
3711
       ExtAddr <= "1111111110011111";
3712
       ExtWr <= '1';
3713
       Data2Ext <= UBRS_CONST;
3714
       ExtEna <= EXT_ACT;
3715
       icwait(2);
3716
       ExtEna <= not EXT_ACT;
3717
       icwait(2);
3718
 
3719
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
3720
       ExtAddr <= "1111111110011010";
3721
       ExtWr <= '1';
3722
       Data2Ext <= "1000000000000000";
3723
       ExtEna <= EXT_ACT;
3724
       icwait(2);
3725
       ExtEna <= not EXT_ACT;
3726
       icwait(2);
3727
 
3728
       -- MSGREG setzen
3729
       ExtAddr <= "1111111110011100";
3730
       ExtWr <= '1';
3731
       Data2Ext <= DATA_CONST1;
3732
       ExtEna <= EXT_ACT;
3733
       icwait(2);
3734
       ExtEna <= not EXT_ACT;
3735
       icwait(2);
3736
 
3737
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
3738
       ExtAddr <= "1111111110011011";
3739
       ExtWr <= '1';
3740
       Data2Ext <= "0000000000011000";
3741
       ExtEna <= EXT_ACT;
3742
       icwait(2);
3743
       ExtEna <= not EXT_ACT;
3744
       icwait(2);
3745
 
3746
       -- UARTCMD setzen: noERRI, noEI, EREC, TRCOMP
3747
       ExtAddr <= "1111111110011011";
3748
       ExtWr <= '1';
3749
       Data2Ext <= "0000000000100110";
3750
       ExtEna <= EXT_ACT;
3751
       icwait(2);
3752
       ExtEna <= not EXT_ACT;
3753
       icwait(2);
3754
 
3755
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
3756
       icwait(5*BITCLK);
3757
 
3758
       RxD <= '0';                      -- Startbit
3759
       icwait(BITCLK);
3760
       RxD <= '1';                      -- Message (1)
3761
       icwait(BITCLK);
3762
       RxD <= '1';                      -- Paritybit (Even)
3763
       icwait(BITCLK);
3764
       RxD <= '1';                      -- Stopbit
3765
 
3766
       icwait(BITCLK);
3767
 
3768
       -- Status lesen
3769
       ExtAddr <= "1111111110011000";
3770
       ExtWr <= '0';
3771
       ExtEna <= EXT_ACT;
3772
       icwait(2);
3773
       ExtEna <= not EXT_ACT;
3774
       icwait(2);
3775
 
3776
       -- MSGREG lesen
3777
       ExtAddr <= "1111111110011100";
3778
       ExtWr <= '0';
3779
       ExtEna <= EXT_ACT;
3780
       icwait(2);
3781
       ExtEna <= not EXT_ACT;
3782
       icwait(2);
3783
 
3784
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3785
       ExtAddr <= "1111111110011011";
3786
       ExtWr <= '1';
3787
       Data2Ext <= "0000000000101000";
3788
       ExtEna <= EXT_ACT;
3789
       icwait(2);
3790
       ExtEna <= not EXT_ACT;
3791
       icwait(2);
3792
 
3793
       RxD <= '1';
3794
       icwait(BITCLK/2);
3795
 
3796
-- EV_TRCOMP -> disable receiver, 1 P 1S
3797
       reset <= not RES_ACT;
3798
       AccViol <= not ACCVIOL_ACT;
3799
       RxD <= '1';
3800
       Data2Ext <= (others => '0');
3801
       ExtEna <= not EXT_ACT;
3802
 
3803
       -- UBRS setzen
3804
       ExtAddr <= "1111111110011111";
3805
       ExtWr <= '1';
3806
       Data2Ext <= UBRS_CONST;
3807
       ExtEna <= EXT_ACT;
3808
       icwait(2);
3809
       ExtEna <= not EXT_ACT;
3810
       icwait(2);
3811
 
3812
       -- UARTCONF setzen: 1 P Even 1S, noTrCtrl
3813
       ExtAddr <= "1111111110011010";
3814
       ExtWr <= '1';
3815
       Data2Ext <= "1000000000000000";
3816
       ExtEna <= EXT_ACT;
3817
       icwait(2);
3818
       ExtEna <= not EXT_ACT;
3819
       icwait(2);
3820
 
3821
       -- MSGREG setzen
3822
       ExtAddr <= "1111111110011100";
3823
       ExtWr <= '1';
3824
       Data2Ext <= DATA_CONST1;
3825
       ExtEna <= EXT_ACT;
3826
       icwait(2);
3827
       ExtEna <= not EXT_ACT;
3828
       icwait(2);
3829
 
3830
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
3831
       ExtAddr <= "1111111110011011";
3832
       ExtWr <= '1';
3833
       Data2Ext <= "0000000000011000";
3834
       ExtEna <= EXT_ACT;
3835
       icwait(2);
3836
       ExtEna <= not EXT_ACT;
3837
       icwait(2);
3838
 
3839
       -- UARTCMD setzen: noERRI, noEI, EREC, NOEVENT
3840
       ExtAddr <= "1111111110011011";
3841
       ExtWr <= '1';
3842
       Data2Ext <= "0000000000100000";
3843
       ExtEna <= EXT_ACT;
3844
       icwait(2);
3845
       ExtEna <= not EXT_ACT;
3846
       icwait(2);
3847
 
3848
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, TRCOMP
3849
       ExtAddr <= "1111111110011011";
3850
       ExtWr <= '1';
3851
       Data2Ext <= "0000000000101110";
3852
       ExtEna <= EXT_ACT;
3853
       icwait(2);
3854
       ExtEna <= not EXT_ACT;
3855
       icwait(2);
3856
 
3857
       -- 5 bits warten (1 start + 1 data + 1 parity + 1 Stop = 4 + 1 zum Überprüfen)
3858
       icwait(5*BITCLK);
3859
 
3860
       RxD <= '0';                      -- Startbit
3861
       icwait(BITCLK);
3862
       RxD <= '0';                      -- Message (1)
3863
       icwait(BITCLK);
3864
       RxD <= '0';                      -- Paritybit (Even)
3865
       icwait(BITCLK);
3866
       RxD <= '1';                      -- Stopbit
3867
 
3868
       icwait(BITCLK);
3869
 
3870
       -- Status lesen
3871
       ExtAddr <= "1111111110011000";
3872
       ExtWr <= '0';
3873
       ExtEna <= EXT_ACT;
3874
       icwait(2);
3875
       ExtEna <= not EXT_ACT;
3876
       icwait(2);
3877
 
3878
       -- MSGREG lesen
3879
       ExtAddr <= "1111111110011100";
3880
       ExtWr <= '0';
3881
       ExtEna <= EXT_ACT;
3882
       icwait(2);
3883
       ExtEna <= not EXT_ACT;
3884
       icwait(2);
3885
 
3886
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3887
       ExtAddr <= "1111111110011011";
3888
       ExtWr <= '1';
3889
       Data2Ext <= "0000000000101000";
3890
       ExtEna <= EXT_ACT;
3891
       icwait(2);
3892
       ExtEna <= not EXT_ACT;
3893
       icwait(2);
3894
 
3895
       RxD <= '1';
3896
       icwait(BITCLK/2);
3897
 
3898
-- STARTBITDETECTION -> start transmission, 1 P 1S
3899
       reset <= not RES_ACT;
3900
       AccViol <= not ACCVIOL_ACT;
3901
       RxD <= '1';
3902
       Data2Ext <= (others => '0');
3903
       ExtEna <= not EXT_ACT;
3904
 
3905
       -- UBRS setzen
3906
       ExtAddr <= "1111111110011111";
3907
       ExtWr <= '1';
3908
       Data2Ext <= UBRS_CONST;
3909
       ExtEna <= EXT_ACT;
3910
       icwait(2);
3911
       ExtEna <= not EXT_ACT;
3912
       icwait(2);
3913
 
3914
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
3915
       ExtAddr <= "1111111110011010";
3916
       ExtWr <= '1';
3917
       Data2Ext <= "1001000000000000";
3918
       ExtEna <= EXT_ACT;
3919
       icwait(2);
3920
       ExtEna <= not EXT_ACT;
3921
       icwait(2);
3922
 
3923
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
3924
       ExtAddr <= "1111111110011011";
3925
       ExtWr <= '1';
3926
       Data2Ext <= "0000000000100000";
3927
       ExtEna <= EXT_ACT;
3928
       icwait(2);
3929
       ExtEna <= not EXT_ACT;
3930
       icwait(2);
3931
 
3932
       -- UARTCMD setzen: noERRI, noEI, STRANS, SBD
3933
       ExtAddr <= "1111111110011011";
3934
       ExtWr <= '1';
3935
       Data2Ext <= "0000000000011010";
3936
       ExtEna <= EXT_ACT;
3937
       icwait(2);
3938
       ExtEna <= not EXT_ACT;
3939
       icwait(2);
3940
 
3941
       -- MSGREG setzen
3942
       ExtAddr <= "1111111110011100";
3943
       ExtWr <= '1';
3944
       Data2Ext <= DATA_CONST1;
3945
       ExtEna <= EXT_ACT;
3946
       icwait(2);
3947
       ExtEna <= not EXT_ACT;
3948
       icwait(2);
3949
 
3950
       RxD <= '0';                      -- Startbit
3951
       icwait(BITCLK);
3952
       RxD <= '0';                      -- Message (1)
3953
       icwait(BITCLK);
3954
       RxD <= '0';                      -- Paritybit (Even)
3955
       icwait(BITCLK);
3956
       RxD <= '1';                      -- Stopbit
3957
 
3958
       icwait(2*BITCLK);
3959
 
3960
       -- Status lesen
3961
       ExtAddr <= "1111111110011000";
3962
       ExtWr <= '0';
3963
       ExtEna <= EXT_ACT;
3964
       icwait(2);
3965
       ExtEna <= not EXT_ACT;
3966
       icwait(2);
3967
 
3968
       -- MSGREG lesen
3969
       ExtAddr <= "1111111110011100";
3970
       ExtWr <= '0';
3971
       ExtEna <= EXT_ACT;
3972
       icwait(2);
3973
       ExtEna <= not EXT_ACT;
3974
       icwait(2);
3975
 
3976
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
3977
       ExtAddr <= "1111111110011011";
3978
       ExtWr <= '1';
3979
       Data2Ext <= "0000000000101000";
3980
       ExtEna <= EXT_ACT;
3981
       icwait(2);
3982
       ExtEna <= not EXT_ACT;
3983
       icwait(2);
3984
 
3985
       RxD <= '1';
3986
       icwait(BITCLK/2);
3987
 
3988
-- EV_RCOMP -> start transmission, 1 P 1S
3989
       reset <= not RES_ACT;
3990
       AccViol <= not ACCVIOL_ACT;
3991
       RxD <= '1';
3992
       Data2Ext <= (others => '0');
3993
       ExtEna <= not EXT_ACT;
3994
 
3995
       -- UBRS setzen
3996
       ExtAddr <= "1111111110011111";
3997
       ExtWr <= '1';
3998
       Data2Ext <= UBRS_CONST;
3999
       ExtEna <= EXT_ACT;
4000
       icwait(2);
4001
       ExtEna <= not EXT_ACT;
4002
       icwait(2);
4003
 
4004
       -- UARTCONF setzen: 1 P Even 1S, TrCtrl
4005
       ExtAddr <= "1111111110011010";
4006
       ExtWr <= '1';
4007
       Data2Ext <= "1001000000000000";
4008
       ExtEna <= EXT_ACT;
4009
       icwait(2);
4010
       ExtEna <= not EXT_ACT;
4011
       icwait(2);
4012
 
4013
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
4014
       ExtAddr <= "1111111110011011";
4015
       ExtWr <= '1';
4016
       Data2Ext <= "0000000000100000";
4017
       ExtEna <= EXT_ACT;
4018
       icwait(2);
4019
       ExtEna <= not EXT_ACT;
4020
       icwait(2);
4021
 
4022
       -- UARTCMD setzen: noERRI, noEI, STRANS, RCOMP
4023
       ExtAddr <= "1111111110011011";
4024
       ExtWr <= '1';
4025
       Data2Ext <= "0000000000011100";
4026
       ExtEna <= EXT_ACT;
4027
       icwait(2);
4028
       ExtEna <= not EXT_ACT;
4029
       icwait(2);
4030
 
4031
       -- MSGREG setzen
4032
       ExtAddr <= "1111111110011100";
4033
       ExtWr <= '1';
4034
       Data2Ext <= DATA_CONST1;
4035
       ExtEna <= EXT_ACT;
4036
       icwait(2);
4037
       ExtEna <= not EXT_ACT;
4038
       icwait(2);
4039
 
4040
       RxD <= '0';                      -- Startbit
4041
       icwait(BITCLK);
4042
       RxD <= '0';                      -- Message (1)
4043
       icwait(BITCLK);
4044
       RxD <= '0';                      -- Paritybit (Even)
4045
       icwait(BITCLK);
4046
       RxD <= '1';                      -- Stopbit
4047
 
4048
       icwait(BITCLK);
4049
 
4050
       -- 5 bits warten (1 start + 1 data + 1 Parity + 1 Stop = 4 + 1 zum Überprüfen)
4051
       icwait(5*BITCLK);
4052
 
4053
       -- Status lesen
4054
       ExtAddr <= "1111111110011000";
4055
       ExtWr <= '0';
4056
       ExtEna <= EXT_ACT;
4057
       icwait(2);
4058
       ExtEna <= not EXT_ACT;
4059
       icwait(2);
4060
 
4061
       -- MSGREG lesen
4062
       ExtAddr <= "1111111110011100";
4063
       ExtWr <= '0';
4064
       ExtEna <= EXT_ACT;
4065
       icwait(2);
4066
       ExtEna <= not EXT_ACT;
4067
       icwait(2);
4068
 
4069
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
4070
       ExtAddr <= "1111111110011011";
4071
       ExtWr <= '1';
4072
       Data2Ext <= "0000000000101000";
4073
       ExtEna <= EXT_ACT;
4074
       icwait(2);
4075
       ExtEna <= not EXT_ACT;
4076
       icwait(2);
4077
 
4078
       RxD <= '1';
4079
       icwait(BITCLK/2);
4080
 
4081
-- NOEVENT, receive & transmit, 8 P 1S
4082
       reset <= not RES_ACT;
4083
       AccViol <= not ACCVIOL_ACT;
4084
       RxD <= '1';
4085
       Data2Ext <= (others => '0');
4086
       ExtEna <= not EXT_ACT;
4087
 
4088
       -- UBRS setzen
4089
       ExtAddr <= "1111111110011111";
4090
       ExtWr <= '1';
4091
       Data2Ext <= UBRS_CONST;
4092
       ExtEna <= EXT_ACT;
4093
       icwait(2);
4094
       ExtEna <= not EXT_ACT;
4095
       icwait(2);
4096
 
4097
       -- UARTCONF setzen: 8 P Even 1S, TrCtrl
4098
       ExtAddr <= "1111111110011010";
4099
       ExtWr <= '1';
4100
       Data2Ext <= "1001011100000000";
4101
       ExtEna <= EXT_ACT;
4102
       icwait(2);
4103
       ExtEna <= not EXT_ACT;
4104
       icwait(2);
4105
 
4106
       -- MSGREG setzen
4107
       ExtAddr <= "1111111110011100";
4108
       ExtWr <= '1';
4109
       Data2Ext <= DATA_CONST8;
4110
       ExtEna <= EXT_ACT;
4111
       icwait(2);
4112
       ExtEna <= not EXT_ACT;
4113
       icwait(2);
4114
 
4115
       -- UARTCMD setzen: noERRI, noEI, ENAREC, NOEVENT
4116
       ExtAddr <= "1111111110011011";
4117
       ExtWr <= '1';
4118
       Data2Ext <= "0000000000100000";
4119
       ExtEna <= EXT_ACT;
4120
       icwait(2);
4121
       ExtEna <= not EXT_ACT;
4122
       icwait(2);
4123
 
4124
       -- UARTCMD setzen: noERRI, noEI, STRANS, NOEVENT
4125
       ExtAddr <= "1111111110011011";
4126
       ExtWr <= '1';
4127
       Data2Ext <= "0000000000011000";
4128
       ExtEna <= EXT_ACT;
4129
       icwait(2);
4130
       ExtEna <= not EXT_ACT;
4131
       icwait(2);
4132
 
4133
       RxD <= '0';                      -- Startbit
4134
       icwait(BITCLK);
4135
       RxD <= '1';                      -- Message (1)
4136
       icwait(BITCLK);
4137
       RxD <= '0';
4138
       icwait(BITCLK);
4139
       RxD <= '1';
4140
       icwait(BITCLK);
4141
       RxD <= '0';
4142
       icwait(BITCLK);
4143
       RxD <= '1';
4144
       icwait(BITCLK);
4145
       RxD <= '0';
4146
       icwait(BITCLK);
4147
       RxD <= '1';
4148
       icwait(BITCLK);
4149
       RxD <= '0';                      -- Message (8)
4150
       icwait(BITCLK);
4151
       RxD <= '0';                      -- Paritybit (Even)
4152
       icwait(BITCLK);
4153
       RxD <= '1';                      -- Stopbit
4154
 
4155
       icwait(2*BITCLK);
4156
 
4157
       -- Status lesen
4158
       ExtAddr <= "1111111110011000";
4159
       ExtWr <= '0';
4160
       ExtEna <= EXT_ACT;
4161
       icwait(2);
4162
       ExtEna <= not EXT_ACT;
4163
       icwait(2);
4164
 
4165
       -- MSGREG lesen
4166
       ExtAddr <= "1111111110011100";
4167
       ExtWr <= '0';
4168
       ExtEna <= EXT_ACT;
4169
       icwait(2);
4170
       ExtEna <= not EXT_ACT;
4171
       icwait(2);
4172
 
4173
       -- UARTCMD setzen: noERRI, noEI, DISABLEREC, NOEVENT
4174
       ExtAddr <= "1111111110011011";
4175
       ExtWr <= '1';
4176
       Data2Ext <= "0000000000101000";
4177
       ExtEna <= EXT_ACT;
4178
       icwait(2);
4179
       ExtEna <= not EXT_ACT;
4180
       icwait(2);
4181
 
4182
       RxD <= '1';
4183
       icwait(BITCLK/2);
4184
-------------------------------------------------------------------------------
4185
------------------------------------------------------------------------------- 
4186
 
4187
       assert false
4188
         report "Test finished!"
4189
         severity error;
4190
 
4191
     end process;
4192
 
4193
  end behaviour;
4194
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.