
Originally Posted by
MARGARITA
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.
Code:
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.
Bookmarks