' ========================================================================= ' ' File....... Formatted_Serial.BS2 ' Purpose.... ' Author..... Jon Williams -- Parallax, Inc. ' E-mail..... jwilliams@parallax.com ' Started.... ' Updated.... 02 SEP 2005 ' ' {$STAMP BS2} ' {$PBASIC 2.5} ' ' ========================================================================= ' -----[ Program Description ]--------------------------------------------- ' -----[ Revision History ]------------------------------------------------ ' -----[ I/O Definitions ]------------------------------------------------- Sio CON 16 ' serial input ' -----[ Constants ]------------------------------------------------------- #SELECT $STAMP #CASE BS2, BS2E, BS2PE T1200 CON 813 T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 TMidi CON 12 T38K4 CON 6 #CASE BS2SX, BS2P T1200 CON 2063 T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 TMidi CON 60 T38K4 CON 45 #CASE BS2PX T1200 CON 3313 T2400 CON 1646 T4800 CON 813 T9600 CON 396 T19K2 CON 188 TMidi CON 108 T38K4 CON 84 #ENDSELECT SevenBit CON $2000 Inverted CON $4000 Open CON $8000 Baud CON T19K2 + Inverted ' -----[ Variables ]------------------------------------------------------- value VAR Byte(3) idx VAR Nib ' -----[ EEPROM Data ]----------------------------------------------------- ' -----[ Initialization ]-------------------------------------------------- Reset: ' -----[ Program Code ]---------------------------------------------------- Main: SERIN Sio, Baud, [WAIT("!"), BIN value(0), BIN value(1), BIN value(2)] SEROUT Sio, Baud, [CLS] FOR idx = 0 TO 2 SEROUT Sio, Baud, [BIN8 value(idx), CR] NEXT END ' -----[ Subroutines ]-----------------------------------------------------