USB to USB flash Drive File Copier


Closed Thread
Results 1 to 40 of 223

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I had a little extra time so I dug out my VDIP1.

    Where to start...
    I see you are running the PIC at 4Mhz so 9800 baud may be a bit fast so lets work with 4800 baud.

    We need to get your VDIP working at 4800, 8, N, 1.
    The zip file attached has FTRFB.FTD in it. Unzip the zip and put the FTD file on a blank USB stick. The VDIP should see this file and do a firm ware upgrade. You do not need to send any commands at this point.

    I have the VDIP1 connected to a terminal to see what is going on.
    VDIP connections:
    PIN1 = 5VOLT
    PIN6 = PIN11 on a MAX232 PIN14 on the MAX goes to PC serial PIN2
    PIN7, 10, and 18 = GROUND (ZERO VOLTS)
    You can take PIN22 LOW to reset the VDIP1

    A screen shot of the VDIP running at 9800 changing to 4800.


    And a screen shot of the VDIP running at 4800 rebooted to the same USB stick.


    I will try to get more time later this weekend to play some more.
    Attached Images Attached Images   
    Attached Files Attached Files
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    does the serial communicator automatically change the firmware at the start of the connection? no need to enter any commands?

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


    Did you find this post helpful? Yes | No

    Default

    To upgrade the firmware you do not need to send any commands. If the VDIP sees a new firmware it will upgrade to it. When a new firmware is "built" a three character ID is given to it. The ID is whar the VDIP looks at.

    The firmware I gave you has NE1 as the ID. If the ID is the same the VDIP will return "No Upgrade".

    Go down to post #19 here.
    http://www.picbasic.co.uk/forum/show...3888#post83888
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    I use the hyper terminal for serially communicating the vdip to the rs232. ive attached the level converter circuit that i used here in this post. you might as well take a look at it and see if it differs from the one that you know. that circuit worked very well when i used the hyper terminal but when I tried to use the microcode's serial communicator, it didn't respond to anything that i did. i reconfigured the circuit according to you pin assignments but the results were the same. does this have anything to do with me using vdip2 and you using vdip1? but then im pretty sure that i carefully reassigned the pins in the vdip2 that are equivalent to the vdip1.

    since microcode's serial communicator does not work for me, i switched back to hyper terminal but when i inserted the flash disk with the new firmware in it(with a different 3 letter ID), it did not detect any upgrade. so i was forced to use the command used for upgrading the firmware. I typed in FWU FTRFB.FTD. after that it prompted:

    ChangeMAINTD
    Reflasher Active
    Rebooting

    for a moment i look like the one in your printscreen but then after a few seconds it displayed the previous firmware with the previous firmware ID and the vdip2 was still working at 9600 baud rate. Ive also attached the printscreen of that event in this post. you may see it for yourself.

    what can you say? should i stop trying to change the vdip2's baud rate and make the pic micro controller adapt to it instead?
    Attached Images Attached Images   

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


    Did you find this post helpful? Yes | No

    Default

    I this point I would say yes, run at 9600. I do not have a VDIP2 to test so I am at a loss.
    9600 normally requires an OSC faster than 4Mhz though.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2009
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    i already have the microcontroller working with a 20MHZ cystal. I had to follow this line of your code
    Code:
    __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF
    and set it in the icprog's configuration before burning the program.

    after that, i went back to interfacing the pic16f877a to the vinculum and burned the program back in post #87 (with 84 as the code for the baud rate) to the pic . but then the same problem occurs. the operation halts when the pic encounters a serin2 command.

    I know im doing something wrong because the vdip works perfectly with the max232.

    i was thinking about you code. you were using the code 8588 which is equal to 2400 as the baud rate for your pic right? and you mentioned that the baud rate you used with your vdip was 4800. can you tell me that reason behind that? why does your vdip and your pic have different baudrates?

    also, did you notice anything wrong in my code in post #87?
    I have to say thank you for all your help.
    Last edited by newbie; - 31st January 2010 at 16:38. Reason: additional info

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


    Did you find this post helpful? Yes | No

    Default

    What are the settings for the serial port with hyper-terminal? 9600, 8, N, 1?
    If so the 84 should work. If "E"ven then try 8276.

    The code you posted has the wrong baud. But lets start over, sort of.

    With the VDIP connected to the PC as you had it just sen a couple simple commands to the VDIP with the PIC and see if the PC will display the return.
    The below should cause the VDIP to diplay on the terminal a
    D:\>
    every 1.5 seconds..
    At least it is here...
    Code:
    VinRXD  VAR PORTD.7 'DATA TO VDIP PIN #8 OM VDIP1
    FLOWIN  VAR PORTD.6 'FLOW CONTROL FROM VDIP PIN #9 ON VDIP1
    
    START:
    HIGH PORTD.2  'LED
    PAUSE 250
    LOW PORTD.2
    PAUSE 250
    SEROUT2 VinRXD,84,["ECS",13] '9600 TRUE
    HIGH VinRXD
    PAUSEUS 10
    SEROUT2 VinRXD,84,["IPA",13]
    HIGH VinRXD
    PAUSEUS 10
    WAIT111:
    IF FLOWIN = 1 THEN WAIT111
    PAUSE 1000
    GOTO START
    Dave
    Always wear safety glasses while programming.

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