'---------------------------------------------------------------------------------------- ' Name: SER2_DEMO.TIG ' Type: TIGER-BASIC(tm) Source Code ' Purpose: Creating 2 additional serial ports with different baudrates 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. Two additional serial channels are established on ' ' L80 = TxD and L81 = RxD, sending and receiving at 2400 baud ' L84 = TxD and L85 = RxD, only sending at 1200 baud ' ' The program sends out characters on pin L80 with 2400 baud and on pin L84 with ' 1200 baud, and reads in characters on pin L81 with 2400 baud. If you want to ' communicate with e.g. a personal computer's RS232 ports, you will have to place ' a RS232 driver chip like a MAX232 between the Tiger and the PC: ' ' Tiger PC ' !------! ' ! ! ' L80 (TxD) ---> ! ! ---> COM1 (RxD) ' ! ! ' L81 (RxD) <--- ! ! <--- COM1 (TxD) ' ! ! ' L84 (TxD) ---> ! ! ---> COM2 (RxD) ' ! ! ' !------! ' MAX232 ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' variables must be declared #INCLUDE DEFINE_A.INC ' general definitions #INCLUDE UFUNC3.INC ' User-Function-Codes TASK MAIN ' begin task MAIN BYTE EVER ' for endless loop STRING A$ ' for received data INSTALL DEVICE #LCD, "LCD1.TDD" ' install LCD driver INSTALL_DEVICE #TA, "TIMERA.TDD",2,87 ' time base is 7183 Hz for max. 2400 baud INSTALL_DEVICE #31,"SER2_80.TDD", & ' first soft-serial port 2400 baud 8, & ' data bits 0, & ' parity 0=no 0, & ' invert 0=true, 1=inverse 3, & ' Tx Prescaler (transmit with 2400 baud) 3, & ' Rx Oversample (receive with 2400 baud) 1, & ' reserved, always 1 0 ' Handshake, 0=no INSTALL_DEVICE #32,"SER2_84.TDD", & ' second soft-serial port 1200 baud 8, & ' data bits 0, & ' parity 0=no 0, & ' invert 0=true, 1=inverse 6, & ' Tx Prescaler (transmit with 1200 baud) 0, & ' Rx Oversample (no receive) 1, & ' reserved, always 1 0 ' Handshake, 0=no FOR EVER = 0 TO 0 STEP 0 ' endless loop PRINT #31, "1st port at";TICKS() ' output on first soft-serial port PRINT #32, "At";TICKS();" 2nd port" ' output on second soft-serial port GET #31, 0, A$ ' read in received characters from first port PRINT #LCD, A$; ' print on LCD WAIT_DURATION 250 ' wait 250 ms NEXT ' end of endless loop END ' end of task MAIN