'Memorystick Logger Pinouts ' Pin 1 - GND ' Pin 2 - RTS to propeller CTS ' Pin 3 - Power - 5V ' Pin 4 - RX to propeller TX ' Pin 5 - TX to propeller RX ' Pin 6 - CTS to propeller RTS ' Pin 7 - NC ' Pin 8 - NC CON CR = 13 _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 OBJ SerialCom :"FullDuplexSerial" USB :"FullDuplexSerial" VAR byte RTS byte CTS byte TX byte RX long inbyte,sekval,size byte sek4,sek3,sek2,sek1 byte siz4,siz3,siz2,siz1 Pub Main Pause (1500) USB.start(3,2,0,9600) SerialCom.start(31,30,0,9600) CRLF SerialCom.str(String("Connection Established")) CRLF Start(0,1,2,3) outa[RTS]:= 0 'wakes up logger 'pause (2000) Big_E_Sync small_e_sync pause (1000) CRLF outa[RTS]:= 1 pause (200) outa[RTS]:= 0 Prompt PUB Prompt repeat inbyte:= SerialCom.rx USB.tx(inbyte) if inbyte == $0D CRLF waituntil PUB waituntil repeat inbyte := USB.rxtime(500) if inbyte == CR CRLF SerialCom.tx(inbyte) until inbyte == -1 'USB.tx($0D) PUB Big_E_Sync repeat USB.str(string("E")) USB.tx($0D) inByte := USB.rxtime(2000) if inByte == CR CRLF SerialCom.tx(inbyte) until inbyte == $45 'E PUB small_e_Sync repeat USB.str(string("e")) USB.tx($0D) inByte := USB.rxtime(2000) if inByte == CR CRLF SerialCom.tx(inbyte) until inbyte == $65 PUB Start(MCU_RTS_TO_cts,MCU_CTS_TO_rts,MCU_TX_TO_rx,MCU_RX_TO_tx) RTS:= MCU_RTS_TO_cts CTS:= MCU_CTS_TO_rts TX := MCU_TX_TO_rx RX := MCU_RX_TO_tx Init_Pins PUB Init_Pins dira[TX]~~ 'sets TX to output dira[RX]~ 'sets RX to input dira[RTS]~~ 'sets RTS to output dira[CTS]~ 'sets CTS to input PUB CRLF SerialCom.tx(10) SerialCom.tx(13) PRI Pause (delayMS) waitcnt(clkfreq / 1000 * delayMS + cnt)