Hi,
Some time ago I put my hands on TEA5767 chips (just two of them). Later on I was given an idea to put them to use as "detectors" in airsoft games. Using google I found two nice web sites with detailed descrition of code and what is sent to the device. These sites are:
- http://www.electronicsblog.net/arduino-fm-receiver-with-tea5767 (with code to read from device)
- Making an FM radio-Part 1; the TEA5767 | ssihla
Code I'm using right now:
#include <Wire.h>
unsigned char frequencyH = 0;
unsigned char frequencyL = 0;
unsigned int frequencyB;
double frequency = 0;
void setup(){
Wire.begin();
setFrequency();
Serial.begin(9600);
}
void loop(){
unsigned char buffer[5];
Wire.requestFrom(0x60,5); //reading TEA5767
if (Wire.available()) {
for (int i=0; i<5; i++) {
buffer[i]= Wire.read();
}
}
Serial.println(buffer[0], BIN);
Serial.println(buffer[1], BIN);
Serial.println(buffer[2], BIN);
Serial.println(buffer[3], BIN);
Serial.println(buffer[4], BIN);
Serial.println("\n");
delay(1000);
}
void setFrequency(){
Wire.beginTransmission(0x60);
Wire.write(0x2C); //1st byte 0x2CBD -> already calculated for 93.6 MHz (local radio station)
Wire.write(0xBD); //2nd byte
Wire.write(0xB0); //3rd byte
Wire.write(0x10); //4th byte
Wire.write(0xC0); //5th byte
Wire.endTransmission();
}
After uploading code to arduino start starting serial port monitor I get these (first three sets od data):
11111111
0
10010101
0
10010100
10010100
0
10010101
0
10010100
10010100
0
10010101
0
10010100
Looking at first site I found, the bufor array should be like:
bufer[0] -> FreqH
bufer[1] -> FreqL
bufer[2] -> Stereo/Mono
bufer[3] -> RX Power
bufer[4] -> not used ?
Looks like I'm getting some gibberish.
Now the question is: either I have something wrong in the code (sending wrong bytes, wrong tea5767 address) or TEA chip is simply broken.
Thanks in advance for support.
Best Regards
b.