As we discussed in my previous post, I am designing a radio receiver for RC submarines. I mentioned that I was concerned about dealing with the FM receiver chip's signal output. After a little research, I found out that this chip converts the transmitter signal into a relatively nice square wave. (Don't worry if you commented on my previous post. Your comments will not go to waste; they were extremely relevant and helpful for other projects I have in the works.)
Scope trace from S. Houtchen of RC Groups, who started a similar project for 72MHz receivers but abandoned it when 2.4 GHz became so prevalent. It's just too bad RC submarines cannot use 2.4 GHz. Dang you, laws of physics.
However, as I was working through this, I came across another conundrum. I'm not sure about the best solution, so I'm hoping you will have some suggestions. The STM32F3/F4 microcontroller must parse the information from the FM receiver chip, a Silicon Labs Si4704/05, into individual channels. Because the data from the chip is inherently an analog output (though the output is a square wave, it is time dependent), I need to measure the time from one rising edge to the next rising edge. Some transmitters will require measuring falling-to-falling edges. The information is encoded in a pulse that 1-2 ms long. Ideally, I would be able to discretize this to between 256 and 1,024 counts or higher. As I see it, I have three architectural options for dealing with this.
The Si4704/05 has a digital audio output signal that I could take into my STM32 chip. The problem with this is that the max equivalent audio output rate from the FM audio chip is 48 kHz. I need to time a pulse that is 1 ms second long, so I will only have ~48 counts of resolution. This is just not enough. I could attempt to offset this by essentially curve fitting the output from the FM audio chip in the STM32 and then processing this signal. This just seems like a pain and potentially computationally expensive.
The Si4704/05 has an analog output. I could sample this via the analog-to-digital converter (ADC) on the STM32. Depending on the type of STM32 chip, I will have a 2.4Msps or 5Msps ADC available. I could then set up a trigger for the timer for when the values go above a certain voltage level. Once again, this could be intensive in the controller, though I could perform some signal processing on the output from the Si4704/05. This would allow me to filter the signal to reduce noise if necessary.
A variation on the previous option is to put an analog comparator between the two chips. (Actually, the F3 variants have this on-chip.) Once the FM chip's output value exceeds a certain level, it could trigger an interrupt that starts a timer. I could even drive the comparator voltage value from the STM32's 12-bit digital-to-analog converter. This general approach seems to be the simplest, but I have never used a comparator before. This is what happens when you take a mechanical guy and let him play with electronics. In concept, comparators appear to be simple, but are there any things that make them not as simple as they may seem?
I would love to hear your thoughts on this. Please help educate me on the best architectural approach. I am eager to learn, and I promise you that, even though I have a mechanical background, I do learn fast.