In my previous blog
"Using Velleman K8076/VM134 PIC-programmer with Microchip's Library of Applications: USB programming basics", I made a start with a PIC18F4550 USB scope. In this blog I will write about my experience with capturing the signal of a 555-timer IC.
Below you see the schema of an astable multi vibrator.
- The charging time of C1, t1 = 0.693(R1+R2)C1 = 0.693(10k+100k) * 1µF = 0.0762s
- The discharging time C2, t2 = 0.693(R2)C1 = 0.693(100k) * 1µF = 0.0693s
- The total timer per period T= t1 + t2 = 0.0762s + 0.0693s = 0.1455s
- The frequency of the signal is 1/T = 1/ 0.1455s = 6.87Hz
Which is about 7Hz (the tolerance of the resistors =10%, so it wouldn't make sense to express the frequency with such an accuracy.
I connected the output of the timer IC to pin 2 (= AN0, configured as analog input). So what do we see in the 'scope'-program?
What do we see here? Is this the 7Hz signal of the 555-timer? Is seems there is a problem in the A/D-conversion process.
So digging into the specs of both the PIC18F4550 and 555 timer might explain the problem:
The maximum recommended impedance for analog input sources is 2.5k. So what is the output impedance of a LM555 at 7Hz?
I couldn't find a clear answer on the net. So I decided to buffer the output signal with an emitter follower circuit. An emitter follower has low output impedance and high input impedance. See schema below.
This looks much better. Now let's change the HIDpnpdemo a little bit such that the program can actually be used as a simple scope.
With the new program, I can scale, offset and toggle between frequency or 1/frequency. The above image shows that the signal period is about 152 msec which is about 6.6Hz. Not bad, is it?