USB to USB flash Drive File Copier - Page 4


Closed Thread
Page 4 of 6 FirstFirst 123456 LastLast
Results 121 to 160 of 223
  1. #121
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    What if you populate the array with a character that would probably not be used in a file name, (~), and parse the array for that before the array is used again.

    Or, have a "working" array. This would be one that stored arrays are parsed into for using.

    Stored array with (~) character
    Stored array re-written into sandbox array
    Sandbox array is sent to VDIP
    Start over with next stored array.

    Maybe....
    are saying its like this:
    say you have an array named FILE1 with 12 array places, i will pre-load it with (~) so...
    FILE1 = [~][~][~][~][~][~][~][~][~][~][~][~]

    and then when i receive a file named "vdip.txt" from the vdip serially, then the array would be like:
    FILE1 = [v][d][i][p][.][t][x][t][~][~][~][~]
    am i right with this? please correct me if im wrong...

    then when i want to send command to the vdip that i want to copy that particular file, i will be sending the "CPS" command plus the array of bytes stored in FILE1 including the bytes that contains [~] back to the vdip, but the vinculum is very strict with the spelling...if i include these bytes it will respond with "command failed" if only i could remove those unneeded bytes before sending it back to the vdip...

    am i getting your idea right?

  2. #122
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Thinking more about this the "~" will not do you any good. Still need to re-write the array but...

    Assume file names should only contain letters and numbers. The problem is other characters are showing up..
    So when the file name is read from the VDIP say it is saved into "arrayF". Before "arrayF" is used again it needs checked for bad characters. Right?

    Again have a working array that will be used and/or reused to send back to the VDIP, "arrayW".

    The bad characters are at the end of the name?
    What if you check each bit of "arrayF" and IF the bit equals A-Z or 0-9 then that bit will be written to "arrayW". When the first bad character bit is found the re-write loop stops.
    Now "arrayW" should only contain valid characters.

    This thread should give you some ideas on how to process the arrays.
    http://www.picbasic.co.uk/forum/showthread.php?t=8876

    I hope this is on the correct track.
    Dave
    Always wear safety glasses while programming.

  3. #123
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    this is so unfortunate..my vdip2 is suddenly not working...

    the status LEDs do not light when i turn the circuit on.. it also does not respond when i insert flash drives...

    i tried connecting it to the pc's serial port to see if the LEDs are just busted, but nothing happend. its as if there's nothing connected to the serial port.

    i've measured the voltage supplied and i saw that the voltage was correct.

    did anyone experience this? can there still be a remedy for this module?

  4. #124
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    On the VDIP1 there is an active low reset pin. Can not remember the exact pin but I think it is 22. Double check for the VDIP2 and give that a try.
    Dave
    Always wear safety glasses while programming.

  5. #125
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    ive been connecting that pin(rs#) to the ground using a push button. still nothing happend...no lights from the LEDs.

  6. #126
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by newbie View Post
    ive been connecting that pin(rs#) to the ground using a push button. still nothing happend...no lights from the LEDs.
    And it gets to high state by . . . a Pullup ? WPU ? Fear ? Which is to ask, can it get there ? Or is it locked to reset in perpetuity ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #127
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    And it gets to high state by . . . a Pullup ? WPU ? Fear ? Which is to ask, can it get there ? Or is it locked to reset in perpetuity ?
    are you suggesting to try pullup instead of pull down? done that...didn't work..

  8. #128
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by newbie View Post
    are you suggesting to try pullup instead of pull down? done that...didn't work..
    If I understood you correctly, and I am not sure I did, your push button switches ground the ports. If that is true, then yes, a pull up resistor, either internal (wpu) or external would seem to be in order. If your push buttons make the ports go high, then a pull down resistor would be required.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  9. #129
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The VDIP2 might be different but on the VDIP1 the reset pin is left floating when not in use. Seems strange yes but....

    Sounds like a bad conection or the magic smoke got out.
    Dave
    Always wear safety glasses while programming.

  10. #130
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    i tried what joe said and used a pull up resistor,. still nothing happend.. that made me hopeless about my module and began thinking that mackrackit was right..may be magic smoke did got out. so i ordered another vdip2 module and its on its way here..

    for the mean time, i'm in the middle of programming the push buttons for browsing the files. how do i program the buttons to execute the command only after releasing the button from being pressed. the reason i want it that way is because if i execute the command(e.g. scrolling the lcd with the file names) while the button is being pressed,some files names would be skipped due to very quick execution.

  11. #131
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    If the button pin is pulled LOW in an idle state ,active HIGH. You could use WHILE/WEND.
    Code:
    WHILE
    BUTTON  = 1
    DO SOMETHING
    WEND
    Dave
    Always wear safety glasses while programming.

  12. #132
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    sir, in my program which is similar to the code back in post #63,
    the LCD prints:

    Ver 03.66-123VDFCF On-Line:

    then clears the display and then finally displays the filename that i wanted to display. I saved the characters sent by the vdip2 into an array right after the "DIR" command so the "Ver 03.66-123VDFCF On-Line:" should not be included in those characters because they were sent at the time the vdip2 turned on and long before the "DIR" command was made..but how come they are still being displayed?

    how do i effectively display only the characters that are the response to the current command and not display the characters that were sent by the vdip2 long before the command was made?

  13. #133
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    That is interesting. Please post your current code so we are sure to be talking about the same thing.

    Just a thought...
    You might try more than one array and or clear the the array at given points. It should over write it but...

    Need to see the code...

    Dave
    Dave
    Always wear safety glasses while programming.

  14. #134
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    Code:
    INCLUDE "modedefs.bas"
    
    DEFINE LCD_DREG     PORTC
    DEFINE LCD_DBIT     0
    DEFINE LCD_RSREG    PORTD
    DEFINE LCD_RSBIT    2
    DEFINE LCD_EREG     PORTD
    DEFINE LCD_EBIT     1
    DEFINE LCD_RWREG    PORTD
    DEFINE LCD_RWBIT    0
    DEFINE LCD_BITS     8
    DEFINE LCD_LINES    4
    Define LCD_CHARS    20
    DEFINE LCD_COMMANDUS    2000
    DEFINE LCD_DATAUS   50
    
    VinTXD VAR PORTD.4 'AD0
    VinRXD VAR PORTD.3 'AD1
    FlowIn VAR PORTD.5 'AD2
    
    Pause 500  
    
    FILE1 VAR BYTE[12]
    FILE2 VAR BYTE[12]
    FILE3 VAR BYTE[12]
    
    X1	VAR	BYTE
    X2	VAR	BYTE
    X3	VAR	BYTE
    X4	VAR	BYTE
    X5	VAR	BYTE
    X6	VAR	BYTE
    X7	VAR	BYTE
    X8	VAR	BYTE
    X9	VAR	BYTE
    X10	VAR	BYTE
    X11	VAR	BYTE
    X12	VAR	BYTE
    X13  VAR	BYTE
    X14  VAR	BYTE
    X15  VAR	BYTE
    X16  VAR	BYTE
    X17  VAR	BYTE
    X18  VAR    BYTE
    X19  VAR	BYTE
    X20  VAR	BYTE
    X21  VAR	BYTE
    X22  VAR	BYTE
    X23  VAR	BYTE
    X24  VAR	BYTE
    X25  VAR	BYTE
    X26  VAR	BYTE
    X27  VAR	BYTE
    X28  VAR	BYTE
    X29  VAR	BYTE
    X30  VAR	BYTE
    X31  VAR	BYTE
    X32  VAR	BYTE
    X33  VAR	BYTE
    X34  VAR	BYTE
    X35  VAR	BYTE
    X36  VAR	BYTE
    
    CRET VAR BYTE
    CRET = $0D
    StartDisk:
    
    HIGH VinRXD
    PAUSEUS 1000
    SEROUT2 VinRXD,8588,["ECS",13]
    LCDOUT $FE,1, "1"
    HIGH VinRXD
    PAUSEUS 1000
    SEROUT2 VinRXD,8588,["IPA",13]
    LCDOUT $FE,1, "2"
    HIGH VinRXD
    PAUSEUS 1000
    SEROUT2 VinRXD,8588,["A:",13]
    LCDOUT $FE,1, "3"
    HIGH VinRXD
    PAUSEUS 100
    SEROUT2 VinRXD,8588,["DIR",13]
    LCDOUT $FE,1, "4"
    PAUSEUS 1000
    WAIT1
    IF FLOWIN = 1 THEN WAIT1
    SERIN2 VinTXD,8588,[WAIT(CRET),STR FILE1\12 \CRET,WAIT(CRET),STR FILE2\12 \CRET,WAIT(CRET),STR FILE3\12 \CRET]
    LCDOUT $FE,1, "5"
    
    X1 = FILE1[0]
    X2 = FILE1[1]
    X3 = FILE1[2]
    X4 = FILE1[3]
    X5 = FILE1[4]
    X6 = FILE1[5]
    X7 = FILE1[6]
    X8 = FILE1[7]
    X9 = FILE1[8]
    X10 = FILE1[9]
    X11 = FILE1[10]
    X12 = FILE1[11]
    X13 = FILE1[0]
    X14 = FILE1[1]
    X15 = FILE1[2]
    X16 = FILE1[3]
    X17 = FILE1[4]
    X18 = FILE1[5]
    X19 = FILE1[6]
    X20 = FILE1[7]
    X21 = FILE1[8]
    X22 = FILE1[9]
    X23 = FILE1[10]
    X24 = FILE1[11]
    X25 = FILE1[0]
    X26 = FILE1[1]
    X27 = FILE1[2]
    X28 = FILE1[3]
    X29 = FILE1[4]
    X30 = FILE1[5]
    X31 = FILE1[6]
    X32 = FILE1[7]
    X33 = FILE1[8]
    X34 = FILE1[9]
    X35 = FILE1[10]
    X36 = FILE1[11]
    
    
    PAUSE 100
    LCDOUT $FE,1,X1,X2,X3,X4,X5,X6,X7,X8,x9,x10,x11,x12
    LCDOUT $FE,$C0,X13,X14,X15,X16,X17,X18,X19,X20,X21,X22,X23,X24
    LCDOUT $FE,$94,X25,X26,X27,X28,X29,X30,X31,X32,X33,X34,X35,X36
    
    
    PAUSE 2000
    goto StartDisk
    Here is the code..i haven't been able to add other functions yet because im still addressing to the problem that i stated earlier..

    oh and one more question, is it really necessary to save the the array values into another byte like for this instance the x's? cant i directly use these array values to be printed to the LCD?

  15. #135
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I do not see why the firmware info is being sent to the display...

    What does this do?
    Code:
    SEROUT2 VinRXD,8588,["A:",13]
    This is not the answer but it might be worth a try since it looks like you are now able to change the firmware. Un-check "Show Prompt" and "Show Version...".

    oh and one more question, is it really necessary to save the the array values into another byte like for this instance the x's? cant i directly use these array values to be printed to the LCD?
    The one array will do, I just thought it would be easier to parse the first array into the second for the info you want. But if you can get good data into the first array then the second is not needed at all.

    There is also a "skip" function in the SERIN2 command that might help.
    Attached Images Attached Images  
    Dave
    Always wear safety glasses while programming.

  16. #136
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    thanks! that gave me more options to address to that problem..

    What does this do?
    Code:

    SEROUT2 VinRXD,8588,["A:",13]
    what this does is select drive A: of the vdip2. i used this because the vdip2 swiches to the drive where a flash drive is last inserted so just to make sure in case a drive is last inserted to drive B:, the vdip2 would still go back to port A:. I'm doing this because i want to set drive A: as the source drive and B: as the target drive.

  17. #137
    arunkumar's Avatar
    arunkumar Guest


    Did you find this post helpful? Yes | No

    Default idea

    i am doing in vinculum ic project..i want to copy the files as well as view the pen drive content on LCD display.. i bought VDIP2 modules.. we inserted rom files 3.66...if it possible reply sir....we are using pic to interface with VDIP2....

    reply as soon as possible.....

  18. #138
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by newbie View Post
    what this does is select drive A: of the vdip2. i used this because the vdip2 swiches to the drive where a flash drive is last inserted so just to make sure in case a drive is last inserted to drive B:, the vdip2 would still go back to port A:. I'm doing this because i want to set drive A: as the source drive and B: as the target drive.
    OK, that is why I did not know, it is for the VDIP2.

    You code loops back to "StartDisk:". Does the firmware version show up all of the time of just on the first time trhough?
    Dave
    Always wear safety glasses while programming.

  19. #139
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    the firmware only show up at the start of the program. and doesn't show up anymore unless you reset the vdip2. what do you think about this?

  20. #140
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    what do you think about this?
    I think I am glad I gave up on the VDIP1!

    My only guess is the VDIP buffer is not clearing till a DIR is sent.
    Maybe at startup have a dummy routine that does everything but display to clear it up?
    Dave
    Always wear safety glasses while programming.

  21. #141
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    I guess unchecking the show prompt and show version would do the trick
    thank you very much.
    Last edited by newbie; - 4th March 2010 at 17:38. Reason: spelling

  22. #142
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    HELO..

    i am using pic18f4550,VDIP2 and 2line LCD ,20MHz, 9600 BAUD RATE and connect hyperterminal to monitor the result of the VDIP

    but the hyperterminal only show Ver 03.66VDFC On-line...

    anyone can help? my code is almost same with newbie

    INCLUDE "modedefs.bas"

    DEFINE OSC 20
    DEFINE LCD_DREG PORTA
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTD
    DEFINE LCD_RSBIT 5
    DEFINE LCD_EREG PORTD
    DEFINE LCD_EBIT 4
    DEFINE LCD_RWREG PORTD
    DEFINE LCD_RWBIT 6
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50

    TXD VAR PORTC.7 'AD0 TXD VDIP2 connect RX
    RXD VAR PORTC.6 'AD1 RXD VDIP2 connect TX
    Flow VAR PORTC.0 'AD2 RTS

    Start:
    HIGH RXD
    PAUSEUS 10
    SEROUT2 RXD,8276,["ECS",13]
    HIGH RXD
    PAUSEUS 10
    SEROUT2 RXD,8276,["IPA",13]
    HIGH RXD
    PAUSEUS 10
    SEROUT2 RXD,8276,["A:",13] 'choose source disk
    HIGH RXD
    PAUSEUS 100
    SEROUT2 RXD,8276,["DIR",13]
    GOTO Start
    Last edited by fokus_1116; - 8th March 2010 at 20:00.

  23. #143
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Looks like you need to check your baud rates.
    Those are not 9600
    Dave
    Always wear safety glasses while programming.

  24. #144
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    u means the mode no of"8276" not 9600 baudrate? or the VDIP2 firmware not 9600 baudrate?

  25. #145
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    No, I mean what you had was not 9600
    Start:
    SEROUT2 VinRXD,84,["ECS",13] '9600 TRUE
    HIGH VinRXD
    PAUSEUS 10
    SEROUT2 VinRXD,84,["IPA",13]
    HIGH VinRXD
    PAUSEUS 100
    SEROUT2 VinRXD,8588,["DIR",13]
    GOTO Start
    And I have no idea what your firmware on the VDIP is.
    Dave
    Always wear safety glasses while programming.

  26. #146
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    i ready the the firmware...no prob...
    did u means change the mode no to 84?

  27. #147
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    me already change to 84 but...also the same no respond for the hyperterminal...

  28. #148
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Sorry, been a long day.
    Either 84 or 16468 depending on if the PIC is connected to the VDIP with an inverter chip or not.
    Dave
    Always wear safety glasses while programming.

  29. #149
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    the pic didt connect any inverter chip...the pic TX pin connect to the RXD pin of VDIP2 and RX pin connect to the TXD pin of the VDIP2

  30. #150
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How is the VDIP connected to hyper-terminal?
    Dave
    Always wear safety glasses while programming.

  31. #151
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    using rs232..like the diagram you post before
    Last edited by fokus_1116; - 8th March 2010 at 21:03.

  32. #152
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Can you make a schematic or exactly describe how everything is connected?
    It might help with the guessing game
    Dave
    Always wear safety glasses while programming.

  33. #153
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    thx for your help..

    pic18f4550pin VDIP2pin RS232 pin

    RC.7 RX AD0 TXD PIN11
    RC.6 TX AD1 RXD
    RC.0 I/O AD2 RTS
    AD3 CONNECT TO GND


    GOT ANY IDEA WHERE GOES WRONG?
    Last edited by fokus_1116; - 8th March 2010 at 21:19.

  34. #154
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Another thing I forgot to ask that could be a concern.

    What are you using for an OSC at the PIC and how are the configuation bits set?
    Can you connect the PIC directly to Hyper-Terminal and receive text correctly ? If so then you know the PIC is running at the expected speed.

    Try inverted mode with out a 232 chip and then try true mode with a 232 chip.
    Doing these test should help find the problem.
    Dave
    Always wear safety glasses while programming.

  35. #155
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    i am using 20Mhz
    and may i know how to set the config bit for picbasic pro because
    '__config _XT_OSC & _WDT_OFF & _PWRTE _ON & _CP_OFF'
    content error when build it.

    how i try connect the tx pin of the pic to hyper terminal
    thank for your suggest..

  36. #156
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    is that just connect the TX pin of the pic to the max232 pin11 ? because i cant get the output from hyperterminal..

  37. #157
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    my configuration bits is set as the picture.. but still cant make the pic it display thing on the hyperterminal...still got any suggestion?
    Attached Images Attached Images  

  38. #158
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The first thing we need to do is make sure the PIC is running at the speed you think it is, or know what speed it is running at.

    These USB chips can be confusing ( for me anyways ) when it comes to setting the PLL and all. Bruce has a good explanation here that I refer to.
    http://www.picbasic.co.uk/forum/show...85&postcount=4
    So if you set the configs as he has them the PIC should be running at 48MHz.
    DEFINE OSC 48

    To check the speed write a code that will blink an LED at one second on and one second off.

    Then refer to the PBP manual under SEROUT2. There it shows how to connect the chip to a PC. Send some text to a terminal.

    When this is all working we can "talk" to the VDIP.
    Dave
    Always wear safety glasses while programming.

  39. #159
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    for me also confuse for that part...so i change the pic 18f4550 to pic16f873A..this will more easy (i think)...now i try make it working on hyperterminal ....

  40. #160
    Join Date
    Mar 2010
    Posts
    40


    Did you find this post helpful? Yes | No

    Default

    i still cannot display on the hyperterminal...still got any solution?

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  3. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  4. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  5. PICs and USB Flash Drives
    By The Master in forum USB
    Replies: 2
    Last Post: - 23rd October 2007, 10:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts