Have been seeing various people complain about issues with the search function on TEA5767-based breakout boards. It's a problem that doesn't show up in RD5807SP breakout boards when run in emulated TEA5767 mode.
I bought one of the boards and was able to duplicate the problem. While researching the problem, I came across the following in a moderately-good translation of the TEA5767 spec sheet, discussing TEA5767 boards such as the one that I have:
"The choice of 32768Hz reference frequency makes it possible to use a cheap 32.768kHz watch crystal. A drawback of these clocks is that they have a very high second order temperature coefficient. This may result in de-tuning the radio or a search action may fail. Care should be taken when using this crystal. The accuracy of the 32768Hz crystal can be checked by tuning the radio to 81.4 MHz with high/low side injection and reading the IF via the bus. The IF must be 37Hex. An other issue when using this crystal is the grid position. It is not possible to create a 100kHz grid position, but 98.304kHz (3*32768Hz). This should not be a problem if this is resolved in software."
Taking this last recommendation, I wrote a couple search functions in software. As usual, they're a bit cheesy as they are "quick" solutions. They rely solely on signal level, which means for very strong stations, you may need to re-run the search function for the detected station to be centered. A better way would be to check the signal level AND the IFF frequency. Don't know if this is possible and don't really have the time to pound on it. Anyone care to work on it?
In any case, attached are the two new search functions. I've left all of the print functions enabled to show what's going on. Tweak 'em as you see fit. Instructions for compiling are in the code. Also, please note that I've removed the dependency on wiringPi.
- Tim