Author Topic: Using a sinewave OCXO as a timer input source  (Read 698 times)

0 Members and 1 Guest are viewing this topic.

Offline g0mgxTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: gb
Using a sinewave OCXO as a timer input source
« on: April 30, 2020, 12:58:21 pm »
Hi Gang

I want to use a 10 MHz OCXO oscillator as an input to a STM32 clock; the oscillator swings +/- 2V and I need to convert this to a square wave 0-3.3V.

I've tried using a simple comparitor but the circuit fails over about 1Mhz, I've tried a simple transistor switch feeding a 74HC04 gate x 3 but still there is a lot of junk in the output signal.

Can anyone suggest an easy way to convert my sine wave into a logic level square easily?

I'm struggling with what should be a very simple circuit.

Many thanks

Mark
G0MGX
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1113
  • Country: lt
Re: Using a sinewave OCXO as a timer input source
« Reply #1 on: April 30, 2020, 01:34:03 pm »
The simplest what comes to my mind (may not be best, but should be ok). I assume you need 3.3V logic out. Notice a schmitt trigger input inverter. You can choose freely (but it needs to be fast enough), for eg. SN74LVC1G14.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3378
  • Country: nl
Re: Using a sinewave OCXO as a timer input source
« Reply #2 on: April 30, 2020, 01:39:44 pm »
Are you sure you need a square wave?
Virtually all uC's are designed to run from a crystal, and have therefore already the circuitry inside to run from a sinewave.
Go read the datasheet of your STM32 again and look at the different options for the clock input.
 
The following users thanked this post: g0mgx

Offline g0mgxTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: gb
Re: Using a sinewave OCXO as a timer input source
« Reply #3 on: April 30, 2020, 01:42:52 pm »
Thanks - I'll look at the datasheet again - a riveting read.

How worried do I need to be about the logic level? THe sinewave is +/-2V and the TIM input is 0-3.3V?

Mark
 

Offline g0mgxTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: gb
Re: Using a sinewave OCXO as a timer input source
« Reply #4 on: April 30, 2020, 01:43:39 pm »
Thanks.

Is that LTSpice? I keep seing this again and again - must read up.

Mark
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1113
  • Country: lt
Re: Using a sinewave OCXO as a timer input source
« Reply #5 on: April 30, 2020, 02:15:38 pm »
Thanks - I'll look at the datasheet again - a riveting read.

How worried do I need to be about the logic level? THe sinewave is +/-2V and the TIM input is 0-3.3V?

Mark

So you want this 10Mhz for clock or timer input? Anyway, yes, you should worry about levels, to not hit negative or positive above Vdd.

If you plan to run a coax from 10Mhz source or there will be considerable distance you should also take care about impedance matching.
 

Offline g0mgxTopic starter

  • Regular Contributor
  • *
  • Posts: 69
  • Country: gb
Re: Using a sinewave OCXO as a timer input source
« Reply #6 on: May 01, 2020, 01:23:26 pm »
So you want this 10Mhz for clock or timer input?

Yes indeed, I'm trying to teach myself STM32Cube programming (having migrated from STM32 on Arduino) - I am trying to write an algorithm to discipline the OCXO from a 1PPS GPS signal.

Its just a technical learning exercise but kind of fun.

Mark
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf