UHF receiver to USB datalogger with BS2
Ferwerda
Posts: 3
Can anyone help me with advice or a sample code, which could point me in the right direction, since I'm a noob in basic stamp programming.
I have been trying to write data from the receiver to the datalogger.
The signal is digital and I have been able to show it on the Debug screen. (Sample rate was not correct though) The UHF connection is ASK modified with a NRZ line code and my tests were with a bit rate of 1000 baud.
I have been trying to write data from the receiver to the datalogger.
The signal is digital and I have been able to show it on the Debug screen. (Sample rate was not correct though) The UHF connection is ASK modified with a NRZ line code and my tests were with a bit rate of 1000 baud.
Comments
This is my for loop now (this writes 1 byte at a time, which is too slow. I now have to pause between every new byte in Matlab since an handshake is not possible with the UHF receiver)
FOR counter2 = 1 TO NumtotSamples
SERIN UHF, 16572, [result] 'Baudrate = 4800 no parity
DEBUG result ' Display Results
SEROUT TX/ CTS,Baud,[$08,$20,$00,$00,$00,$0D,CR,result,CR,CR]
GOSUB Write_Data ' Purge Receive Buffer
NEXT
Get_Data:
index = 0 ' Reset Index Pointer
DO ' Receive Data
SERIN RX\RTS, Baud, 100, Timeout, [ioByte]
buffer(index) = ioByte ' Add Received Byte To Buffer
index = index + 1 ' Increment Index Pointer
IF index > 14 THEN Timeout ' Check For Overflow
LOOP
Timeout:
RETURN