ClassD PWM Questions

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
Woody
XCore Addict
Posts: 165
Joined: Wed Feb 10, 2010 2:32 pm

Post by Woody »

What's your reference clock speed? Have you changed it to 400MHz from 100MHz? perhaps you've not changed DEF_REF_FREQ_MHz?


User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

DEF_REF_FREQ_MHz is set to 100. Is this correct?

Would reducing the reference from 400 to 100 mean I'd have to receive samples at 1/4 the rate?
User avatar
Woody
XCore Addict
Posts: 165
Joined: Wed Feb 10, 2010 2:32 pm

Post by Woody »

Andy wrote:DEF_REF_FREQ_MHz is set to 100. Is this correct?
Yes, if your reference clock is running at 100MHz (which it will be unless you've changed it).
Andy wrote:Would reducing the reference from 400 to 100 mean I'd have to receive samples at 1/4 the rate?
No, you just get less granularity on PWM pulse widths.
User avatar
Andy
Respected Member
Posts: 279
Joined: Fri Dec 11, 2009 1:34 pm

Post by Andy »

I've been doing some experiments with different delays and DEF_REF_FREQ_MHz but none seem to be getting me the correct results.

When the send delay is PWM_PERIOD_44100 and DEF_REF_FREQ_MHz 100, I get overflow. However, when I change DEF_REF_FREQ_MHz to 200 and the delay to (PWM_PERIOD_44100 * 2) I get normal speed/pitch audio but only the right channel is playing out both speakers.

I've double checked the samples and they're definitely being split off correctly in audioManager()... I'm a bit stuck on this one.