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:
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?
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?
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...
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