|
|
Ultimate luxus for Geeks : How to turn your hi-tech expensive oscilloscope into a digital clock, with only a PIC and four resistors ! Works with vintage $10 Ebay oscilloscopes too... |
Something different on the screen
Googling the web, I was pretty sure to find tons of oscilloscope clocks, but in fact they are not that many.
I found some commercial products, very clean works, like for example :
http://www.franktechniek.nl/Kits/oscilloscopeclock/oscilloscopeclock.htm
http://dutchtronix.com/ScopeClock.htm
There is also this transparent clock :
http://www.retrothing.com/2006/06/the_oscilliscop.html
very nice, but the only thing it has from an oscilloscope is its cathode ray tube.
I wanted to build something simpler, that everybody could test on its own oscillocope in 5 minutes, with just a little PIC and a few resistors.
Basic concept
For those are not into electronics, you must know that an oscilloscope has basicaly only one timebase to move the spot horizontaly from left to right with the same intensity. The vertical deviation is function to the input voltage. You understand immediately that you can't directly display 7 segment digits, because you can't move the spot from right to left.
By using X/Y mode, where the spot is controlled on two axes by two different voltages, it is possible to draw a picture (as in the examples mentioned above), but a fast digital to analog converter with two channels and at least 8 bits of resolution would be needed.
So we have to deal with a spot that always goes from left to right in the same period of time.
If we want to have a 7segment-like display, we have to draw :
By using 2 PIC outputs and a basic R2R digital to analog converter, we can have up to four different voltage levels : 3 for the vertical segment, and another one where to put the spot when it is not in use to draw a segment.
But the problem is that a 7 segment digit may have up to 3 horizontal lines at a time (like 2, 3, 8, 9..) but we can draw only one during one spot deviation.
So we will have to cheat with retinal persistance and use multiple frames : since we can have only one vertical segment per period, three periods will be needed to draw a full 7 segment digit.
Supposing we want to display 12:34:56 on the screen :
|
During the first period, we will draw all vertical segments, and horizontal upper segments only : As a game, I let you try to find out the spot trajectory.
But you can move so fast verticaly that the eye can't see the spot moving. The lowest line under the digits is not significant, it his the place where the spot is parked when not used to draw a segment. |
|
| During the second period, we do exactly the same, with horizontal middle segments only : |
|
| Then third period draws horizontal lower segments : |
|
|
This process is repeated again and again very quickly, and this is what the eyes can see, thanks to retinal persistance : |
|
To be sure that the spot will trigger exactly when we want, a PIC output will give a synchronization pulse to the external trigger input of the oscilloscope.
CIRCUIT DIAGRAM
How simple ! It will work with any PIC with at least a PORTA and a PORTB.
Here is how to do with a PIC16F84A :
Clic on the schematic to enlarge
Source code
Here is the mikroC source code. Since it is less than 900 words of program, it can be build with unlicenced mikroC (free, no licence key needed) :
|
Instruction for use
Please add comments, suggestions and report bugs to me in my forums