yup but for 500mSec. What about to try only that part without any timeout??? What about to add an optional end character???If I change to WAIT("A") the pic search to read the A ASCII not the A that I have set manual.
BTW, here's something to play with.
hope this helpCode:DEFINE LOADER_USED 1 ' Using Bootloader DEFINE OSC 20 ' Using 20MHZ crystal DEFINE HSER_RCSTA 90h ' Enable USART, continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH=1 DEFINE HSER_SPBRG 129 ' 9600 Bauds define HSER_CLOERR 1 ' Enable automatic alear overrun error StartByteChar VAR byte StringOfChar VAR Byte[10] Counter var byte RecycleBin var byte CLEAR ' set all variables to 0 AskUser: hserout["Enter start byte character",13,10] ' HSERIN [StartByteChar] ' wait user choice Start: Hserout["Waiting for start=",startbytechar,_ " And 10 character string..........",13,10] hserin[WAIT(Startbytechar),STR stringofchar\10] ' wait Start character ' and store 10 next ' character in StringOfChar for counter=0 to 9 ' hserout[stringofchar[counter]] ' Display results next ' While PIR1.5 ' Check RCIF => input buffer full?? recyclebin=RCREG ' flush all results in a don't care variable wend ' RCSTA=0 ' simple way to clear all RCSTA=$90 ' possible errors pause 100 ' USART initialisation delay... value come from nowhere hserout[13,10,rep "*"\50,13,10] ' just to make it cute on screen goto askuser




Bookmarks