The program for this fm receiver circuit performs the following functions:
1. Initialising the TEA5767 module
2. Writing the data to TEA5767 module
3. Reading the TEA5767 module values
4. Displaying information on the LCD screen
5. Scanning available FM channels
6. Increasing or decreasing the frequency by a unit defined value of particular MHz.
The source program is well commented, which can be seen by opening the file in Arduino software.
Writing data to TEA5767
The useful details about writing the byte and reading the byte can be obtained from page numbers 13 through 16 of the datasheet (Rev.5).
This is used to start I2C communication with the TEA5767 module
The address of TEA5767 is 0x60 during writing
The address of TEA5767 is 0x61 during reading
This is used to send data to the I2C device byte by byte
The significance of various bytes in TEA5767 is also mentioned on page numbers 13 through16 of its datasheet. The data byte sequence for the write mode is shown in Fig. 4; the remaining detail can be found in the datasheet.
Bitwise operators used for programming the first two bytes of TEA5767 are explained below:
& (bitwise and)
| (bitwise or)
^ (bitwise xor)
~ (bitwise not)
<< (bitshift left) >> (bitshift right)
Since structures of the first and the second bytes are different, different bitwise operators are used.
In read mode, we have to note the following changes:
1. When a station is found in search mode, as instructed during write operation, the ready flag (RF) in first byte is set to 1. That is, RF=1
2. The values of signal strength level in 4th byte
3. Stereo or mono reception in 3rd byte
For reading the values from TEA5767, the following method is used in the code by creating a buffer as follows:
Buffer [i]= Wire.read ();
Wire.read (); is used to read the values of all the five bytes in Read mode.
Displaying values on LCD screen
The task of displaying values is performed by reading the values of bytes of the TEA5767 in read mode.
1. The available frequency is displayed on LCD screen by reading first byte stored in buffer(0); this value is stored in buffer during read operation
2. If search mode is high, a scan is displayed on the screen
3. The signal strength is stored in the 4th byte which can be obtained by reading the buffer(3)
4. The reception type is displayed on screen by reading the buffer(3).