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.

Circuit question - dsPIC based frequency counter

Status
Not open for further replies.

sgergo

Junior Member level 1
Joined
Mar 23, 2010
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,432
Circuit question

Hi!

I'm working on an oscillator circuit with a dsPIC based frequency counter. The oscillator circuit is working nicely with a crystal of 5 MHz. I can see a nice pulse wave on the scope with 3.8V amplitude.

The frequency counter is a simple one: I am counting the edges on T2CK pin of the MCU for 1 second and display it on the attached LCD. If I connect the oscillator output to T2CK I can read the frequency on the LCD.

However, if I change the crystal to a 3.xyz MHz one the counter goes crazy. After checking the oscillator output on the scope I thought that maybe the T2CK input needs a more "square" signal so I created the following circuit:

**broken link removed**

First (1. step) I checked the output of the gate IC which looked nice with an amplitude of 4.8V DC (with the 5 MHz crystal). When I connected its output to the PIC's T2CK (2. step) I could see the waveform distorted and the amplitude decreased to 1.8x V which is below the logical high level of the T2CK input. The counter showed 0 Hz, respectively.

My next thought was inserting a buffer (3.step) between the gate and the PIC so I fished out a wide bandwith opamp, LT1190. I checked its output with the scope and found that it outputs a useless, totally distorted signal.


Now I'm out of ideas so any help or tip is much appreciated.



Here are the datasheets to make life easier:


http://cds.linear.com/docs/Datasheet/1190fa.pdf

http://focus.ti.com/lit/ds/symlink/sn74hc132.pdf

http://ww1.microchip.com/downloads/en/DeviceDoc/70138F.pdf
 

The HC132 should happily drive a dsPIC digital input so if the signal is fine on the 'scope until you connect it to the PIC then it sounds like something is wrong that won't be fixed by further buffering - but I guess you have found that out.

Is the PIC input correctly configured? A bad waveform could be a clash - output trying to drive another output.

I would remove the LT1190 - it certainly shouldn't be required and will just confuse things.

Have you good decoupling everywhere? Have you checked all the supply voltages are sound and the correct voltage when operating?

Keith
 

    sgergo

    Points: 2
    Helpful Answer Positive Rating
Hi Keith,

problem solved just before your reply, but you had a very close hit. It was the usual story: the PIC's T2CK pin had not been configured as input.... :oops:

The funny thing that it worked without being configured, at least around 5 MHz, well hiding my sloppiness.

Thanks anyway!
 

Glad its sorted. Now you can remove all the extra circuitry you added trying to persuade the PIC output that it really should be an input!

Keith
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top