'---------------------------------------------------------------------------------------- ' Name: SER2_1PORT.TIG ' Type: TIGER-BASIC(tm) Source Code ' Purpose: Creating additional serial port with 2,400 baud on standard Tiger I/O pins ' ' (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 program demonstrates the use of additional serial I/O through device driver ' SER2_xx.TDD. The additional serial channel is established on ' ' L80 = TxD and L81 = RxD, running at 2400 Bd. ' ' Use the Plug & Play Lab, connect L80 <--> L81 and this programm will transmit a test ' string serially on L80, receive it on L81 and display any received data on the ' 4 x 20 text LCD. ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' variables must be declared #INCLUDE DEFINE_A.INC ' general definitions #INCLUDE UFUNC3.INC ' User-Function-Codes #DEFINE SER2_1 20 ' device number for additional serial port 1 TASK MAIN ' begin task MAIN BYTE EVER ' for endless loop STRING A$, REC$ ' for received data INSTALL_DEVICE #LCD, "LCD1.TDD" ' install LCD 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_80.TDD", 8, 0, 0, 3, 3,1, 0 ' L80=TxD, L81=RxD REC$ = "" ' reset receive string RUN_TASK SEND_DATA ' start task for sending data FOR EVER = 0 TO 0 STEP 0 ' endless loop GET #SER2_1, 1, A$ ' read character from port 1 IF A$ = CHR$(10) THEN ' if character is PRINT #LCD, "<1>"; REC$ ' print receive string on LCD REC$ = "" ' reset receive string ELSE REC$ = REC$ + A$ ' add char to receive string ENDIF NEXT ' end of endless loop END ' end of task MAIN '---------------------------------------------------------------------------------------- ' This task continously sends a string through the additional serial I/O port. '---------------------------------------------------------------------------------------- TASK SEND_DATA ' begin task SEND_DATA BYTE EVER ' for endless loop STRING P1$ ' for send string P1$ = "The quick brown fox jumps over the lazy dog" FOR EVER = 0 TO 0 STEP 0 ' endless loop PRINT #SER2_1, P1$; TICKS() ' output with PRINT to port 1 WAIT_DURATION 500 ' wait 500 ms NEXT ' end of endless loop END ' end of task SEND_DATA