<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><description>I received a handful of gift certificates for Christmas. I used one to purchase a few breakout boards, one of them an RDS5807SP-based FM radio receiver (see Amazon.com: FM Radio Receiver Module -- Arduino Compatible: Everything Else ). Alt...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Wed, 22 Mar 2017 01:26:33 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>liranwinter</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hi Tim,&lt;/p&gt;&lt;p&gt;After reading the whole post, I must say, your help and dedication here, that&amp;#39;s just amazing.&lt;/p&gt;&lt;p&gt; I have lots of problems running the tea5767 on the rpi-3. I tried an old code from an old post using rpi B+ , and it worked, but not for rpi-3, and the code is unsupported anymore.&lt;/p&gt;&lt;p&gt;I searched through a lot of places on how to run Fm radio using rpi, you acctually the only one who really studied everything to the bone... =D&lt;/p&gt;&lt;p&gt;I&amp;#39;m speachless, running step by step everything that is written here, it actually worked, even if sometimes there were some issues, they all fixed later in the next comments, which I followed and apply...&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;damn man... i bow! &lt;/p&gt;&lt;p&gt;FM radio is up and running like a charm, and I finally actually learned how to use the bus and i2c .... u should get a medal!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;couldn&amp;#39;t just use the code... I had to registering to this forum just to write u &amp;quot;Thanks&amp;quot; .&lt;/p&gt;&lt;p&gt;=)&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Tue, 20 Dec 2016 22:08:57 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>rohanxtreme</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Tim,&lt;/p&gt;&lt;p&gt;Thanks for posting the lovely article.&lt;/p&gt;&lt;p&gt;I know its a bit dated article but it really helped me understand the internals.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m using RPi3 with RASPBIAN JESSIE LITE and a .&lt;span&gt;TEA5767&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I was able to get everything setup from your article (except for the &amp;#39;&lt;span&gt;gpio load i2c&amp;#39; command which I guess is no longer used).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I get proper output with &amp;quot;i2cdetect -y 1&amp;quot; command (image attached)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;span&gt;[View:/resized-image/__size/465x197/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-141344ef-a98e-4e6f-825f-5a1f7ca05086/contentimage_5F00_177886.png:465:197]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I&amp;#39;m also able to Mute &amp;amp; Un-mute as well as check &amp;#39;status&amp;#39; using your updated code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;But the problem is, all i hear is static noise and nothing else on any frequency.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Did you encounter this issue while you were working on this project ? If so what do u think might be causing this ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;I&amp;#39;m quiet new to electronics and not very good at soldering; but if i2cdetect is giving proper output that means all the connections are correct. Do we have to do any changes to code because of the updated internals of i2c for RPi ?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Any suggestions would be highly appreciated &lt;span&gt;[View:/resized-image/__size/16x16/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-141344ef-a98e-4e6f-825f-5a1f7ca05086/contentimage_5F00_1.png:16:16]&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Mon, 29 Dec 2014 20:11:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>Former Member</dc:creator><slash:comments>3</slash:comments><description>&lt;p&gt;Thank you for your fast response. I&amp;#39;m sorry for your loss, and obviously family has priority above anything else.&lt;/p&gt;&lt;p&gt;When you have time later on, i&amp;#39;ll just put my experience here.&lt;/p&gt;&lt;p&gt;What works:&lt;/p&gt;&lt;p&gt;radio, mute, and unmute.&lt;/p&gt;&lt;p&gt;What doens&amp;#39;t seem to do anything:&lt;/p&gt;&lt;p&gt;tune&lt;/p&gt;&lt;p&gt;searchdn&lt;/p&gt;&lt;p&gt;searchup&lt;/p&gt;&lt;p&gt;Can it be that i did something wrong compiling these scripts. They don&amp;#39;t give an error, but also don&amp;#39;t change the frequence. Also no output on the screen.&lt;/p&gt;&lt;p&gt;Thank you in advance for your time.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Mon, 29 Dec 2014 03:09:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Not a problem.&amp;nbsp; Writing this code helps me practice and relearn a few things.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Syntax for the search functions is just the command (they don&amp;#39;t require arguments).&amp;nbsp; Use either command after you&amp;#39;ve already tuned to a station with &amp;quot;tune&amp;quot;.&amp;nbsp; This will cause the chip set to tune to the next (adjacent) radio station.&amp;nbsp; These might not work well if background noise is a bit high.&amp;nbsp; The chip set offers the ability to select noise levels.&amp;nbsp; I&amp;#39;ll experiment with those next.&amp;nbsp; It may take a few weeks for me to work on them.&amp;nbsp; There was a death in our family this week and my life is a bit &amp;quot;full&amp;quot; at the moment.&amp;nbsp; While you&amp;#39;re waiting: suggest running the command multiple times.&amp;nbsp; Most often the noise will be limited to only one portion of the FM band.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;Question: did you have to install wiringPi or did the code work without it?&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Sun, 28 Dec 2014 21:50:09 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I want to thank you for this great piece of software. I just installed my radiochip, and it worked like a charm. To tune to a channel works directly, muting works. But what i can&amp;#39;t do is use the searchup and searchdn functions. I don&amp;#39;t know how to use them, can you please give me an example of the syntax. I have never programmed in C, and i really don&amp;#39;t understand what arguments i need to give. Without arguments nothing seems to happen. Thank you in advance for your help.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Fri, 26 Dec 2014 11:36:41 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Merry Christmas to you also.&amp;nbsp; I&amp;#39;ve attached my code to the original post (scroll up from here).&amp;nbsp; It&amp;#39;s a bit klugy but it works.&amp;nbsp; It should also work for the TEA5767/TEA5768 chip sets and (possibly) other chip sets in the RDA5807 series.&amp;nbsp; I want to play with the RDA5807M next, if I can find one.&amp;nbsp; If not, I have a Si4703 that performs the same function.&amp;nbsp; It&amp;#39;s only drawback is that it lacks the I2C interface, which means I&amp;#39;ll have to solder connectors and learn to program a new interface (would like to become a bit more comfortable with the I2C interface first).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Better organized notes on the RDA5807SP coming shortly.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Thu, 25 Dec 2014 13:04:48 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>Former Member</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hello there and Merry Christmas!&lt;/p&gt;&lt;p&gt;I&amp;#39;m not waiting but keep on following very careful your interesting posts and emails.&lt;/p&gt;&lt;p&gt;Time is on our side :-)&lt;/p&gt;&lt;p&gt;Happy new year with peace, health and love!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Mon, 22 Dec 2014 02:19:42 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I now have working code for mute, unmute, and for searching upward/downward, as well as for tuning the radio and querying the frequency.&amp;nbsp; Once I&amp;#39;d relearned enough of bitwise operators and figured out the mute function, the other three (unmute, searchup, searchdn) were easy.&amp;nbsp; Will write up the notes and attach the code to a new blog post (can&amp;#39;t attach codes to comments such as these).&amp;nbsp; de viant, you still waiting on me?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Mon, 22 Dec 2014 01:24:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Proof of concept: status&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Following reads the registers in the chip, extracts the PLL word from the first two registers, and calculates the frequency to which the radio is tuned.&amp;nbsp; Save the following as &amp;quot;status.c&amp;quot;.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;#include &amp;lt;wiringPi.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;wiringPiI2C.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;//compile with gcc -lwiringPi -o status status.c&lt;/p&gt;&lt;p&gt;int main( int argc, char *argv[]) {&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; unsigned char radio[5] = {0};&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; int fd;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; int dID = 0x60; // i2c Channel the device is on&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; double frequency = 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; //open access to the board, send error msg if fails&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; if((fd=wiringPiI2CSetup(dID))&amp;lt;0){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&amp;quot;error opening i2c channel\n\r&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; read(fd,radio,5);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; frequency=((((radio[0]&amp;amp;0x3F)&amp;lt;&amp;lt;8)+radio[1])*32768/4-225000)/100000;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; frequency= ((int)(frequency*10+5)/100.0);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; printf (&amp;quot;Frequency = &amp;quot;); printf(&amp;quot;%.1f\n&amp;quot;,frequency);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; close(fd);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; return 0;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Sun, 21 Dec 2014 04:05:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;What I need to do with the above code is to figure out how to concatenate the PLL word and push it back through the frequency calculation, This will involve undoing the bitwise AND and the bitwise shift (occurs in the frequencyH and frequenceL lines).&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For anyone else that wants to experiment, the RDA5807SP chip appears to be a drop-in replacement for the TEA5767.&amp;nbsp; This is a good thing as most of the RDA5807SP documentation is in Chinese, while the docs for the TEA5767 are available in English.&amp;nbsp; To figure out which registers do what, visit the following link and search for the section entitled &amp;quot;I2C Registers&amp;quot;.&amp;nbsp; Note that both chips have separate formats for writing and reading the registers.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a class="jive-link-external-small" href="http://developer.mbed.org/users/edodm85/notebook/radio-fm-tea5767/" rel="nofollow ugc noopener" target="_blank" title="http://developer.mbed.org/users/edodm85/notebook/radio-fm-tea5767/"&gt;http://developer.mbed.org/users/edodm85/notebook/radio-fm-tea5767/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The formula for calculating the PLL word (the one that I need to reverse) is at:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a class="jive-link-external-small" href="https://www.electronicsblog.net//wp-content/uploads/pllcalculation.png" rel="nofollow ugc noopener" target="_blank" title="https://www.electronicsblog.net//wp-content/uploads/pllcalculation.png"&gt;https://www.electronicsblog.net//wp-content/uploads/pllcalculation.png&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I think the Arduino code at the following link will reverse the PLL word (needs conversion to wiringPi syntax and experimentation):&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a class="jive-link-external-small" href="https://www.electronicsblog.net/arduino-fm-receiver-with-tea5767/" rel="nofollow ugc noopener" target="_blank" title="https://www.electronicsblog.net/arduino-fm-receiver-with-tea5767/"&gt;https://www.electronicsblog.net/arduino-fm-receiver-with-tea5767/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;More detail on the tea5767 registers is available at:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;a class="jive-link-external-small" href="http://www.rockbox.org/wiki/pub/Main/DataSheets/application_note_tea5767-8.pdf" rel="nofollow ugc noopener" target="_blank" title="http://www.rockbox.org/wiki/pub/Main/DataSheets/application_note_tea5767-8.pdf"&gt;http://www.rockbox.org/wiki/pub/Main/DataSheets/application_note_tea5767-8.pdf&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If anyone&amp;#39;s working on this breakout board, and is ahead of me code-wise, please share.&amp;nbsp; Otherwise, I&amp;#39;ll keep playing with this.&amp;nbsp; It&amp;#39;ll be slow going, as classes start up again soon, but I&amp;#39;ll keep working on it as time becomes available.&amp;nbsp; The docs indicate that there&amp;#39;s a version of the chip (RDA5807M?) that has a RDS function.&amp;nbsp; I&amp;#39;d love to have that working too.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Sun, 21 Dec 2014 03:33:39 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;It&amp;#39;s cheesy but I have a working mute function (see the code below).&amp;nbsp; It&amp;#39;s safe to leave out any line containing &amp;quot;mine&amp;quot; and/or the collection of commented out printf functions.&amp;nbsp; They&amp;#39;re there for my experimentation.&amp;nbsp; Basically, I&amp;#39;ve added a second argument to the command line, so if you wanted to tune to 98.7 MHz, you&amp;#39;d use &amp;quot;radio 98.7 0&amp;quot; to tune to the station and &amp;quot;radio 98.7 1&amp;quot; to mute it.&amp;nbsp; This is horrible code as it&amp;#39;s a poor work-around (follow the logic in the code and you&amp;#39;ll see) and I&amp;#39;m having to relearn C programming after 20 years.&amp;nbsp; That said, it works (at least for 98.7 MHz).&amp;nbsp; I&amp;#39;ll republish updates to the code here as I improve my coding skills.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;#include &amp;lt;wiringPi.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;wiringPiI2C.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/p&gt;&lt;p&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;int main( int argc, char *argv[]) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; printf (&amp;quot;RPi - RDA5807SP FM Tuner v0.1 \n&amp;quot;) ;&lt;/p&gt;&lt;p&gt;&amp;nbsp; unsigned char radio[5] = {0};&lt;/p&gt;&lt;p&gt;&amp;nbsp; unsigned char mine[5] = {0};&lt;/p&gt;&lt;p&gt;&amp;nbsp; int fd;&lt;/p&gt;&lt;p&gt;&amp;nbsp; int dID = 0x60; // i2c Channel the device is on&lt;/p&gt;&lt;p&gt;&amp;nbsp; unsigned char frequencyH = 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp; unsigned char frequencyL = 0;&lt;/p&gt;&lt;p&gt;&amp;nbsp; unsigned int frequencyB;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; //read the frequency from the command line&lt;/p&gt;&lt;p&gt;&amp;nbsp; double frequency = strtod(argv[1],NULL);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; //read from the command line if output should be muted?&lt;/p&gt;&lt;p&gt;&amp;nbsp; int muted = strtod(argv[2],NULL);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; //calculate the PLL word and split it between the first and second bytes&lt;/p&gt;&lt;p&gt;&amp;nbsp; frequencyB=4*(frequency*1000000+225000)/32768; //calculating PLL word&lt;/p&gt;&lt;p&gt;&amp;nbsp; frequencyH=frequencyB&amp;gt;&amp;gt;8;&lt;/p&gt;&lt;p&gt;&amp;nbsp; frequencyL=frequencyB&amp;amp;0XFF;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; printf (&amp;quot;Frequency = &amp;quot;); printf(&amp;quot;%f&amp;quot;,frequency);&lt;/p&gt;&lt;p&gt;&amp;nbsp; printf(&amp;quot;\n&amp;quot;); // data to be sent&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; if(muted==1){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; frequencyH=0x80;&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; radio[0]=frequencyH; //FREQUENCY H&lt;/p&gt;&lt;p&gt;&amp;nbsp; radio[1]=frequencyL; //FREQUENCY L&lt;/p&gt;&lt;p&gt;&amp;nbsp; radio[2]=0xB0; //3 byte (0xB0): high side LO injection is on,.&lt;/p&gt;&lt;p&gt;&amp;nbsp; radio[3]=0x10; //4 byte (0x10) : Xtal is 32.768 kHz&lt;/p&gt;&lt;p&gt;&amp;nbsp; radio[4]=0x00; //5 byte0x00)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; if((fd=wiringPiI2CSetup(dID))&amp;lt;0){&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf(&amp;quot;error opening i2c channel\n\r&amp;quot;);&lt;/p&gt;&lt;p&gt;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; write (fd, (unsigned int)radio, 5) ;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; //read(fd,mine,5);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;r0 %u\n&amp;quot;,radio[0]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;m0 %u\n&amp;quot;,mine[0]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;r1 %u\n&amp;quot;,radio[1]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;m1 %u\n&amp;quot;,mine[1]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;r2 %u\n&amp;quot;,radio[2]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;m2 %u\n&amp;quot;,mine[2]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;r3 %u\n&amp;quot;,radio[3]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;m3 %u\n&amp;quot;,mine[3]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;r4 %u\n&amp;quot;,radio[4]);&lt;/p&gt;&lt;p&gt;&amp;nbsp; //printf(&amp;quot;m4 %u\n&amp;quot;,mine[4]);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; close(fd);&lt;/p&gt;&lt;p&gt;&amp;nbsp; return 0;&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Sun, 21 Dec 2014 01:59:02 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;One thing that I managed to omit in the above is loading of the i2c modules.&amp;nbsp; Add the following two lines to the /etc/modules:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; i2c-bcm2708&lt;/p&gt;&lt;p&gt;&amp;nbsp; i2c-dev&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;If you want to load them without rebooting, run the following (as root):&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; modprobe i2c-bcm2708&lt;/p&gt;&lt;p&gt;&amp;nbsp; modprobe i2c-dev&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Fri, 12 Dec 2014 12:35:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>packetgeek</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Will attempt to work on it this weekend.&amp;nbsp; I&amp;#39;m switching jobs in the near future and the planned free time over the holidays has evaporated.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Will keep y&amp;#39;all posted.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;- Tim&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Controlling the RDA5807SP FM Radio Receiver with the Raspberry Pi</title><link>https://community.element14.com/members-area/personalblogs/b/blog/posts/controlling-the-rda5807sp-fm-radio-receiver-with-the-raspberry-pi</link><pubDate>Thu, 20 Nov 2014 06:47:45 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:141344ef-a98e-4e6f-825f-5a1f7ca05086</guid><dc:creator>Former Member</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;very nice and clear project!&lt;/p&gt;&lt;p&gt;but i have a question: how it stops running? just because i drive 2 different sound outputs as input to amplifier and want every time to be &lt;span&gt;active &lt;/span&gt;just one of them .&lt;/p&gt;&lt;p&gt;for me, until now, it&amp;#39;s impossible to stop running radio, even i shutdown RPi. To stop it i must shutdown the RPi and disconnect it power from power supply.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;help please!&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16949&amp;AppID=293&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>