Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

USB Audio Device - FINALLY WORKS!!


  • Please log in to reply
117 replies to this topic

#1 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 10 February 2012 - 09:16 PM

Hey, just want to say that I've successfully created a USB audio amp involving the Netduino mini.

The project uses a Texas PCM2707 chip for USB Audio in conjunction with a Texas TAS5727 2x20W D-amp accepting I2S audio @ 48kHz coming from the USB host, i.e. PC running VLC or what player have you. The role of the mini is to orchestrate it all.

Attached is an image depicting the setup using a FTDI cable for programming the mini (which could be omitted for clarity at this point). There's also a separate 20V line (coming in from the upper left) to power the TAS5727 D-amp. Then there's the USB-cable from the PC supplying 5V to the mini and a 3.3V regulator for the Texas chips.

The TAS5727 D-amp is controlled by the Netduino mini by means of I2C and the PCM2707 is controlled over SPI. More over this later, should anyone be interested.

Attached is the code for all of this, it includes code for doing USB-HID operations which will control VLC playback on the host PC after an IR-remote has been added. As a followup, I will include an IR-remote in order to control the host PC, i.e. play/pause/skip, etc.

Btw, the Texas PCM2707 (TQFP32) has been soldered onto an adapter by no other than yours truly and the D-amp thingy could really blow your ears out Posted Image

EDIT: Here's a video:
http://www.youtube.com/watch?v=ftOWgBMPjYc&context=C301fe02ADOEgsToPDskLvEzUHp9kyReYAorSKPVbM

Attached Files



#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 11 February 2012 - 04:45 AM

Hello Hanzibal. The project "sounds" great...okay, that's a joke! Anyway could you post any schematic? I'm having hard time to understand how it works. Is it possible to pull out data from a SD, instead of having a PC? Again, congrats for your goal. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 11 February 2012 - 11:13 AM

Mario, I don't have any schematics but the wiring is basically the PCM2707 reference design found on page 29 in the datasheet:

http://www.ti.com/li...ink/pcm2707.pdf

A 12Mhz crystal and some caps is all it needs to run.

When re-reading my post just now I found it somewhat confusing so let me try to explain how it works. The PCM2707 is a USB device (i.e. not host) that works with the generic USB audio drivers in Windows so it requires no additional driver. It's basically a USB soundcard that receives USB audio (max 48kHz sample rate) from the PC. The device does all the hard work really.

The PCM2707 outputs 16-bit i2s audio that is sent directly to the d-amp.

At this point, the mini is merely used to reset and configure the TAS5727 d-amp via i2c (two-wire). The mini is also connected to the PCM2707 through SPI in preparation for sending HID-commands to the PC corresponding to IR-commands to be received from the IR-detector that I'm planning to add.

#4 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 February 2012 - 09:00 PM

So now I took the IR-detector class from darko in this other thread and added the DFRobot IR-remote to my project.

Thus it can now do play/pause, next, previous, stop, volume up/down, mute and power toggle using the remote. This works when running a player such as VLC or Wndows Media Player that listens to media-events in Windows.

Attached is the updated code.

Actually this is now a complete digital 2x20W USB audio PC speaker set.

Mission completed.

Attached Files



#5 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 18 February 2012 - 11:54 PM

Added a video for your pleasure...

#6 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 02 March 2012 - 07:27 PM

Hello again!

I'm actually thinking of designing my own PCB for this. Before going any further in thought or otherwise, I'd like to see if there would any "public" interest. So here goes.

What is it?
It's a fully featured USB Audio DAC with integrated 2 x 20 amplifier and IR remote receiver featuring headphone and subwoofer outputs. All controlled by your faithful Netduino mini (can be substituted for a regular Netduino or Netduino Plus).

This board would have the following features (of which most can be seen in the video above):

  • 16 bit @ 48kHz stereophonic sound through USB Audio class device (driverless for host PCs running Windows, Mac and most Linux)
  • 1 x mini USB connector
  • 1 x Integrated 2 x 20 W class D stereo amplifier
  • 1 x IR receiver for NEC protocol to support any such remote control of your choice
  • Software support for IR commands controlling volume control, mute, power on/off
  • Software support for IR commands generating HID commands to host PC, i.e. play/pause/stop/skip/prev
  • 2 x connectors for stereo speakers
  • 1 x 3.5mm connector for headphones (capable of driving atleast 50 mW into a 32 ohm load)
  • 1 x RCA connector for subwoofer output
  • 1 x 2.1 mm barrel input jack for external 8-26V power supply for the power amplifier
  • 1 x 24 pin DIP-socket for a Netduino mini (or N/N+ if you don't mind the extra wires)
  • 1 x N pin header for 3.3V TTL serial for software updates and tweaking (all source code freely available) and all unused pins of the mini.
The board would be digitally bus powered, i.e. through USB.

NOT included would be an external 8-26V power supply, a physical remote control, enclosure and of course the Netduino mini itself. Note that headphone output will not require an external power source to function.

Approximate total cost for bare PCB and loose parts would be some 60$ + shipping depending on volume. Fully assembled and tested boards could be made available upon popular demand Posted Image

Please reply to this post if you would be interested in such a board as described above. Note that showing your interest will not be binding or anything.

Cheers!

EDIT: I am in no way affiliated with Texas Instruments and I have no commercial interest in this. It's all just for the fun of it all.

EDIT: Sorry for "spamming" the forum about this, I'm just so anxious to see if anyone would interested in this. As always, I wan't everything to happen straight away.

#7 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 02 March 2012 - 10:15 PM

Luckily you spammed, becasue I hadn't seen this post before. I am interested. I have an old NAD amplifier chassis with beautiful switches and buttons that I was thinking of stripping out and putting some new technology into. This might be the "guts" that I need.
STEFF Shield High Powered Led Driver shield.

#8 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 02 March 2012 - 10:37 PM

This might be the "guts" that I need.

Cool, you're welcome!

#9 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 13 March 2012 - 10:52 PM

Well Magpie, looks like it's just you and me, so much for mass productionPosted Image

It seems your NAD chassis will have to continue waiting for new guts.

Either my project is total junk or I'm experiencing the results of crappy marketing Posted Image

#10 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 14 March 2012 - 03:49 AM

Just make it anyway. Olimex can spin up a couple of boards for under 40 Euros. I think it's a good project, and I would like one. I could help a fair bit as I have a bit of a background in Audio.
STEFF Shield High Powered Led Driver shield.

#11 remotewizard

remotewizard

    Advanced Member

  • Members
  • PipPipPip
  • 96 posts

Posted 14 March 2012 - 12:30 PM

I'll take a board when you're up and running. Don't give up just yet!

#12 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 14 March 2012 - 02:15 PM

Thanks for your support guys! Yeah, I might just go ahead anyway, if a couple of boards are just 40$ it could be worth doing for the sheer fun of designing my own board. I'll let you know how things develop...

#13 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 18 March 2012 - 01:04 AM

Hello all prospects Posted Image

I'm tentative to go ahead and design my own PCB no matter what as I could see this as my "master thesis" in embedded electronics Posted Image

I will divide things up a little and design a 1st board without the power amp. This is to somewhat reduce the sources of error a bit. This board will then be followed by a power amp board and then maybe I'll put those together to make a complete "product".

Currently I'm learning Eagle and it's actually going quite well and slow but I'm having fun doing it.

(...listening to the little thing playing Spotify while writing this...)

#14 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 18 March 2012 - 07:21 AM

Hi Hanzibal I used Kicad recently, I found it fairly easy to learn, compared with Eagle anyway. Also it is open source and you are not limited in anyway. Both packages have their own bizarre UI way of doing things but you get used to it. I must admit I didn't get far with Eagle, I seemed to get a mental block whenever I open it up. With KIcad I followed some video tutorials and I have managed to do just about everything. The only thing I still haven't managed is to fill an earth plane in an easy way. But I managed to import all the eagle libraries, sparkfun libraries into Kicad and make my own library. Then layout a board that passed DRC by olimex. Although I got pinged 3 Euros by then for using non standard drill holes. I would use some form of source control with your drawings, libraries as it is quite easy to do things inadvertently. So the ability to roll changes back is critical. Diptrace is also supposed to be ok but I didn't try it.
STEFF Shield High Powered Led Driver shield.

#15 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 18 March 2012 - 11:31 AM

I'm quite happy with Eagle even though I agree the UI is weird and takes a little getting used to. I've got ground planes on both sides and the analogue parts (very few) resides pretty much alone on the bottom side. There's no version control built in to Eagle but maybe there are add-ins for this or else I could use an external system on file level but it would be nice with an integrated tool.

#16 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 21 March 2012 - 11:21 PM

Just now I submitted the Gerber files of the first half to BatchPCB and it miraculously passed DRC (design rule check) Posted Image

This was just a test, I need to make some further adjustments and put (a lot!) of labels on the silkscreen.

But so far so good!

#17 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 22 March 2012 - 10:51 PM

Design files are now sent for manufacturing. I've checked and checked over and over again but I would not be the least surprised if it doesn't work at all. I'm very excited but prepared for the worst and hoping for the best.

Life's like a box of chocolate, you never know what you gonna' get...

For now, everything is SMD as far as possible. One needs to challenge one's self and so I ordered two boards Posted Image

#18 Magpie

Magpie

    Advanced Member

  • Members
  • PipPipPip
  • 279 posts
  • LocationAustralia (south island)

Posted 23 March 2012 - 02:25 AM

Hi Just a word of warning. But hopefully it wont apply to you because you're using eagle. I uploaded some kicad gerbers to BatchPCB and everthing passed DRC but.... The images of the layers they sent me back were all wrong. They seemed to have mixed up my layers and I had copper traces saying R3 instead of silkscreen. I tried numerous times but could not resolve it. So hopefully you checked the images they sent back and they were good, or maybe it was just my images that were wrong. That was the reason I went with Olimex instead.
STEFF Shield High Powered Led Driver shield.

#19 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 23 March 2012 - 02:51 PM

I looked at most of the Eagle tutorials at Sparkfun and they also supplied configuration files to go with BatchPCB. This is no guarantee but will hopefully help me avoid the more obvious pitfalls. After uploading the files to BatchPCB, their images looked correct. Waiting and keeping my fingers crossed...

#20 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 23 March 2012 - 08:37 PM

Good luck with your PCBs, the only design work that I have done was a couple years back using ExpressPCB. I was happy with there service. They provide free software for the schematic and pcb design. MiniBoards are available with 2 or 4 copper layers. The size of these boards must be exactly 3.8 x 2.5 inches and each order include 3 identical PCBs is only $51.00 plus about $10.00 for shipping 2nd day delivery. PCBs with full screen component print and soldering mask is about $25.00 more. The web site is www.expresspcb.com, hope this helps you or someone.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.