anyone using VDive2 by Viniculum?
sdy
Posts: 40
I just got one, but can't get anything out of it. But once when I put in my USB memory stick, it blinked green, like when you plug it in a PC.
I have it configed for UART mode.
Here's my code: ( It just waits at "Rcving from VDRIVE" )
' {$STAMP BS2p}
' {$PBASIC 2.5}
ToVdrive CON 13 ' VDRIVE RxD pin 4 on P13
FromVdrive CON 14 ' VDRIVE TxD pin 5 on P14
Rts CON 11 ' VDRIVE RTS pin 2 on P11
Cts CON 15 ' VDRIVE CTS pin 6 on P15
Vbaud CON 16624
Value VAR Byte ' Data from VDRIVE
DO
'WRITE TO VDRIVE:
' send command:
SEROUT ToVdrive \Cts,Vbaud,[noparse][[/noparse]"DIR",CR]
'READ FROM VDRIVE:
DEBUG "Rcving from VDRIVE:",CR
' read data:
SERIN FromVdrive \Rts, Vbaud, [noparse][[/noparse]Value]
DEBUG "Data from VDRIVE = ", Value ,CR
LOOP
I have it configed for UART mode.
Here's my code: ( It just waits at "Rcving from VDRIVE" )
' {$STAMP BS2p}
' {$PBASIC 2.5}
ToVdrive CON 13 ' VDRIVE RxD pin 4 on P13
FromVdrive CON 14 ' VDRIVE TxD pin 5 on P14
Rts CON 11 ' VDRIVE RTS pin 2 on P11
Cts CON 15 ' VDRIVE CTS pin 6 on P15
Vbaud CON 16624
Value VAR Byte ' Data from VDRIVE
DO
'WRITE TO VDRIVE:
' send command:
SEROUT ToVdrive \Cts,Vbaud,[noparse][[/noparse]"DIR",CR]
'READ FROM VDRIVE:
DEBUG "Rcving from VDRIVE:",CR
' read data:
SERIN FromVdrive \Rts, Vbaud, [noparse][[/noparse]Value]
DEBUG "Data from VDRIVE = ", Value ,CR
LOOP
Comments
If you have the TTL-232-V3V USB to ttl serial cable I have a Visual Basic program that evaluates the Vdrive allowing you to become familiar before connecting it to a Stamp.
Jeff T.
' {$STAMP BS2p}
' {$PBASIC 2.5}
' VDRIVE CTS pin 6 to Vcc
ToVdrive CON 13 ' VDRIVE RxD pin 4 on P13
FromVdrive CON 14 ' VDRIVE TxD pin 5 on P14
' VDRIVE RTS pin 2 not connected
' pin 3 to Vcc
' pin 1 TO gnd
Vbaud CON 240
Value VAR Byte ' Data from VDRIVE
'WRITE TO VDRIVE:
' send command:
SEROUT 13 ,Vbaud,[noparse][[/noparse]"IPA",$0D]
SEROUT 13 ,Vbaud,[noparse][[/noparse]"SCS",$0D]
SEROUT 13 ,Vbaud,[noparse][[/noparse]CR]
DO
'READ FROM VDRIVE:
DEBUG "Rcving from VDRIVE:",CR
' read data:
SERIN 14 , Vbaud, [noparse][[/noparse]Value]
DEBUG "Data from VDRIVE = ", Value ,CR
LOOP
Jeff T.
Re-read your code....CTS should be connected to VSS, the code I supplied also has different tx/rx pin assignments. Post Edited (Unsoundcode) : 3/12/2007 12:45:23 AM GMT
About the LEDs: When I powerup Vdrive, blinks red/green/red/green, then goes out. Never goes on agian. When I insert USB memory stick, nothing, (tried two). Only once did the drivre and USB stick blink like it was being mounted. What does your's do?
I have a switch in line with the positive to pin 3, some commands if sent badly will·cause the drive to lock up, and I found it convenient to be able to have a switch to do a reset.
Jeff T.
Man I owe you!!! Whats your background? I'm just an old hobbiest programmer. Every new language interests me.
I too am a (old)hobbyist who knows little about everything but its fun.
Glad your up and running, I am sure you will want to explore and discover the Vdrive Stamp combination in your own time but if you·need help with any of the functions PM me.
Jeff T.
here's the turn on message (takes a number of seconds to check for update)
Ver 02.08VDAPF On-Line:
Device Detected P2
No Upgrade
\>
And yes I agree the document has SPI/UART reversed.
DIR works
OPW seemed to work, though
when I tried to WRF 000A
and entered some data, the LED started flashing and it looks like it was kind of unhappy, seemed to be hung up
At some point I really want to get the SPI version going, though its easier to debug in the long command serial state
also you get a message when you remove a device--
Device Removed P2
No Disk
and when reinserted--
Device Detected P2
No Upgrade
\>
If you have a 232 converter you might find this VB app useful for debugging, I never finished programming it so it has flaws but its complete enough to be useful. It allows entry in short or extended command
Jeff T.
thanks for that, were you able to get read or write working?
I was able to look at directories, and open a file for reading, but RDF seemed to ignor the length field and it dumped the whole file each time
As for WRF, I never was able to get it to write. I could OPW, but the WRF would turn the write indicator on on the USB drive, but not write anything out, and basically hang (had to reset by powering off)
just got a clue though, looks like FS returns a number in hex, but its not an ASCII #, seems like is a binary field
I can't type that in thru my terminal emulator, so have to switch back to the MPU
Post Edited (originator) : 3/18/2007 4:46:28 AM GMT
Try reading first, create a Notepad file on the thumbdrive from your PC with a short string as the text (Hello World comes to mind) and save it as test.txt then rename it to test. Then put it in the Vdrive and read it.
rd_file:
SEROUT tx,baud,[noparse][[/noparse]$4,$20,"test",$0D]
SERIN rx,baud,200,bad_data,[noparse][[/noparse]STR string\15\">"]
DEBUG· STR string
RETURN
I used the timeout to bad_data if I did not get the prompt back, the string needs to be less than 15 characters. I expanded the above example to contain user data (firstname lastname logtime) displayed on the swipe of a RFID tag #.
When I logged and wrote data I jumped out of a loop at each sample to the subroutine.The character size would alter so I had to place two variables in the write string. The first (c) is the character length of the data (for example datavalue 220·then c would=3 characters) and the second (b) is the actual data.
SEROUT tx,baud,[noparse][[/noparse]$8,$20,0,0,0,DEC c,$0D,DEC b,$0D]
SERIN rx,baud,1000,bad_data,[noparse][[/noparse]WAIT (">")]
RETURN
The write file was opened before the write and wasn't closed until logging had ended. The data from the above example was charted on an Excel Workbook.
hope it helps
Jeff T.