'---------------------------------------------------------------------------------------- ' Name: SER2_1PORT_L95_L92.TIG ' Type: TIGER-BASIC(tm) Source Code ' ' Purpose: Demonstration for soft-serial port on Tiger port 9 in combination with ' the two standard serial ports (surpressing hardware handshake on Ser0). ' ' (C) - Copyright Wilke Technology, P.O.Box 1727, D-52018 Aachen, Germany '---------------------------------------------------------------------------------------- ' ' Thank you for using BASIC Tigers in your products. If you have questions, ideas ' or special needs, please contact your next distributor or the Tiger support team ' and visit our web site: ' ' Wilke Technology GmbH ' The Tiger Support Team ' P.O.Box 1727, D-52018 Aachen, Germany ' Krefelder Str. 147, D-52070 Aachen, Germany ' ' email: support@wilke-technology.com (english) ' email: support@wilke.de (german) ' Phone: +49 (241) 918 900 Mo to Fr, 7:00 to 16:00 (GMT) ' Fax: +49 (241) 918 9068 ' ' New information, new drivers and free downloads see: ' ' www.wilke-technology.com (english) ' www.wilke.de (german) ' ' Sincerely, ' ' Your Tiger Support Team ' ' '---------------------------------------------------------------------------------------- ' ' This prog demonstrates the use of additional serial I/O through ' device driver SER2_xx.TDD. The additional serial channel is ' established on ' ' L95 = TxD and L92 = RxD, running at 2400 Bd. ' ' This driver can be used parallel to the SER1B driver (which is ' installed but not used in this example), you just have to disable ' the hardshake lines CTS0 and RTS0 on installation of the SER1B ' driver. This way you can create 3 serial 2-wire ports on Tiger ' port 9, leaving all other ports available for other tasks. ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' must declare vars! #INCLUDE DEFINE_A.INC ' general definitionen #INCLUDE UFUNC3.INC ' User-Function-Codes #DEFINE SER2_1 50 ' Device number for port 1 TASK MAIN BYTE I WORD FI STRING A$, REC$ INSTALL_DEVICE #LCD, "LCD1.TDD" INSTALL_DEVICE #SER, "SER1B_K1.TD2",& ' install serial driver BD_38_400, DP_8N, YES, & ' setting SER0 BD_38_400, DP_8N, YES, & ' setting SER1 0AAH, 00110011B ' <== new parameters (P7a + P7b) --> RTS0 & CTS0 not used by driver INSTALL_DEVICE #TA, "TIMERA.TDD",2,87 ' 2400 Bd * 3(oversample) = 7200, here: 7183 Hz ' data,par,inv,TxPre,RxOvs,-,handsh INSTALL_DEVICE #SER2_1, "SER2_9592_K1.TDD", 8, 0, 0, 3, 3,1, 0 ' L95=TxD, L92=RxD REC$ = "" ' reset receive string A$ = "" ' reset input string FI = 0 ' reset input buffer filling RUN_TASK SEND_DATA ' start task for sending data FOR I = 0 TO 0 STEP 0 ' endless loop GET #SER2_1, #0, #UFCI_IBU_FILL, 2, FI ' get input buffer filling IF FI > 0 THEN ' if s.th. in input buffer GET #SER2_1, 1, A$ ' read character from port IF A$ = CHR$(10) THEN ' if charcater is LF PRINT #LCD, "<1>"; REC$ ' print receive string on LCD REC$ = "" ' reset receive string ELSE REC$ = REC$ + A$ ' add char to receive string ENDIF ENDIF NEXT END ' end of program '---------------------------------------------------------------------------------------- ' This task continously sends a string through the additional serial I/O port. '---------------------------------------------------------------------------------------- TASK SEND_DATA BYTE X STRING P1$ P1$ = "The quick brown fox jumps over the lazy dog" FOR X = 0 TO 0 STEP 0 PRINT #SER2_1, P1$; TICKS() ' output on soft-serial port WAIT_DURATION 500 NEXT END