Audio DMA To PWM Pins No CPU On Raspberry Pi Pico

  Рет қаралды 5,643

Develop IT

Develop IT

Күн бұрын

If you would like to contribute to the production of content on this channel:
Patreon: / _developit
Source Code for my Open Sourced projects can be found here:
GitHub: github.com/Bir...
My Web site can be found here:
www.newsdownloa...

Пікірлер: 32
@zetaconvex1987
@zetaconvex1987 2 жыл бұрын
Interesting. I want to try out that OPAMP thing. FYI, the fading in and out you are referring to called "apodising" (which literally means "removing the foot").
@DevelopIT
@DevelopIT 2 жыл бұрын
That is good to know, thank you. BTW, using just a transistor rather than an op-amp also works. I am currently using a transistor for this, the same circuit that is in my video "Emulated ZX Spectrum Beep Using A GPIO Pin". But the variable resistor I am using is 100K rather than the 10K one in the video. This make is much simpler and cheaper, and can drive a very small speaker directly.
@rafaelgcpp
@rafaelgcpp Жыл бұрын
I am really, really confused by the opamp circuit. It is working single supply, in inverting configuration, with positive input. Hence, the opamp output is at ground, since it cannot go negative. You are listening to amplified leak current...
@abraxalito
@abraxalito 10 ай бұрын
Not just that - the TI data for LM741 says the min supply voltage is 20V total, here its running on 5V. So I reckon it works because the resistors are doing the attenuation work, the opamp's effectively out of circuit.
@jonshouse1
@jonshouse1 2 жыл бұрын
Nice video, but for the second time running following your videos I have failed to find the code referenced in the video on your github link. Can you please put the link to the actual project explained in the description rather than a generic link to your projects. I wanted to see what the PWM frequency is, in theory it should be a PWM frequency of at least 7 times the audio sample rate, this allows the value of C to be small in the RC which stops the clicking issue as well is improving the waveform shape. Disclaimer though i've never actually coded audio this way so I don't pretend to be any kind of expert.
@DevelopIT
@DevelopIT 2 жыл бұрын
The frequency multiple is 125MHz / 22050 = 5669 times the sample rate.
@jonshouse1
@jonshouse1 2 жыл бұрын
@@DevelopIT125Mhz? It is possible I guess, are you confusing the PWM source clock and PWM frequency maybe. If you set duty cycle to 50% and measure the frequency what do you get? I don't see an R/C filter, are you relying on the limited bandwidth of the opamp instead. It is more common to have one or more R/C low pass filters, this both smooths the pulses and attenuates from logic level down to something closer to 1v for the audio amp to follow. The amplifier is typically a fixed impedance so does not require an opamp or transistor to buffer the signal.
@DevelopIT
@DevelopIT 2 жыл бұрын
@@jonshouse1 125MHz is the system clock divided by 22050 which is the sample rate gives maximum count for PWM of 5669. In other words the PWM is running at 5669 times the sample rate, which meets the requirement of the 7 times you had commented it needed to be. I think 7 times is a bit low as 3 bits can represent 7. 5669 is slightly over 12bit representation, still under the original wav file's 16bit samples though.
@jonshouse1
@jonshouse1 2 жыл бұрын
@@DevelopIT I clearly do not follow what is going on, I guess I need to read up more on the PICO. I've used hardware PWM on PICS, I get 13 bits of resolution from PWM frequencies as low as 500Hz. The Pico has hardware PWM, best I can tell with similar specs. One, the other, or both of us are confused at this point but clearly I do not understand your maths or method so I guess it must be me. You did not answer what frequency a 50% duty cycle is for your project, so I am unclear if you are confusing the units and terminology or I am.
@DevelopIT
@DevelopIT 2 жыл бұрын
@@jonshouse1 If measured with a frequency counter or scope, the PWM running at any specific duty cycle will always be twice the sample frequency as it only transitions once at the start of the sample and once at the required period during the cycle. However, the granularity of being able to give 50% duty is twice the sample frequency, 25% duty is four times the sample frequency, 12.5% duty is eight times the sample frequency and so on...
@IndicDarshan
@IndicDarshan 2 жыл бұрын
The source code for your PWM audio for PICO is not in the list of your project. If you have it there can you please place actual link directly pointing to the project in github or anywhere. Or you did you not find it finally working and worthy to be put on github?
@DevelopIT
@DevelopIT 2 жыл бұрын
The converter to convert a WAV file to the data include file for a project is here: github.com/BirchJD/WAV-To-PWM-.h-Data The source code is very small and can be typed in from the video. However the current project I am working on contains the source code and will be published on GitHub when it is written up soon.
@IndicDarshan
@IndicDarshan 2 жыл бұрын
@@DevelopIT I was interested in the main code of your project that runs the converted file using DMA, not in the converter itself. If you have the main part uploaded somewhere on net please let us know the link. Can a wavetable be run with different frequency in the similar fashion ?
@DevelopIT
@DevelopIT 2 жыл бұрын
@@IndicDarshan The current project I am working on contains the source code and will be published on GitHub when it is written up soon.
@ShivamJha00
@ShivamJha00 2 жыл бұрын
ah yes classic family guy intro song
@PatrizioCrispino-q1e
@PatrizioCrispino-q1e Ай бұрын
Ottimo
@IndicDarshan
@IndicDarshan 2 жыл бұрын
Did you scheme finally worked ? Because there is no demo as well. No demo no source code!
@DevelopIT
@DevelopIT 2 жыл бұрын
Should be part of the write up for what I am working on now, hopefully published soon.
@taranagnew436
@taranagnew436 2 жыл бұрын
where (on your page on github) do i find the code for converting a WAV to PWM?
@DevelopIT
@DevelopIT 2 жыл бұрын
I should be able to put the converter code on GitHub this weekend.
@DevelopIT
@DevelopIT 2 жыл бұрын
I have placed the code for converting WAV to PWM here: github.com/BirchJD/WAV-To-PWM-.h-Data
@sharptrickster
@sharptrickster Жыл бұрын
Nice project. Is 44100 sample rate possible?
@DevelopIT
@DevelopIT Жыл бұрын
Technically I don't think so. The advantage of this method is that audio can play without load on the CPU, so the CPU is fully available for other tasks while the audio is playing. The quality of the audio is a compromise.
@Jblow-u2m
@Jblow-u2m 8 ай бұрын
​@@DevelopIThow about going out from pwm through USB?
@DevelopIT
@DevelopIT 8 ай бұрын
@@Jblow-u2m I wouldn't know how to do that. Good idea though.
@Jblow-u2m
@Jblow-u2m 8 ай бұрын
Could the processors be implemented to improve the quality of (or operate to process) the audio?
@gryzman
@gryzman 2 жыл бұрын
good stuff
@DevelopIT
@DevelopIT 2 жыл бұрын
You may like my next video for recording and playing back audio on a Pico. I'm currently documenting it and will publish it soon with all of the source code too.
@gryzman
@gryzman 2 жыл бұрын
@@DevelopIT looking forwards!
@huckleberryfinn-cz3gd
@huckleberryfinn-cz3gd Жыл бұрын
Sorry but I do not have the time to go through all the 25 minutes. Is there some point where we can here what comes out of the speakers? (please tell me at which time)
@DevelopIT
@DevelopIT Жыл бұрын
It is not possible to take a short cut to knowledge and ability. With time you will learn to saw like an eagle and glide like a crane.
@manuelr7121
@manuelr7121 Жыл бұрын
i kind of understand i just wish i understood c ... i only know pythong and the code confuses me
RPi Pico Saving Application Data To Flash
16:11
Develop IT
Рет қаралды 2,8 М.
Raspberry Pi Pico - PIO explained
50:01
Slador
Рет қаралды 31 М.
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56
Ouch.. 🤕⚽️
00:25
Celine Dept
Рет қаралды 18 МЛН
Raspberry Pi Pico Lecture 7: ADC and DMA
49:59
V. Hunter Adams
Рет қаралды 10 М.
#220 PICO and PIO: First Look - far easier than you might 💭 think
21:51
Raspberry Pi Pico - Первый взгляд
8:48
arduinoLab
Рет қаралды 62 М.
Software Defined Radio with Pi-Pico
9:41
101 Things
Рет қаралды 55 М.
Raspberry Pi Pico PIO - Ep. 8 - Introduction to DMA
18:21
Life with David
Рет қаралды 19 М.
RP6502 Ep2 - 6502 reads Raspberry Pi Pico @ 8 MHz - PIO and DMA
13:43
Rumbledethumps
Рет қаралды 30 М.
Raspberry Pi Pico ADC
14:04
Tinker Tech Trove
Рет қаралды 15 М.
DID A VAMPIRE BECOME A DOG FOR A HUMAN? 😳😳😳
00:56