VDIP issue with BASIC Stamp
JokerBot
Posts: 1
I am currently communicating with the VDIP via the Basic stamp in the following UART configuration with the jumpers (J3, J4) set to high (UART):
Pin1 (5V) - 5V
Pin6 (TXD)- P1
Pin7 (GND)- GND
Pin8 (RXD) - P0
Pin10 (#CTS) - GND
The program reads the file information of the text file on the thumb drive, parses it to only retrieve file size, and pending on that file size, creates a loop to output the contents of the file. It succesfully worked, however, after I accidentally added a resistor to the TXD pin into P1 (1K Resistor), it no longer outputs and in fact, deletes the contents of the file. Could the resistor have fried some of the transistors of the VDIP or has my code changed sporadically via a spector (as i have not changed it and the output is different). Any help would be appreciated. The code is below:
' {$STAMP BS2px}
loopMaxValue VAR Byte
fileSize VAR Byte
byteSize VAR Byte
byteSize = 22
serStr VAR Byte (22)
t VAR Byte
t = 1
'*******************[noparse][[/noparse]INITIALIZE]******************
SEROUT 0,396,[noparse][[/noparse]"ipa",CR]
PAUSE 200
SEROUT 0,396,[noparse][[/noparse]"scs",CR]
PAUSE 200
'*************************************************
readIn:
SEROUT 0,396,[noparse][[/noparse]$01, $20, "1.txt", $0D]
SERIN 1, 396,[noparse][[/noparse]SKIP 8,HEX fileSize]
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
IF ((fileSize//byteSize) > 0) THEN actualplusone
IF ((fileSize//byteSize) = 0) THEN actualpluszero
PAUSE 5000
END
actualplusone:
loopMaxValue = (fileSize/byteSize) + 01
GOSUB outputLoop
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
DEBUG "end"
END
actualpluszero:
loopMaxValue = fileSize/byteSize
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
GOSUB outputLoop
DEBUG "end"
END
outputLoop:
FOR t = 1 TO loopMaxValue
SEROUT 0,396,[noparse][[/noparse]$04, $20, "1.txt", $0D]
SERIN 1, 396,[noparse][[/noparse]SKIP (t-01)*21, STR serStr\byteSize-01\"*"]
DEBUG STR serStr
PAUSE 500
NEXT
RETURN
Pin1 (5V) - 5V
Pin6 (TXD)- P1
Pin7 (GND)- GND
Pin8 (RXD) - P0
Pin10 (#CTS) - GND
The program reads the file information of the text file on the thumb drive, parses it to only retrieve file size, and pending on that file size, creates a loop to output the contents of the file. It succesfully worked, however, after I accidentally added a resistor to the TXD pin into P1 (1K Resistor), it no longer outputs and in fact, deletes the contents of the file. Could the resistor have fried some of the transistors of the VDIP or has my code changed sporadically via a spector (as i have not changed it and the output is different). Any help would be appreciated. The code is below:
' {$STAMP BS2px}
loopMaxValue VAR Byte
fileSize VAR Byte
byteSize VAR Byte
byteSize = 22
serStr VAR Byte (22)
t VAR Byte
t = 1
'*******************[noparse][[/noparse]INITIALIZE]******************
SEROUT 0,396,[noparse][[/noparse]"ipa",CR]
PAUSE 200
SEROUT 0,396,[noparse][[/noparse]"scs",CR]
PAUSE 200
'*************************************************
readIn:
SEROUT 0,396,[noparse][[/noparse]$01, $20, "1.txt", $0D]
SERIN 1, 396,[noparse][[/noparse]SKIP 8,HEX fileSize]
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
IF ((fileSize//byteSize) > 0) THEN actualplusone
IF ((fileSize//byteSize) = 0) THEN actualpluszero
PAUSE 5000
END
actualplusone:
loopMaxValue = (fileSize/byteSize) + 01
GOSUB outputLoop
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
DEBUG "end"
END
actualpluszero:
loopMaxValue = fileSize/byteSize
SEROUT 0,396, [noparse][[/noparse]$0A, $20, "1.txt", $0D]
GOSUB outputLoop
DEBUG "end"
END
outputLoop:
FOR t = 1 TO loopMaxValue
SEROUT 0,396,[noparse][[/noparse]$04, $20, "1.txt", $0D]
SERIN 1, 396,[noparse][[/noparse]SKIP (t-01)*21, STR serStr\byteSize-01\"*"]
DEBUG STR serStr
PAUSE 500
NEXT
RETURN
Comments
SEROUT 0,396,[noparse][[/noparse]$01, $20, "1.txt", $0D]
SERIN 1, 396,[noparse][[/noparse]SKIP 8,HEX fileSize]
DEBUG·DEC filesize
END
Jeff T.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support