Wave Player Programming Related

Status
Not open for further replies.

baileychic

Advanced Member level 3
Joined
Aug 2, 2017
Messages
728
Helped
56
Reputation
112
Reaction score
57
Trophy points
28
Activity points
7,033
My question is related to Wave Player Programming.

I have a 44KHz PCM Wave file stored in a microSD Card. I will be reading it 512 bytes (buffer size) at a time and sending the data to a 12 bit DAC.

As it is a 12 bit DAC I have to clock 12 bit at a time (data size is byte the other bits will be zero).

I have to send 1 byte or 12 clocks in 1/44KHz = 22.72 usec.

So, I need an timer interrupt of (22.72 usec) / 12 = 1.8938 usec.

Is this right ?

I will be using a 64 MHz clock (16 MHz + 4x PLL Internal Oscillator).

Also leaving the wave file header, can I just read the other bytes in sequence and send then directly to DAC ?
 

1 us interrupt will hangup all processing. You need DMA to shift data from fifo to DAC.
 

I have to send 1 byte or 12 clocks in 1/44KHz = 22.72 usec.

So, I need an timer interrupt of (22.72 usec) / 12 = 1.8938 usec.

Is this right ?
No. Presume you'll use hardware SPI interface for the DAC, sending one byte at once to the output register. Even with software SPI, the idea makes no sense.

Some more info would be useful, e.g. processor and DAC type.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…