Is this asynchronous data? You need to know the baud rate in that case. If it is synchronous data, you could look at the SHIFTIN command. You need a clock line and data line for this to work.