1 BORDER 0: PAPER 0: INK 7: BRIGHT 1: CLS 2 PRINT "sending abc 1200bps to IR" 5 REM ** port addr ** 10 LET port=131 15 LET THR=port+0 20 LET RHR=port+0 25 LET DLL=port+0 30 LET IER=port+4 35 LET DLM=port+4 40 LET FCR=port+8 45 LET ISR=port+8 50 LET LCR=port+12 55 LET MCR=port+16 60 LET LSR=port+20 65 LET XFR=port+20 70 LET MSR=port+24 75 LET SPR=port+28 80 LET EFR=port+8 85 LET XON1=port+16 90 LET XOFF1=port+24 100 REM ** LCR value ** 101 REM b7 divisor latch 102 REM b6 set break 103 REM b5 set parity 104 REM b4 even parity 105 REM b3 parity enable 106 REM b2 stop bits 2 107 REM b1 word length 8b 108 REM b0 word length 110 LET LCRVAL=BIN 00000111 120 REM 1200bps 384=256+128 121 REM 9600bps L=48 M=0 122 REM 19200bps L=24 M=0 123 REM 57600bps L=8 M=0 124 REM 115200bps L=4 M=0 125 LET DLLVAL = 128 130 LET DLMVAL = 1 150 REM select UART [0,2] 155 OUT SPR,2 200 REM ** baudrate ** 205 OUT LCR,128 210 OUT DLL,DLLVAL 215 OUT DLM,DLMVAL 250 REM FIFO polled mode enab. 255 REM inter. & DMA disable 260 OUT FCR,BIN 00000001 300 REM access to EFR 0xBF 305 OUT LCR,191 350 REM enab. MCR bits XonXoff 355 OUT EFR,BIN 00011010 360 OUT XON1,17 365 OUT XOFF1,19 400 REM general reg. set. 405 OUT LCR,LCRVAL 450 REM enable IR + OUT2 455 OUT MCR,BIN 01001000 460 REM half duplex 465 OUT XFR,BIN 00010001 500 REM no interrupts 505 OUT IER,0 600 REM ** transmit ** 605 LET R=INT(RND*3) 610 OUT THR,(R+CODE "a") 611 OUT THR,(R+CODE "b") 612 OUT THR,(R+CODE "c") 613 OUT THR,(R+CODE "d") 614 OUT THR,(R+CODE "e") 620 OUT THR,13 621 OUT THR,10 630 BEEP .001,20: PAUSE 2 635 GO TO 600