<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: WM8762 DAC</title>
		<link>http://forums.leaflabs.com/topic.php?id=11698</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22:31 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=11698" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "WM8762 DAC"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11698#post-26080</link>
			<pubDate>Sat, 18 May 2013 06:38:01 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">26080@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;pyrohaz - &#60;em&#62;&#34;The sample rate is actually currently at 45kHz, meaning a prescaler of 1600 (72e6/45e3), since 48kHz is a standard audio sample rate and can be achieved with a prescaler of 1500, I thought that this would be a better value to choose.&#34;&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;Okay. So you would be okay getting close, but don't &#60;strong&#62;need&#60;/strong&#62; 48KHz exactly.&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;If I changed the crystal, would this also give me an increased system clock by 1.5x(ish) to about 111MHz?&#60;/em&#62;&#60;br /&#62;
The system clock speed is set by software, so the CPU could still run at 72MHz. I vaguely remember someone (at LeaLabs) did do an overclock of the Maple by changing the system clock multiplier, but I can't remember what speed they reached.&#60;br /&#62;
Edit: However, unless you change the bootloader, and flash a new one onto your Maple, it would try to run at 9x11.288MHz, which might not work. I should have been clear about that.&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;I like the look of the codec shield but i'm looking to do it on the ultimate cheap, the chip I linked above can be picked up for about £3 and comes in a soic8 package which is easily solderable.&#34;&#60;/em&#62;&#60;br /&#62;
I like to keep costs low to minimise &#34;barriers to entry&#34;.&#60;/p&#62;
&#60;p&#62;The WM8731 can be bought for £2.82+VAT&#60;br /&#62;
&#60;a href=&#34;http://uk.farnell.com/wolfson-microelectronics/wm8731seds-rv/dac-audio-24bit-headphone-28ssop/dp/1776264&#34; rel=&#34;nofollow&#34;&#62;http://uk.farnell.com/wolfson-microelectronics/wm8731seds-rv/dac-audio-24bit-headphone-28ssop/dp/1776264&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Apparently, it can generate its own clocks from a 12MHz signal, so it might be possible to hook it directly to a Maple timer output, set to divide the system clock by 6. &#60;/p&#62;
&#60;p&#62;But you would need a PCB. If I were doing that, I'd probably include a 12MHz crystal, and local power supply smoothing and decoupling. I might use the Arduino Audio shield PCB, or use it as a starting point, but make it Maple specific by removing some Arduino interface stuff. Irritatingly matching the Arduino shield footprint needs a bit over 50mm wide board, which pushes up the PCB cost (at seeed) a lot, so I might try to squeeze it into 50mm x 50mm. The electronics are probably well under £10.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pyrohaz on "WM8762 DAC"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11698#post-26078</link>
			<pubDate>Fri, 17 May 2013 21:28:12 +0000</pubDate>
			<dc:creator>pyrohaz</dc:creator>
			<guid isPermaLink="false">26078@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Cheers for both the replies,&#60;/p&#62;
&#60;p&#62;If I run it at 125fs, won't it constantly go in and out the expected cycles for the chip? Therefore producing a dodgy output?&#60;/p&#62;
&#60;p&#62;How can I work out the current error produced by my mismatched resistors?&#60;/p&#62;
&#60;p&#62;Well i'm using DDS to produce my output waveform with a 12bit wavetable containing 16bit amplitude values.&#60;/p&#62;
&#60;p&#62;The sample rate is actually currently at 45kHz, meaning a prescaler of 1600 (72e6/45e3), since 48kHz is a standard audio sample rate and can be achieved with a prescaler of 1500, I thought that this would be a better value to choose. &#60;/p&#62;
&#60;p&#62;If I changed the crystal, would this also give me an increased system clock by 1.5x(ish) to about 111MHz?&#60;/p&#62;
&#60;p&#62;I like the look of the codec shield but i'm looking to do it on the ultimate cheap, the chip I linked above can be picked up for about £3 and comes in a soic8 package which is easily solderable.&#60;/p&#62;
&#60;p&#62;Are there any other well priced 16bit dacs? I was looking at the AD1851N but I can only really find it from HK and don't really have time to wait for it to come. Has anyone used the TDA1543 chip either? They seem to be abundant and extremely cheap on ebay too.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "WM8762 DAC"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11698#post-26073</link>
			<pubDate>Fri, 17 May 2013 13:54:20 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">26073@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;pyrohaz - There are a bunch of approaches to improving the audio output.&#60;/p&#62;
&#60;p&#62;What is driving the choice of 48KHz sample rate? Are you trying to use existing sound sources which require 48KHz?&#60;br /&#62;
How accurate must the frequency of the sound be? For example, do you have perfect pitch and you could hear small deviation? Are you playing music with other instruments which can't be tuned?&#60;/p&#62;
&#60;p&#62;One approach to higher quality sound is to use the &#34;Audio Codec Shield&#34;:&#60;br /&#62;
&#60;a href=&#34;http://www.openmusiclabs.com/projects/codec-shield/&#34; rel=&#34;nofollow&#34;&#62;http://www.openmusiclabs.com/projects/codec-shield/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;&#60;em&#62;&#34;The Audio Codec Shield is an Arduino shield that uses the Wolfson WM8731 codec, capable of sampling and reproducing audio up to 88kHz, 24bit stereo.&#60;br /&#62;
...&#60;br /&#62;
The WM8731 has a lot of useful features, and routines have been written for most of them for both Arduino and Maple&#34;&#60;/em&#62;&#60;/p&#62;
&#60;p&#62;You can buy it online, e.g. &#60;a href=&#34;https://www.sparkfun.com/products/11290&#34; rel=&#34;nofollow&#34;&#62;https://www.sparkfun.com/products/11290&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Another approach to accurate frequency might be to replace the Maples 8MHz crystal with a 12.288MHz crystal, eg.:&#60;br /&#62;
&#60;a href=&#34;http://www.digikey.com/product-search/en?pv139=30&#38;amp;FV=fff4000d%2Cfff8016d%2Cb8434d&#38;amp;mnonly=0&#38;amp;newproducts=0&#38;amp;ColumnSort=0&#38;amp;page=1&#38;amp;quantity=0&#38;amp;ptm=0&#38;amp;fid=0&#38;amp;pageSize=25&#34; rel=&#34;nofollow&#34;&#62;http://www.digikey.com/product-search/en?pv139=30&#38;amp;FV=fff4000d%2Cfff8016d%2Cb8434d&#38;amp;mnonly=0&#38;amp;newproducts=0&#38;amp;ColumnSort=0&#38;amp;page=1&#38;amp;quantity=0&#38;amp;ptm=0&#38;amp;fid=0&#38;amp;pageSize=25&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Then the 6.144MHz can be directly generated by a timer, with no software overhead.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mlundinse on "WM8762 DAC"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11698#post-26072</link>
			<pubDate>Fri, 17 May 2013 11:27:36 +0000</pubDate>
			<dc:creator>mlundinse</dc:creator>
			<guid isPermaLink="false">26072@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi&#60;/p&#62;
&#60;p&#62;You can run the chip at 6 MHz, with 128fs that gives 46.875 kHz sampling rate, nonstandard but perfectly ok if you are driving an analog output. Theres nothing special about the 44100 and 48000 samplerates apart from beeing commonly used and makes digital sound connections work better.&#60;/p&#62;
&#60;p&#62;Another possibility is to run at 125fs, and a sample rate of 48kHz, this is 3 clocks off, not optimal but the chip will tolerate up to 8 cycles deviation from 128fs.&#60;/p&#62;
&#60;p&#62;A 6MHz timer interrupt will eat all your processor cycles just entering and leaving the interrupt handler.&#60;/p&#62;
&#60;p&#62;Matching the resistors and using high precision resistors should make a definite improvement in sound quality.&#60;/p&#62;
&#60;p&#62;Regards&#60;br /&#62;
Magnus
&#60;/p&#62;</description>
		</item>
		<item>
			<title>pyrohaz on "WM8762 DAC"</title>
			<link>http://forums.leaflabs.com/topic.php?id=11698#post-26055</link>
			<pubDate>Thu, 16 May 2013 22:08:08 +0000</pubDate>
			<dc:creator>pyrohaz</dc:creator>
			<guid isPermaLink="false">26055@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hey guys,&#60;br /&#62;
My synth is going absolutely awesomely!&#60;/p&#62;
&#60;p&#62;Currently, the audio output is done using two 8bit PWM outputs at ~282.5kHz. I'm writing 16 bits of data at the moment using the small snippet:&#60;/p&#62;
&#60;p&#62;pwmWrite(2, PWMWriteVar&#38;amp;255);&#60;br /&#62;
pwmWrite(3, PWMWriteVar&#38;gt;&#38;gt;8);&#60;/p&#62;
&#60;p&#62;Where pin 2 is connected to a junction through a 56k resistor and pin 3 is connected to the same junction through a 220ohm resistor. While this is a pretty shoddy DAC (as you can imagine, the resistors alone are partially mismatched!), I want to improve the quality.&#60;/p&#62;
&#60;p&#62;I'm looking at using the WM8762 (&#60;a href=&#34;http://pdf1.alldatasheet.com/datasheet-pdf/view/174592/WOLFSON/WM8762GED/RV.html&#34; rel=&#34;nofollow&#34;&#62;http://pdf1.alldatasheet.com/datasheet-pdf/view/174592/WOLFSON/WM8762GED/RV.html&#60;/a&#62;) as its cheap and readily available.&#60;/p&#62;
&#60;p&#62;My sample rate is 48kHz. Now what i'm wondering is that according to the data sheet, the MCLK needs to be fed a minimum of 128fs, up to 50MHz (I wouldn't be looking for that much oversampling obviously!), now obviously this means I need to generate a clock of 6.144MHz. Is there any way to easily do this on the maple? I know I could probably configure a spare timer to toggle an output but getting exactly 6.144MHz would require a prescaler of 11.71875 which just isn't possible!&#60;/p&#62;
&#60;p&#62;Would the chip be likely to &#34;complain&#34; at a master clock of 6MHz instead? Also, how much jitter would firing an interrupt every 6MHz and writing to a GPIO cause?&#60;/p&#62;
&#60;p&#62;If using this DAC wouldn't be a particularly good idea, are there any better ways to create a 16bit output at 48KHz? Would my current PWM method suffice with using precisely matched resistors, such as 300ohm and 76.8kohm?&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Harris
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
