VINCULUM - Vmusic2 - Vdrive2 - Help


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    9

    Question VINCULUM - Vmusic2 - Vdrive2 - Help

    Newbie here and I hope I can get a quick answer as it appears there are a few on this forum the have experience with these Vinculum devices from my searches. But the searches although helpful in many respects they are failing to give me the helping hand I need for this problem.

    OK first thing first I'm using the Vmusic2 with current firmware, no problems there I can play the music files and sorts just fine, so all is good on that front and the bread board and core code works. Figured that all out after much trial and error. And help from reading this forum and others. Thanks to those that contributed to this subject already.

    But, I now want to add a configuration file to the drive to be read by the pic and this is tossing me for a loop, I'm not setup to debug so I'm at a disadvantage in seeing what and how the Vmusic2 is responding. So I'm hoping someone can toss me a bone with a short code snippet that will get me on the way.

    Here is an example scenario, I know the scenario is not real practical but in my opinion it's a good proof of concept example that would get me (and maybe others) started and on the way to bigger and better even if it servers little functional purpose as is.

    Scenario

    1. There is a text file on the drive called volume.txt, it contains one line with a : separator between two values, the values will be a number between the 0 - 255 aka Vmusic2 happy volume levels.

    Example txt file
    Code:
    10:225
    2. I would like to simply read that text file and put the two values into variables in the code so they could be used.

    Seems simple but not for me

    I have attached some pseudo code of where I'm heading, if an array is easier that will work as well, at this point I'll just be happy to get the values off the flash drive and into variables in code.

    Code:
    vol var byte 'first value
    vol2 var byte 'second value
    
    main:
    
        serout PORTB.7, T9600, ["OPW volume.txt", 13] 'open file
        serout PORTB.7, T9600, ["RD volume.txt", 13]  'read file
        gosub rdfile 'jump to subroutine to gather read inforation
        serout PORTB.7, T9600, ["CLF volume.txt", 13]  'close file
    
    '''''''''''''''''''''''''''''''''''''''''''''
    'rest of program that would use vol and vol2 variables'
    '''''''''''''''''''''''''''''''''''''''''''''  
    end
    
    rdfile:
    serin PORTB.6, T9600,  'totaly lost at this point
    '
    '
    ' at a complete lose
    '
    '
    return

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


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    Give this a try in the totally lost area.
    Code:
    SERIN2 PORTB.6,84,[DEC vol,WAIT(":"),DEC vol2]
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2010
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Hmm added the serin2 line and the code seems to hang on the jump and never return back to main, I wonder if there is something wrong with the open,read and close file commands I issued that is causing it not to spit up the data? Thus the serin2 can wait all day and never get anything.

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


    Did you find this post helpful? Yes | No

    Default

    These VDIP things can be a pain in the butt...

    Try reading the data into an array without any WAITs and see exactly what is being sent by the VDIP.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2010
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    I'm leaning towards this line being wrong.
    Code:
    serout PORTB.7, T9600, ["RD volume.txt", 13]  'read file
    The more I read it might be RDF instead of RD and I need to specify the number of bytes to read in there somewhere, I guess.

    And typo in the open command.

    Code:
    serout portb.7, T9600, ["OPR volume.txt", 13]
    serout portb.7, T9600, ["RDF XXXXX, 13]
    SERIN2 PORTB.6, 84,[DEC vol,WAIT(":"),DEC vol2]
    serout portb.7, T9600, ["CLF volume.txt", 13]
    At a lose what should be in XXXXX

    The subroutine above is hanging.
    Last edited by Allister; - 18th May 2010 at 03:08.

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    serout PORTB.7, T9600, ["OPR volume.txt", 13] 'open file
    serout PORTB.7, T9600, ["RD", 13]  'read file
    Not sure if RDF will always work in your case because the amount of characters are not constant. But try the above...
    I missed the W earlier and I think once the file is opened the name is not used until after it is closed and you need to open it again.
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 0

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

Posting Permissions

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