Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reading opamp output from a GPIO

Status
Not open for further replies.

chris43j

Newbie level 2
Newbie level 2
Joined
Apr 13, 2017
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
19
This is probably just some very basic concept I am missing but it driving me up the wall. Basically what I want to do is determine the frequency of a signal using an MSP430. I have written the code and it works when I connect my oscilloscope 1kHz output to it. However, what I really want to do is to read the frequency of a sine wave I have generated using an oscillator circuit. I pass it though an opamp which goes rail-to-rail (ie from 0 to 3.5V - same as the micro) and the output to the GPIO. However, the micro doesn't seem to register anything. I thought reading a GPIO input is simply a voltage. If the voltage swing is big enough it is should read it as a 0 or 1 regardless the shape of the waveform no?
 

Hi,

A GPIO is not meant to read sine waveform.
The microcontroller specifications show V_IH and V_IL.
The signal should not be inbetween both levels, best if the signal is close to either supply rails.

Use a comparator pin or use an external comparator to generate a digital signal.

Klaus
 
That seemed to work. Was pretty straight forward to set up actually. I ended up using the onboard comparator which can can feed into the timer capture input. Thanks!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top