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