Normally a bit of error checking is needed. the simplest is to send a dummy character before the value you want to receive.
Below sample waits for 9. when 9 is received the next charater is stored in myVar.
Sometimes folks have better luck "training" the receiver. In theory this balances the receiving capacitor. Below is the send code.Code:SERIN PORTC.4,T2400,[9],myVar
Code:TRAIN VAR BYTE TRAIN=$55 SEROUT PORTC.4,T2400,[TRAIN,TRAIN,TRAIN,TRAIN,TRAIN,9,3]





Bookmarks