VS1000 - USB - virtual port COM

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

VS1000 - USB - virtual port COM

Post by atoutsens » Fri 2013-01-18 17:24

Hi,

I am finishing a project with a VS1000 standalone.
It will play wav files with order from UART (other µC). That is working.

Now, I will need more control from computer view (USB).
How can I manage that ? I don't need mass storage. I only need to send and received order.
Can we have a "virtual com USB interface" ?

Regards,
Atoutsens

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2734
Joined: Tue 2010-06-22 13:43

Re: VS1000 - USB - virtual port COM

Post by Panu » Fri 2013-01-18 18:29

Can we have a "virtual com USB interface" ?
Yes, but it needs some software work and also it needs a driver for the PC.

If you want it to work with Windows without a driver, you could use HID. HID devices don't need drivers in Windows.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

Re: VS1000 - USB - virtual port COM

Post by atoutsens » Fri 2013-01-18 18:51

Hi,

Thank for your quick answer.

Yes, I will prefer without driver.

So, for HID device, do you have any example ?
Or where can I found informations ? (I never work with USB)

Regards,
Nicolas

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2734
Joined: Tue 2010-06-22 13:43

Re: VS1000 - USB - virtual port COM

Post by Panu » Mon 2013-01-21 9:17

Hi!

There are two good books for learning USB. The first is John Hyde's classic "USB Design by Example" from Intel press. There you can find the classing example called "Buttons and Lights". That's a great starting point to understanding and making simple USB HID applications.

Another book is Janet Axelson's easily comprehensive "USB Complete" which is good reading to get the basics of USB correct.

I'm not sure if we have any HID code ready that would be suitable as an example. USB is always a lot of work to get running, because you need to have the "Chapter 9" basic functionality (get descriptor, set interface, clear condition, etc...) running entirely correctly before you can send or receive even a single bit of your own data. But the two books will help you understand the process so you will be able to edit our code or write your own.

The main thing is that it may be difficult to fit the custom USB code into the VS1000 if the VS1000 is already running player software. It might be easier overall to use a USB serial port IC, depending on how much software effort you are willing to have on the project.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

Re: VS1000 - USB - virtual port COM

Post by atoutsens » Fri 2013-01-25 16:49

Hi,

Thanks.

After checking the programmer guides and some documentations on the internet, I would like to now :
- Could we activate interrupt for USB ?
- The original ROM have 2 modes ( speaker and mass storage). I would like only serial.
Do I need to hook speaker call with a "serial function" and change descriptors and that all ?

Regards,
Atoutsens

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2734
Joined: Tue 2010-06-22 13:43

Re: VS1000 - USB - virtual port COM

Post by Panu » Fri 2013-01-25 18:50

Hi!

USB is such an intensive operation that it's best not to handle that in an interrupt, in our case at least... I mean you're welcome to try but I don't think it will be possible due to the complex memory interactions. (Handling it in interrupt would mean re-thinking the whole source code...) But our USB hardware is much more programmer friendly than a simple FIFO type USB hardware: in our hardware all incoming USB packets are placed into a receiver ring buffer memory (instead of many separate fifo buffers). The USB handler picks packets from the ring buffer and processes them. The best way to add USB functionality is to make a main loop which checks the ring buffer for packets you can handle and pass other packets to our ROM routines to handle.

So far I don't think anyone outside VLSI has ever implement that, though. Everybody almost always uses our mass storage to implement the functionality they need.

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

Re: VS1000 - USB - virtual port COM

Post by atoutsens » Mon 2013-01-28 12:56

Hi,

So, if I understand, with the mass storage, we can add new commands ?
What we have to change in VLSI code. It is quite complex and no so easy to find documentation.

Regards,
Atoutsens

atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

Re: VS1000 - USB - virtual port COM

Post by atoutsens » Mon 2013-01-28 16:44

What I need, is by specific USB command :
- play a specific file from the MMC on the VS1000
- send UART command
....

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2734
Joined: Tue 2010-06-22 13:43

Re: VS1000 - USB - virtual port COM

Post by Panu » Mon 2013-01-28 20:54

Needs some thinking.

What software do you now have running in the VS1000?

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

atoutsens
User
Posts: 14
Joined: Thu 2012-11-15 18:41

Re: VS1000 - USB - virtual port COM

Post by atoutsens » Tue 2013-01-29 10:18

Hi,

I am using VS1000AudioModule, SDPlayer module. VS1000D.
I added some UART commands control and specific WAV play (not CodMiniWav, not enough free space).

What I would like at the same time :
OK - Play / pause / stop one WAV file from SD card, order from UART
OK - Read txt file from SD card, order from UART, output to UART
- USB to UART gateway (received one byte, send one byte)
- UART TO USB gateway (received one byte, send one byte)

Regards,
Atoutsens

Post Reply