Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:44 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : DAC recommendations

Author Message
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 05:22am 19 Jun 2024
Copy link to clipboard 
Print this post

Hi all

I'm building a touchscreen based MP3 (or WAV) sheduler, I've successfully propotyped it with the MCP4822 DAC, it works but it sounds too poorly for my needs. Additionally, there is a approx 1V DC offset which produces an almighty thump whenever the PLAY WAV command is issued or when it reaches the end of the file.

I tried a DYSV5W board which sounds good but behaves randomly with its SD card file handling over UART and is therefore deemed way too unreliable for my application.

Can anyone recommend a 16 bit SPI DAC, good for audio, pref in an inline package?

Thanks
J
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 07:25am 19 Jun 2024
Copy link to clipboard 
Print this post

Are you using MMbasic or building from scratch?
If MMbasic the VS1053 is fully supported, will play MP3 etc.

See here
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:25am 19 Jun 2024
Copy link to clipboard 
Print this post

Hi Jovian,

The almighty thump with the MCP4822 is something that should be solved by the output circuit, add a capacitor and resistor (or volume potmeter). I do not have a MCP4822 board, so I cannot validate.

The almighty thump is result of a single (3.3V) power supply. When it only occurs at startup, you may be able to mute the output until the thump has passed.
When it occurs between songs, there may be a fix possible in software, forcing the DAC to mid position in absence of music.

Volhout
Edited 2024-06-19 17:26 by Volhout
PicomiteVGA PETSCII ROBOTS
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 03:42am 20 Jun 2024
Copy link to clipboard 
Print this post

  Volhout said  Hi Jovian,

The almighty thump with the MCP4822 is something that should be solved by the output circuit, add a capacitor and resistor (or volume potmeter). I do not have a MCP4822 board, so I cannot validate.

The almighty thump is result of a single (3.3V) power supply. When it only occurs at startup, you may be able to mute the output until the thump has passed.
When it occurs between songs, there may be a fix possible in software, forcing the DAC to mid position in absence of music.

Volhout


Thanks for your thoughts on this. I made an MP3 of silence to test whether it was a a playback glitch and the thump in and out remained. 1.06VDC measured on the DAC output pin, filtering with caps removed it. But it could not remove the transition (which I understand is a transient ac state).

The transition seems to be caused at startup and shutdown of the DAC itself. from the datasheet:

"Each DAC channel can be operated in Active or Shutdown mode individually by setting the Configuration register bits. In Shutdown mode, most of the internal circuits in the shutdown channel are turned off for power savings and the output amplifier is configured to present a known high resistance output load"

I used a spare pin to engage a transistor that briefly pulls the post-filter output to ground. That clears the startup transient, however there is no simple way to time it for the closing spike, as unfortunately that happens before the WAV end interrupt is sent. An option to set Active or Shutdown mode in mmbasic would be fantastic.

All that aside, I deemed the 12bit sound of this DAC too lofi for my needs anyway and have purchased a couple of MAX5216 evaluation boards instead, which have a 16bit DAC in an experimenter board format. Hopefully they will not behave the same way.
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 04:18am 20 Jun 2024
Copy link to clipboard 
Print this post

  matherp said  Are you using MMbasic or building from scratch?
If MMbasic the VS1053 is fully supported, will play MP3 etc.

See here


This is gold, thank you again Peter.
Do you know off hand if this board will work too? I would like to use the VS1053 SD card to save a bunch of internal tones, and have the SD card on the PICO res touch available to the user...


Thanks
J
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 05:05am 20 Jun 2024
Copy link to clipboard 
Print this post

If the two SD sockets are on the same SPI bus use a DOUT pin and some logic to switch the CS line from one to the other.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6783
Posted: 07:04am 20 Jun 2024
Copy link to clipboard 
Print this post

That VS1053 is supported for audio output by MMBasic but it requires a SPI of its own. I'm pretty sure that you can't enable both the uSD card and the VS1053 on the same SPI channel. The audio inputs are not supported.

It sounds rather nice to my ancient and non-hifi calibrated ears. :)

.
Edited 2024-06-20 17:07 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 07:07am 20 Jun 2024
Copy link to clipboard 
Print this post

  phil99 said  If the two SD sockets are on the same SPI bus use a DOUT pin and some logic to switch the CS line from one to the other.


Thank you Phil
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 07:08am 20 Jun 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  That VS1053 is supported for audio output by MMBasic but it requires a SPI of its own. I'm pretty sure that you can't enable both the uSD card and the VS1053 on the same SPI channel. The audio inputs are not supported.

It sounds rather nice to my ancient and non-hifi calibrated ears. :)

.


Yes I'm happy if the inbuilt SD card is not accessible as it will contain ROM sounds. I'll buy a couple and try them out. Thanks for the help.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4223
Posted: 07:13am 20 Jun 2024
Copy link to clipboard 
Print this post

Hi,

I am not sure the module gives access to the module's SDcard lines. The chip may have full control over these lines. Especially when you can also use it to "record" audio.

Also, I am not sure if the picomite can handle "user switched" control of 2 SD cards on the same SPI bus (or different SPI busses).

Volhout
Edited 2024-06-20 17:14 by Volhout
PicomiteVGA PETSCII ROBOTS
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 08:06am 20 Jun 2024
Copy link to clipboard 
Print this post

Both sockets will appear as Drive B: so it is up to the user to know which is which and not to switch while the bus is active.
Selecting Drive A: before switching B: sockets should prevent MMBasic getting confused.

A dummy file on each card with a file name that identifies it would help.
Eg:-
AA_SDcard_01.txt
AA_SDcard_02.txt
AA_SDcard_03.txt

Starting with AA puts it at the top of "files".

It could even be a toggle switch instead of logic.
Edited 2024-06-20 18:10 by phil99
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 08:28am 20 Jun 2024
Copy link to clipboard 
Print this post

SDcards have to be initialised to put them into SPI mode. This happens once each time after a card is inserted when it is first used. A heartbeat then checks the card is still functioning every second or so. This allows insertion and removal without a CD pin.
The initialisation uses a particular sequence where the SPI clock is pulsed WITHOUT CS selected. It is very unlikely that two SD cards on the same SPI channel can be made to work with the MMbasic firmware as written.

As Mixtel90 notes, the VS1053 uses a dedicated SPI bus and MMBasic CANNOT use an SDcard that shares that bus
 
jovian
Regular Member

Joined: 16/04/2017
Location: Australia
Posts: 62
Posted: 07:11am 07 Jul 2024
Copy link to clipboard 
Print this post

  matherp said  Are you using MMbasic or building from scratch?
If MMbasic the VS1053 is fully supported, will play MP3 etc.

See here


Hi all

The making-the-pico-play-audio saga is ongoing.

I've purchased a few VS1053's and found them to be good sound-wise. However, the problem I'm finding is that the PLAY WAV command outputs an audible thump, thankfully not full scale, followed by silence and hanging up the program for 3.9 secs, until it eventually begins playing the track and continuing with the program.

> autosave

timer=0
?timer
play wav "b:/music/21 babylon"
?timer
Saved 62 bytes
> run
0.055
3964.454


Can anyone tell me if this is to be expected? Is there any way around it?

Thanks
Jo
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024