Help with using op amp as a sine-to-square converter!


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Jan 2009
    Location
    Huntsville, AL
    Posts
    36

    Default Help with using op amp as a sine-to-square converter!

    I'm developing an audio frequency radio modem, and have a problem I was hoping some of the gurus here could help me with. I greatly appreciate any help that can be provided!

    In short, the modem will be used across a wide temperature range. To prevent oscillator drift, I've include the ability for it to 'tune' itself. The sine wave output can't be used with the count function (it doesn't reach the threshold voltage required for a high-to-low transition). So to calibrate the frequency, an op amp is fed the sine wave in one input and a 2.5V reference is fed into the other input to construct a square wave. The "count" function is used on the square wav. The audio frequencies I'm sampling are between 1.5 and 3 kHz. I'm using a 16F628a with a 20MHz xtal. 'Tuning' is implemented by adjustment of digital pots that act as trimmers in the oscillator.

    Attached is a basic schematic of how I'm implementing it.

    It starts off working great, but after a few minutes, sometimes it starts returning count values of 0. My questions are: have I correctly implemented the sine-to-square wav converter for use with the 16F628a? Is porta.2 have some quirks that make it bad for use with the count function? Are the resistance values I'm using on either side of the op amp satisfactory?

    Any help is greatly appreciated!

    Thanks in advance!
    Dave
    Attached Images Attached Images  

Similar Threads

  1. To Generate Sine Wave Using PCPWM of PIC18F4331 (Issue)
    By Cyborg in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd March 2014, 13:39
  2. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  3. square to sine wave help
    By TONIGALEA in forum General
    Replies: 6
    Last Post: - 2nd July 2006, 09:32

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts