Solved! was Re: [sdiy] dsPIC DMA RAM to DAC problem

Tom Wiltshire tom at electricdruid.net
Sat Jan 23 17:30:15 CET 2010


I fixed it!

It turned out I had a problem with the audio output, not the chip. Doh!

I did as Eric suggested and tested the DAC on its own, and got no  
output. This was very strange, since it had been working previously.  
Testing the DAC pin directly showed a signal, and that lead me to the  
fault.

If anyone would like the outline code for this, let me know.

T.


On 23 Jan 2010, at 15:12, Eric Brombaugh wrote:

> Tom,
>
> I haven't used DMA on the DAC yet, but a few things you might check:
>
> * Are you using the proper little DMA address calculation macros  
> when loading the pointer registers? This confused me for a while  
> back when I first started using DMA for the ADC buffering.
> * You say there's no output from the DAC - does changing the  
> DACDFLT register change the output voltage? If so then the input  
> FIFOs are underflowing - the DMA isn't loading them.
> * Perhaps just as a sanity check disable DMA and use a little DAC  
> ISR to drive data in - does this work?
>
> That's about all I've got. Good luck and let us know what you  
> discover.
>
> Eric
>
> On Jan 23, 2010, at 6:46 AM, Tom Wiltshire wrote:
>
>> I came across that video whilst trying to find a solution to my  
>> current problem; getting the DMA working shifting audio data from  
>> the dual-port SRAM to the audio DAC on the dsPIC 33FJ128GP802.
>>
>> Has anyone got any experience doing this?
>>
>> The audio DAC is pretty striaghtforward, and I've got DMA  
>> interrupts occurring every 16 samples. The fact this happens at  
>> the right speed means the DMA is getting interrupts from the DAC  
>> correctly.
>>
>> I've stuck dummy data in the DPSRAM (The DMA RAM area) which is  
>> just a ramp going up and a ramp going down. If the DMA works  
>> correctly in ping-pong mode, I should see a triangle wave coming  
>> out at 1/32nd of the sample rate. But I'm not seeing any output  
>> from the DAC.
>>
>> It's one of those evil register set-up problems which give you  
>> very little feedback and thereby make debugging very difficult.
>>
>> Any help appreciated - I'm on my second day of this, and I'm just  
>> starting to get slightly annoyed. Assembly programmers need  
>> infinite patience!
>> Thanks,
>> T.
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at synth-diy.org
>> http://synth-diy.org/mailman/listinfo/synth-diy
>



More information about the Synth-diy mailing list