How to listen to music through an FPGA pin?

my manager said it couldn't be done. So just to prove him wrong :-)

formatting link

Well, pretty simple stuff anyway. Have fun. Jean

Reply to
Jean Nicolle
Loading thread data ...

Actually I dont think that you have a PWM generator, but a phase accumulator (The output will _toggle_ at a rate determined by your clock and the input data)

Using a magnitude comparator for PWM generation has the nice option of bit reversing a set of the reference count MSBs to select the number of transitions per cycle. Low number of transitions per cycle (no bits reversed) is best for highest accuracy - less dependence on output switching time assymetries. Highest number of transitions (fully bit reversed reference count) gives you a very easy to filter signal...

Peter Wallace

Reply to
Peter Wallace

Oops it will work, I see it now! I miseed that you were just adding the lower 8 bits to the result

Peter Wallace

Reply to
Peter Wallace

I agree. But for better audio quality with little extra effort have a look at this:

formatting link

Kolja Sulimma

Reply to
Kolja Sulimma

I never wrote it up in any way, but I once used a PC timer chip which drives the internal speaker to reproduce signalling tones using PWM. I don't remember this being part of my job, I think I was just playing around with the idea and tested it at work since they had some sampled sound files. A manager was walking by and recognized the sound. When he found out that I did it without a sound card, he wanted me to add it to their signal software package. This was in the days when DOS was still around and not many PCs had much more than the internal beep-boop speaker.

He never got it funded so I didn't add it to the product. But my little test program worked suprizingly well.

--

Rick "rickman" Collins

rick.collins@XYarius.com
Ignore the reply address. To email me use the above address with the XY
removed.

Arius - A Signal Processing Solutions Company
Specializing in DSP and FPGA design      URL http://www.arius.com
4 King Ave                               301-682-7772 Voice
Frederick, MD 21701-3110                 301-682-7666 FAX
Reply to
rickman

How about not just music out of an FPGA pin, but a complete shortwave receiver using just a SpartanII FPGA and an AtoD converter? See the block diagram on my website. I'll be demo'ing it in two weeks at the MAPLD conference, as well as discussing the design in the 6 hour tutorial seminar on DSP for FPGAs I will be doing on the Monday of the conference. The demo is on an Insight spartanII board containing an XC2S100. The only mods to the board are an RC filter between the FPGA pin and the speaker jack, the speaker jack and two blue jumpers to make the ADC demo board plug onto one connector. It actually works without a filter in front of the ADC demo board if the SNR is high enough (I was able to receive BBC from Rhode Island with the antenna connected directly to the ADC board). Adding a tunable antenna preamp makes it a usable for AM and SSB reception over DC to 20MHz. The ADC is external because it is sampling at

40MHz, 12 bits. The DAC for the speakers is a stereo sigma-delta DAC implemented > Kolja Sulimma wrote:

--

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc.

401/884-7930 Fax 401/884-7950 email snipped-for-privacy@andraka.com
formatting link

"They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

Reply to
Ray Andraka

receiver using just a SpartanII FPGA

Sounds like fun. Are you going to post the HDL?

Reply to
Pete Fraser

--

--Ray Andraka, P.E. President, the Andraka Consulting Group, Inc.

401/884-7930 Fax 401/884-7950 email snipped-for-privacy@andraka.com
formatting link

"They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin, 1759

Reply to
Ray Andraka

Reply to
Jean Nicolle

It's pretty easy...

I did a programmable pattern-generator board; one of the tests we cooked up was that it could play a .au file as PWM through any of its output bits. The outputs were on RS422 drivers. The test jig simply AC-coupled the outputs to a small car-stereo speaker. Not hi-fi, by any means, but it never fails to impress and amaze!

Reply to
Andy Peters

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.