Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

STM32 16bit wav player using Dac

Status
Not open for further replies.

SS1_Raptor

Junior Member level 1
Junior Member level 1
Joined
Feb 16, 2019
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
148
Hello friends good time,


I easily play 8bit wav file using DAC in STM32
But when play 16bit wav Anomalous sounds can be heard
tested several sample rate 8k,16k,32kThey all had anomalous sounds
I use the dac 12bit right alignment

MCU Clock 48MHZ
Read Data From MicroSD

in system that play very well 8bit wav .
Someone can help me find the problem?
 

i look at this in a simple way
you have a 16 bit wav in a 12 bit DAC
what happens to the other 4 bits?

if the data is 16 bit, using 12 bits loses something

you use the DAC right aligned
is the data right or left aligned?

what is an anomalous sound?
 

this is my code ( In conceptual terms )


Code dot - [expand]
1
2
3
buffer[x]>>=4; /* Skip 4bit LSB */
buffer[x] = buffer[x]^0x800; /* Convert Unsigned to Signed */
Dac_Register(12bitLeftAligned) = buffer[x];



but not working and have very bad voice


Please help friends who have experience in this area
 
Last edited by a moderator:

buffer[x]>>=4; /* Skip 4bit LSB */
I'm not sure exactly what that does but I suspect the '=' shouldn't be there.
I'm also not sure you should convert to signed at all, does the DAC accept signed numbers?

Brian.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top