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

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [core/] [9x8/] [peripherals/] [tb/] [UART_Rx/] [tb_UART_Rx.s-normal] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 sinclairrf
; Copyright 2013, Sinclair R.F., Inc.
2
;
3
; Test bench for UART_Rx peripheral.
4
 
5
.main
6
 
7
  ; Wait for receive data to appear and send it out when it does appear.  Stop
8
  ; this process when a null character is received or when too many clock cycles
9
  ; have elapsed (each iteration without decrementing the MSB and without UART
10
  ; data is 11 clock cycles long, so the time-out is 13*0x2800=133120 clock
11
  ; cycles, i.e., 1331 usec with a 100 MHz clock.  The UART message
12
  ; "Hello World!\r\n\00" is 14 bytes long and takes 14*10/115200 = 1215 usec
13
  ; to transmit.  The 0x2800 count will terminate before the the baud-mismatch
14
  ; will be cleared.
15
 
16
  0x00 0x28 >r :loop
17
    .jumpc(no_major_dec,1-) r> 1- >r :no_major_dec r@ -1= .jumpc(end_loop)
18
    .inport(I_UART_RX_EMPTY) .jumpc(loop)
19
    .inport(I_UART_RX) O_DATA outport
20
    .jumpc(loop)
21
  :end_loop r> drop drop
22
 
23
  ; Signal program termination.
24
  1 .outport(O_DONE)
25
 
26
  ; Wait forever.
27
  :infinite .jump(infinite)

powered by: WebSVN 2.1.0

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