Design Con 2015
Breaking News
Comments
Newest First | Oldest First | Threaded View
antedeluvian
User Rank
Blogger
Comparator
antedeluvian   8/13/2014 11:13:12 AM
NO RATINGS
Adam

This general approach seems to be the simplest, but I have never used a comparator before. ... In concept, comparators appear to be simple, but are there any things that make them not as simple as they may seem?


Comparators are indeed simple to use. The only area of concern is when the signals are close in value (or you have a very slow rising/dropping waveform). You can get a chatter of the output in that region. A hysteresis technique is usually used to stop this. If the STM32 has internal comparators you could achieve this in software by driving the one comparator input with a D/A and when the switch occurs, modifying the D/A value up or down as necessary. Traditionally though the output is fed back through a network of resistors to shift the comparator input voltage slightly. Here is an Analog Devices app note on the subject. Google "comparator hysteresis" for more.

antedeluvian
User Rank
Blogger
Timer/Counter
antedeluvian   8/13/2014 11:02:38 AM
NO RATINGS
Adam

Option 1
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



Forgive me if I am about to describe a technique that you have already described or have discounted. You could set up an internal counter with as fast a clock as you like. Then use the digital audio output signal to gate the counter so it only counts while the signal is high. You could get a much better resolution that way. With flip flops you could make it edge sensitive or counters for both the positive signal and the negative signal would allow you to measure between successive positive (and negative edges). I do hope the counters in the STM32 allow for this.

{Added after 5 minutes} I see arshs has provided the same solution while I was typing.

arshs
User Rank
Rookie
Alternative solution
arshs   8/13/2014 10:55:22 AM
NO RATINGS
Hi,

 

There is another alternative that I have implemented in the past for exactly the same situation.

You can use a Timer Input Capture function to capture the rising and falling edges of the digital pulse signal. Depending of the Timer time base, you can have a very fine resolution.


The Input Capture function from the timer "captures" the Timer count at the moment of the rising and/or falling edge. Usually, an interrupt is generated and the captured value is saved in an array for post processing.


After the message has finished transmitting, the array of counts (times) contains a series of times that is a representation of the 1's and 0's of the message. You would need a function to convert the times to bits (based on the bit rate or time per bit), and recover the message.

 

If the data output signal from the transceiver is square wave 0V to 3V amplitude, you don't need a comparator, because the signal can be connected directly to a MCU pin (a pin with input capture alternative function). Otherwise, the comparator is required to convert the transmitted signal to the right levels.

 

Max The Magnificent
User Rank
Blogger
I'm thinking...
Max The Magnificent   8/13/2014 10:40:30 AM
NO RATINGS
I'm thinking the comparator is a good idea -- you could use transitions on the output to generate interrupts to start and stop a background timer in the MCU -- thereby freeing up the MCU for other tasks.



Top Comments of the Week
Flash Poll
Like Us on Facebook

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
EE Life
Frankenstein's Fix, Teardowns, Sideshows, Design Contests, Reader Content & More
Carlos Bueno

Adventures in Userland
Carlos Bueno
Post a comment
Editor’s Note: Excerpted from Lauren Ipsum: A story about computer science and other improbable things, author Carlos Bueno introduces us to Lauren and her adventures in ...

Max Maxfield

Tired Old iPad 2 vs. Shiny New iPad Air 2
Max Maxfield
9 comments
I remember when the first iPad came out deep in the mists of time we used to call 2010. Actually, that's only four years ago, but it seems like a lifetime away -- I mean; can you remember ...

Martin Rowe

Make This Engineering Museum a Reality
Martin Rowe
Post a comment
Vincent Valentine is a man on a mission. He wants to make the first house to ever have a telephone into a telephone museum. Without help, it may not happen.

Rich Quinnell

Making the Grade in Industrial Design
Rich Quinnell
16 comments
As every developer knows, there are the paper specifications for a product design, and then there are the real requirements. The paper specs are dry, bland, and rigidly numeric, making ...

Special Video Section
The LT8640 is a 42V, 5A synchronous step-down regulator ...
The LTC2000 high-speed DAC has low noise and excellent ...
How do you protect the load and ensure output continues to ...
General-purpose DACs have applications in instrumentation, ...
Linear Technology demonstrates its latest measurement ...
10:29
Demos from Maxim Integrated at Electronica 2014 show ...
Bosch CEO Stefan Finkbeiner shows off latest combo and ...
STMicroelectronics demoed this simple gesture control ...
Keysight shows you what signals lurk in real-time at 510MHz ...
TE Connectivity's clear-plastic, full-size model car shows ...
Why culture makes Linear Tech a winner.
Recently formed Architects of Modern Power consortium ...
Specially modified Corvette C7 Stingray responds to ex Indy ...
Avago’s ACPL-K30T is the first solid-state driver qualified ...
NXP launches its line of multi-gate, multifunction, ...
Doug Bailey, VP of marketing at Power Integrations, gives a ...
See how to ease software bring-up with DesignWare IP ...
DesignWare IP Prototyping Kits enable fast software ...
This video explores the LT3086, a new member of our LDO+ ...
In today’s modern electronic systems, the need for power ...