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.

3.3V pic counting arbitraty voltage impulses

Status
Not open for further replies.

Garyl

Full Member level 5
Joined
Mar 28, 2017
Messages
253
Helped
6
Reputation
12
Reaction score
7
Trophy points
18
Activity points
2,633
Hey
I have a working counter-based impulse/freq counter on PIC24F
It's a 3.3V device.
Now I want to counter 8V or so impulses.
I tought that I will use a single transitstor amplifier (I saw such solution on web).
Here is the schematic:
SCHEM.png
I have selected the resistors so there is around 1.65V on the collcetor and connected it to PIC pin, but then the voltage drops to 0.
I have confirmed it with oscliscope.
Why is it happening?
 

Hi,

Usually a PIC input pin wants logic levels. Either true High or true Low.Not a voltage inbetween.Not 1.65V.

Use a simple comparator, maybe with hystetesis to generate digital signals.
Don't use an analog amplifier.

Klaus
 

Usually a PIC input pin wants logic levels. Either true High or true Low.Not a voltage inbetween.Not 1.65V.
Do you know how the schematic is supposed to work? Without a base signal, there is a 1.65V (3.3V / 2) on PIC, but when the base is biased, it switches to low/high levels.

I have figured it out.
It is working now.
The schematic and idea was correct, the problem was that I was missing the:
Code:
  TRISB = 0xff;
line in the code. For some reasons, it changed the port behaviour (altough I am using hardware timer counter) and now it counts impulses correctly!
But does anyone know why?

PS: It worked without that line in Proteus...
 

Hi,

Do you know how the schematic is supposed to work? Without a base signal, there is a 1.65V
Yes, I understand it's operation.

But with many inputs it is no good habit to give 1.65V to it. 1.65V is no valid logic level.
* increased power supply current
* undefined, even oscillating input may happen.

For sure it may work now, but don't be surprised if it doesn't work....after some time, at different temperature, with another IC...

Klaus
 

You don't specify which of the many PIC24 MCUs you are using but picking a 3.3V one at random (the PIC24FJ256DA210), the 'high' input is between 0.7Vdd and 0.8Vdd - which equates to 2.3V or 2.6V.
If you happen to select one of the "I/O pins with TTL buffer: with analog functions" (DI21 in table 30-7) then the "0.25Vdd+0.8V" does give a minimum (*minimum* mind you) of 1.625V but I sure would not want to put that into any of my products.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top