
Originally Posted by
ADLIN SYSTEMS
I have just purchased the vdrive 2 aS WELL. here are some questions. What commands do you give to innitialise the system. How do you usse the thumb drive. Any help would be appreciated.
I started writing the serial mode routines below, but wasn't able to get them working before I got pulled off to another project. I think they are close to working. Try the default 9600 baud rate first.
There are 2 command sets that the Vdrive2 "understands" short and extended command sets. I think they both work in a similar fashion, but I opted for the extended version, not knowing any better. For more info, download the Vinculum firmware users manual.
The object below was to just get the Vdrive2 responding to the basic IDD command. Be sure there is a thumb drive plugged in. Once that happens you'll know the wiring and basic command structure is working and you're home free.
There is some description of which thumb drives the device "likes" on the Pa*allax website. They have a similar bare-board product using the same Vinculum chip.
I was using the the IDE serial communicator for viewing the response from the Vdrive2.
RTS is an output. CTS is an input.
You can probably leave RTS float until you start rapid data transmissions and have a need for handshaking. I saw on the web someplace you can generally ground CTS.
Be advised, you may have to use the "real" uarts (HRSIN & HRSOUT) as I did, as opposed to the bit-banging method (SERIN & SEROUT) because you may otherwise "miss" the response from the Vdrive2 using the bit-banging method.
Be sure to get the response before sending new data.
Let us know how you get on.
Code:
'
'******************************************************************************
'
' Vdrive2 routines, extended command set (ECS)
'
'******************************************************************************
'
'OpenFileForWriting:
'
' HRSOut "OPW ",filename,13
' Return
'
'OpenFileForReading:
'
' HRSOut "OPR ",filename,13
' Return
'
'Closefile:
'
' HRSOut "CLF ",filename,13
' Return
'
'wrtfile:
' hrsout "WRF ",$00,$00,$00,$17,$0D,,13,13
' Return
'
IDD_Mode:
HRSOut "IDD",13
GoSub GetVdrive2Prompt
Return
'
FS_Mode:
HRSOut "FS",13
GoSub GetVdrive2Prompt
Return
'
ECS_Mode:
HRSOut "ECS",13
GoSub GetVdrive2Prompt
Return
'
GetVdrive2FwVers:
HRSOut "FWV",13
GoSub GetVdrive2Prompt
Return
'
SynchronizeVdrive2:
HRSOut "E",13
GoSub GetVdrive2Prompt
HRSOut "e",13
GoSub GetVdrive2Prompt
Return
'
GetVdrive2Prompt:
prompt = HRSin, {100, BailVdrivePrompt}
HRSOut2 "prompt = ", ISHEX prompt, 13
GoTo GetVdrive2Prompt
Return
'
BailVdrivePrompt:
'
Vdrive2_error:
HRSOut2 "Vdrive2 Buffer empty ", 13, 13
DelayMS 1000
Return
'
'******************************************************************************
'
' Main Loop
'
'******************************************************************************
'
Main_Loop:
GoSub IDD_Mode
DelayMS 1000
GoTo Main_Loop'
End ' Done.