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
302 stars 92 forks source link

Setting volume on RDA5807 in quick succession causes corruption in registers #51

Open synth opened 3 years ago

synth commented 3 years ago

Hi Matthias!

First, Thank you very much for your support of these libraries! I am very happy to see these in active(ish) development 👍

I am using RDA5807 chip with a custom PCB. The frequency and volume of the RDA are controlled with a rotary encoder. When we turn the rotary encoder too quickly, there are times when it causes corruption in the registers (such as changing the frequency to an invalid value). I have tried to create a critical section using sei/cli to turn off interrupts just in case, but that did not make much of a difference.

I have several of these pcb's and this issue occurs on only one of them which may indicate some electrical issue perhaps thats corrupting the registers somehow.

Do you have any additional thoughts on why this might occur?

Also, can you perhaps recommend a way to do "error correction"? In other words, I can currently do something like radio.getFrequency and detect that it's different from what my sketch expects it to be. Once I detect this, is there a way to "reset" the registers to known values? (I tried to term and then init but that caused even more problems.

Thanks!