Vmusic2 Module

#1
I want to build a datalogger with a picaxe28X1 and a vmusic2 module as Data Storage device. I've copied the example provided by technical (thanks), but i have some trouble to get data from the module.I have connected the device as described in the Program.

1. The returned information is not complete.
2. Some of the commands provided by the module do not work (e.g. VPF lexus.mp3 returns Bad Command)

The Programm runs twice. The first step (response) runs with an for next loop.
The second runs with a do... loop.

Here the modified Program:
Code:
symbol first_byte = b0
symbol point = b1
symbol temp = b2
symbol loopcounter = b3
symbol sw = b5

; set picaxe type
#picaxe 28x1

; set COM port used for download
;#com 4

; open terminal after download
; This is to view the 'sertxd' debugging comments
#terminal 4800

setup:
	; setup serial hardware 
	; at 9600 with background receive
	hsersetup b9600_4,%01
	low 0		; ensure CTS is low
	
init:
	; Send Es until the unit responds correctly
	'sertxd ("<Sent> E",CR,LF)
	'hserout 0,("E",CR)
	'gosub	get_response
	'if first_byte <> "E" then init

main:
	; check to see if a drive is actually inserted
	; response will start D for yes and N for no

	sertxd ("<Sent> Check Drive",CR,LF)
	hserout 0,(CR)
	gosub	get_response
	if first_byte <> "D" then main 
	pause 2000

	sertxd ("ECS",CR,LF)
	hserout 0,("ECS",CR)
	gosub	get_response
	pause 2000

	sertxd ("DIR",CR,LF)
	hserout 0,("DIR",CR)
	gosub	get_response
	pause 2000

	hserout 0,(CR)
	pause 100
	gosub get_response
	pause 2000

	sertxd ("FWV",CR,LF)
	hserout 0,("FWV",CR)
	gosub	get_response
	pause 2000

	sertxd ("FS",CR,LF)
	hserout 0,("FS",CR)
	gosub	get_response
	pause 2000	

	sertxd ("idd",CR,LF)
	hserout 0,("idd",CR)
	gosub	get_response
	pause 2000

	sertxd ("VPF lexus.mp3",CR,LF)
	hserout 0,("VPF lexus.mp3",CR)
	gosub	get_response
	pause 1000
	
	sertxd (CR,LF,CR,LF,#sw,CR,LF,CR,LF)
	if sw = 1 then ende
	sw = 1
	toggle 7
	goto main
ende:
	sertxd (CR,LF,"Stop",CR,LF)
	end

	; Sub procedure to receive background bytes
get_response:
	pause 2000			; wait a while	
	
	if sw = 1 then Orig	
	'sertxd ("<Response> ",CR,LF)
	
	point = 0			; reset local pointer
	
	get point,first_byte	; Save the first reply byte

	for point = 0 to hserptr	
	   get point,temp		; get returned byte
	   sertxd (temp)		; transmit it
	if temp <> CR then s_end
	sertxd (LF)
s_end:
	next
	hserptr = 0
	return
	
Orig:

	point = 0 			; reset local pointer

	get point,first_byte 	; Save the first reply byte

	do
	get point,temp 		; get returned byte
	sertxd (temp) 		; transmit it
	inc point 			; increment pointer
	loop while temp <> CR 	; if not CR loop

	sertxd (LF) 		; Add a LF to the received CR
	sertxd (CR,LF) 		; Do another blank line

	hserptr = 0 		; reset the background receive pointer 
	return


; Other Useful Commands

; Play all tracks				hserout 0,("w3a",CR)
; Stop track				hserout 0,("vst",CR)
; Skip to Next Track			hserout 0,("vsf",CR)
; Skip to Start of current Track	hserout 0,("vsb",CR)
; Skip to Previous Track		hserout 0,("vsb",CR,"vsb",CR)
; Pause					hserout 0,("e") ; note no CR here
; Resume (after pause)			hserout 0,(CR)
; Set Volume				hserout 0,("vwr",$0B,vol_right,vol_left,CR)
;    where $00 = maximum volume,$FE is the minimum

; Suspend disk				hserout 0,("sud",CR)
; Wakeup disk				hserout 0,("wkd",CR)
; Get firmware version			hserout 0,("fwv",CR)
And the results:
Code:
<Sent> Check Drive
Bad Command
ent> Check Drive
D:\>
oECS
D:\>
oDIR
1.BAS
HANSI.BAS
VINCUL~1.PDF
VDRIVE~1.BAS
LEXUS.MP3
D:\>
TD:\>

FWV

MAIN 02.08VDAPF
RPRG 1.00R
D:\>
VFS
\>
8idd
/Sector = $0200
Bytes/Cluster = $000200
Capacity = $01EB1000 Bytes
Free Space = $01583E00 Bytes

D:\>
.VPF lexus.mp3
Bad Command
2

0

<Sent> Check Drive
D:\>

ECS
D:\>

DIR
1.BAS

D:\>

FWV


FS
idd
/Sector = $0200

VPF lexus.mp3
Bad Command



1


Stop
It seems that the scratchpad are destroyed, or the pointer incorrect, or the cpu is to slow.
I am very frustrated and confuse.
 
Last edited:

Technical

Technical Support
Staff member
#2
Looks to be basically working . You are making a few mistakes:

1) You do need the init section - you have commented out. Therefore you are trying to send commands before the unit is ready, and it gets a bit confused!

2) some of your filenames are too long - you must use 8.3 format.

3) If your file is LEXUS.MP3 (upper case) you should not use lexus.mp3 (lower case) in the command

Go through your thumb drive files and make sure the filenames are correct.
 
#3
Thanks technical for help.

Init Section: Sorry, I posted the last version of my program with the results a try before.
The response was always: Bad Command.

Long Filenames: I know that. I copied some files to the USB device for test. I do not use those files, except mp3.

The result of the DIR command shows the files in upper case. The files on the USB device are in upper and lower case.
Below the Directory listing:

Code:
 Verzeichnis von E:\

01.01.2004  11:56         4.227.757 Equinox.mp3
27.08.2007  17:29           979.516 DS_VMUSIC2.pdf
27.08.2007  17:35           938.864 VDRIVE2.pdf
03.09.2007  16:52            14.339 Vmusic.odt
03.09.2007  19:48            13.538 Vmusic neu .odt
04.09.2007  15:35               183 musictest2.bas
12.09.2007  12:36             3.949 MUSICtest.BAS
11.09.2007  14:44         1.699.840 VMusic2Notes.doc
11.09.2007  17:44             3.172 music.bas
11.09.2007  17:57             1.628 Vmusic2-2.bas
11.09.2007  19:52             1.705 hansi.bas
11.09.2007  20:16           832.378 Vinculum Firmware User Manual V2.1 Rev 2.pdf
12.09.2007  12:28               942 Vdrivetest1.bas
03.02.2006  17:06           898.612 lexus.mp3

              15 Datei(en)      9.616.423 Bytes
               0 Verzeichnis(se),     54.725.632 Bytes frei
The problem is that some information lost.

Has anyone an idea?

Thanks.
Hans
 
Last edited:
#4
Now it Works!!!

The causes for no function were:

1) a short between TXD and RXD to the module. ?
2) an old firmware version on the module.

After the removal of the short and bringing in the newest Flash, the module reacts as I it expected.

? How is it possible to send and receive date in case of a short between TXd and RXD?
 
Top