mathertel / Radio

An Arduino library to control FM radio chips like SI4703, SI4705, RDA5807M, TEA5767.
http://mathertel.github.io/Radio
BSD 3-Clause "New" or "Revised" License
300 stars 91 forks source link

SNR and CNT functions not working with Si4703 #9

Closed heisenberg1995 closed 1 year ago

heisenberg1995 commented 8 years ago

Hi, Thanks for the great library! I am using an Si4703 with an Arduino Uno. The RSSI functionality works great but there seems to be a problem with the SNR. It always shows 0. Have you disabled it by any chance? If yes, how do you enable it? I would also appreciate if you could tell me how to access the SKCNT data.

fungreenfox commented 4 years ago

With this Si4703 (not breakout version), SNR is at value, add the RADIO_INFO ri; before readout.

void radioSNR() { // ***** SNR signal ** unsigned long SNRnow = millis(); static unsigned long SNRnextDispTime = 0; static unsigned long SNRnextFREQTime = 0; if (SNRnow > SNRnextFREQTime) { SNRnextFREQTime = SNRnow + 1; } // update the ri.snr from time to time if (SNRnow > SNRnextDispTime) { SNRnextDispTime = SNRnow + 1000; Serial.print("Radio SNR"); Serial.println(SNRnextDispTime); //radio.getRadioInfo(&ri); RADIO_INFO ri; uint16_t Snr = ri.snr; tft.setTextColor(WHITE, BLACK); tft.setTextSize(2); tft.setCursor(375, 220); tft.print(F("SNR ")); if (ri.tuned) { if (Snr <= 9) { tft.print(F(" ")); } if (Snr >= 1) { tft.print(Snr); } Serial.println(Snr); if (Snr == 0) { tft.print(F(" ")); } } SNRnow = 0; } }

fungreenfox commented 2 years ago

The void has been tested and works.

mathertel commented 1 year ago

SI4703 doesn't support reading the SNR via I2C. AS of the manual it is used internally while scanning only.