View Full Version : Vdip2
MARGARITA
- 26th January 2009, 03:33
Hi every body, recently i buy a vdip2 module because i have project in mind, read file names inside usb flash disk via harware serial port with pic micro, save names in ram and scroll these names in 16x1 lcd module with up and down switch and when user choice a file name with select swicth, then pic read and send the complete file in parallel fashion with strobe and busy signals and return to the above menu, for select other file, any ideas in wich pic micro is apropiate for that, i buy pic 18f4620 because 3968 bytes in ram or is to big for that? Starting code will be apreciate.
mackrackit
- 26th January 2009, 06:28
I have only played with the VDIP1, but I think they are pretty close.
Here is a good place to start with the VDIP
http://www.picbasic.co.uk/forum/showthread.php?t=7700
Not sure if the parallel idea will work or if it is necessary. All info in and out of the VDIPs goes through the on board control module. When reading date from a flash drive with the VDIP you can not stop it. It does not have a flow control that works that way. So I would suggest an echo routine using the PICs USART. Here is an example.
http://www.microengineeringlabs.com/resources/samples/pbp/usart.bas
You can use feed back from the VDIP to let the PIC know when it is finished sending data, see the first link. Send comands to the VDIP with SEROUT2 and recieve with the hardware port. Then send the data out from the PIC with the hardware port.
PIC selection... I do not think you can have to much ram. Sounds like you will need all you can get for the file name arrays. Most any of the 18s should do.
MARGARITA
- 28th January 2009, 02:02
thanks for fast reply mackrackit sorry but i dont explain well, when the pic read the file is read from vdip2 module serialy and then pic send in parallel to old machines o whatever output in parallel flashion though port, right now and playing with vdip module and rs232 hex comm tool and first y think i can use led 1 & 2 for detect an usb flash memory then use dir command and save all file names in pic ram memory scroll these names in lcd module with up and down switch, when user select a file to read with select switch send that name file to vdip module for read with OPR command and read that file in one byte in a time with RDF command send this byte in parallel fashion with one complete port from pic plus strobe & busy signal for compatibility with diff. old machinery and get back and read next data byte until encounter end of file.
mackrackit
- 28th January 2009, 06:18
think i can use led 1 & 2 for detect an usb flash memory
That should work. Just remember the voltage coming from the VDIP LED pin is 3 volt.
then use dir command and save all file names in pic ram memory scroll these names in lcd module with up and down switch, when user select a file to read with select switch send that name file to vdip module for read with OPR command
That should also work. The VDIP can only do 8 character file names, so 8 bit arrays is what you need. I am doing something similar here. I send from a PC the file name to the PIC, this is stored in and array. The array plus the file extension is sent to the VDIP.
I would think reading the file names from the VDIP should work just as well/
A couple of parts from my code. The input is in ASC|| so that is why the 16 bit string.
SERIN2 PORTB.5,24972,[WAIT("A"),STR NUMS\16] '7, Even
X1 = (NUMS[1]-"0")
X2 = (NUMS[3]-"0")
X3 = (NUMS[5]-"0")
X4 = (NUMS[7]-"0")
X5 = (NUMS[9]-"0")
X6 = (NUMS[11]-"0")
X7 = (NUMS[13]-"0")
X8 = (NUMS[15]-"0")
SEROUT2 VinRXD,8588,["OPR ",DEC X1,DEC X2,DEC X3,DEC X4,DEC X5,DEC X6,DEC X7,DEC X8,".DAT",13]
and read that file in one byte in a time with RDF command send this byte in parallel fashion with one complete port from pic plus strobe & busy signal for compatibility with diff. old machinery and get back and read next data byte until encounter end of file.
This is the part I am not sure about. If the VDIP firm ware is set for CTS/RTS and you control the CTS pin (low should be send) You should be able to receive the data you want and send through the PIC. I have not tried this, I have CTS held low as I am doing a "file dump" from the VDIP.
Let us know how it goes.
MARGARITA
- 30th January 2009, 04:30
for yours comments first at all sorry for my bad english, but I am from Mexico, Im using rs232 hex com tool for testing all commands i need for my project and everything work in the way is expecting, now my goal is design in basic, i am more asm girl but one think is a big trouble for my is banks memory switch and because basic compiler takes care about and i think the project is going to need all ram posibble from pic for file names array, i am reading and reading pic basic manual and i will divide the project in 4 or 5 parts and test each one until all of then work well and then assemble in only one, you think is a good idea?
mackrackit
- 30th January 2009, 04:40
Your English is fine, much better than my Spanish. :)
I think you are correct, the more ram the better.
I also agree on dividing the code into smaller projects for testing. That seems to be the trouble with some, they try to write the whole code at once an then wonder why it does not work. Much easier to debug smaller codes than larger ones.
Have you tried the CTS to control the data from the VDIP? IF so, how is it working?
MARGARITA
- 31st January 2009, 01:33
well regarding cts pin i mention my actual conexion from vdip to pc:
VDIP2 ADM202 DB9 FROM PC
PIN 14 PIN 11 TXD
PIN 16 PIN 12 RXD
PIN 17 PIN 10 RTS
PIN 18 PIN 9 CTS
PIN 13 PIN 3
PIN 14 PIN 2
PIN 7 PIN 8
PIN 8 PIN 7
And I mention before I am Using a RS232 comm tool software for test all commands i need from vdip and everythink works well...even for one byte of data file work ok. today i start playing with vdip module pic and lcd, so far is ok and when encounter a big problem I let you know for your invaluable help:)
I wish you have nice day.
MARGARITA
- 31st January 2009, 01:46
sorry Dave for pins conexion inf. but when i posted is show in a diff. way i write but in a global inf. is vdip txd pin to level translator to pc same for rxd cts and rts, for shure you know that, jejeje.
mackrackit
- 31st January 2009, 10:04
Yes, I would say everything from the VDIP to the PC needs to go through a level shifter. Data and flow control.
Powered by vBulletin® Version 4.1.7 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.