There is more than a casual link between computer people and musicians. Computers have created music since 1961 when an IBM7094 sang the song Daisy Bell (later inspiring another computer, the HAL 9000, to do the same).
[Vinod.S] wanted to create music on an STM32F407 Discovery board, but he also wanted it to play on his FM radio. He did it, and his technique was surprising and straightforward. The key is that the ARM processor on the Discovery board uses an 8MHz crystal, but internally (using a phase-locked loop, or PLL) it produces a 100MHz system clock. This happens to be right in the middle of the FM radio band. Bringing that signal back out of the chip on a spare output pin gives you the FM carrier.
That’s simple, but a carrier all by itself isn’t sufficient. You need to FM modulate the carrier. [Vinod.S] did the music playback in the usual way and fed the analog signal via a resistor to the crystal. With some experimentation, he found a value that would pull the crystal frequency enough that when multiplied up to 100MHz, it would produce the desired amount of FM deviation. You can see a video of the whole thing in action, below.
Surprisingly, even this isn’t a new idea. Back in the early days of computers, it was well known that AM radios would pick up noise from an operating computer and that the right program could produce music. There’s an article about doing just that on an old Altair (although the technique predates that) and even a video of the same. Speaking of videos, there is a video of the IBM computer that would go on to inspire HAL to sing from 1961.
We cover a lot of music-oriented projects, including ones that make music humans can’t. There are plenty of regular projects, too. One word of caution: spewing out 100 MHz signals from your microcontroller might not put you on the good side of your country’s radio regulatory agency. We’d be careful designing something like this into a real product unless you were sure you knew you could pass the legal test.
27 thoughts on “ARM Board Transmits FM”
I made something similar to this using 12Mhz oscillator on my atMega board. it worked fine, but i didn’t have as pure sound as this guy had.
“You need to FM modulate the carrier.” FM == Frequency Modulation. Unless you are modulating the frequency modulator, this is a little bit redundant.
“You need to F modulate the carrier”
“You need to FM the carrier”
Yeah, doesn’t work. That’s not how abbreviations work.
You need to modulate the carrier frequency, perhaps?
“You need to frequency modulate the carrier”.
It’s fine as it is. This double-acronym nonsense (yes, it’s not an acronym unless it’s pronouncable…) is bullshit by pedants who get it wrong. It’s well established to say “ATM machine”. It’s fine. That’s how language works. It’s English, not C++. The criteria are different. Abbreviations become words in their own right, you don’t expand them in normal use. Everybody knows that, except people who aren’t as clever as they think they are.
BOLLOCKS! I meant to say “you need to FM modulate the carrier”. That’s correct, not the one I said. Doh!
Correct that bit, carry on.
You still need to apply FM to the carrier
like pin number, its redundant, but socially acceptable
I use that on an ATM Machine right ?
Good that the ATM machines don’t show your pin numbers in their LCD displays (Older ones still do have CCFL lamps for a backlight…)
In the Wikipedia Article about the German children song “Hänschen klein”, it says:
“…1958 a Z22 computer had been programmed by the employees of Konrad Zuse to sing the tune in a demonstration.” ( https://en.wikipedia.org/wiki/H%C3%A4nschen_klein )
And as far as I remember, it played the tune on its punched tape reader.
Didn’t know that one! Thanks for pointing it out.
Is it me having deja vu or it was described recently with the same photo only rotated 90° cw?
it was on http://dangerousprototypes.com a few days ago with the pic rotated
This has been available on the Raspberry Pi for a while now: http://www.icrobotics.co.uk/wiki/index.php/Turning_the_Raspberry_Pi_Into_an_FM_Transmitter
There’s also an adapted version for the Pi2 at https://github.com/markondej/fm_transmitter
Harmonic hell, again. 200 mHz is in the military air band if I recall. A harm missile will do.
Correction: Computers have *created* music since 1957 when the ILLIAC I composed the Illiac Suite. Computes have *synthesized* music since 1961 as the article states.
I beg to differ; CSIRAC in Australia synthesised first in 1950-51, almost a decade earlier.
It’s not recorded, but we still have the program.
CSIRAC is an interesting beast, because;
– It’s the only intact (but non-operational) 1st generation electronic computer
– Possibly the first interpreted language, INTERPROGRAM, was used on it in 1960
– it used 2000 valves, mostly 6SN7, 6V6, EA50 diodes and KT66s
– It ran at 1000Hz
– It had a serial main bus
– It had its own conference in 1996, dedicated to preserving not only the machine, but also a trove of documents and experiences from the engineers and scientists who designed, built and used the machine up to 1964
– There is an emulator for it (https://en.m.wikipedia.org/wiki/Emulator)
– There were games programmed for it (apparently there was a “guess 0 or 1” game a particular female tech became unusually good at despite its random nature)
– you can go and see it; it is on public display inMelbourne, including the hard drive, Mercury delay lines, input and output tape, and CRT monitors;
Okay, fair, but most musicians don’t really care about CSIRAC.
In short; make that 1950-51, on CSIRAC in Australia. A first generation computer that you can still go and see(longer post stuck in moderation I presume)
Why jerk around with the system clock frequency? That’s asking for trouble, especially if there’s a USB boot loader. There are capable timer-counters on the STM32F4 parts, maybe just diddle the preload register value instead?
Ehh. You can easily run the STM32F405 on that board at 168MHz, Then diddling with the preload register you can get frequencies like 84, 56, 42, 33.6 and lower. It is not possible to modulate the signal in the 96.3-96.35 MHz range that you need for an FM transmission. (KHz, yes, MHz, no)
you can generate a much lower frequency with a harmonic that lands in the FM band
Just a reminder, harmonics are always harmonics, fundamental frequency is powerful, that means more stronger and better range.
FM Transmitter? In “the old days” you achieved the same result with a single Transistor, today it needs a Microprocessor. At least. ;-)
You sir are a horrible person… I like your style. Besides, you got me thinking that a step up from a single transistor, the differential amplifier would help achieve FM with the right DAC. Although, I’m not sure that would be viable.
But you have to understand the trick here. To transmit a stored audio you need a memory. In this project the audio is stored in the flash of the mcu and without using even the single transistor modulator, it is able to transmit 100MHz FM audio. Doesn’t it make any sense ?
Please be kind and respectful to help make the comments section excellent. (Comment Policy)