JAL Scope


¡¡ STILL WORKING ON IT !!

JAL Souce File

Windows Program (~180KB)  (Updated to 2002-June-02)


     JAL Scope is intended to be a very very basic digital scope to see what can you do with a PIC. Project is still under developement, so finally program will be diferent,and shows many feactures of comercial scopes but in a "toy" level.

     Don't spect a high performance scope with a simple PIC running with a common 20MHz xtal and a LM393. Errors in horizontal and vertical section (and other features) can be solved with other/more components, but the satisfaction of making yourself a scope with common chips like 16f876, a comparator and a MAX232 with a cost below €20 is have no value.

     Current working prototype is:

     Notes:

- Analog input is pulled down by a 2K7 resistor and wired both to Pin_A0 input and (+) of LM393 (comparator).

- Trigger Level potenciometer is wired both to Pin_A1 input and (-) of the same comparator

- Comparator out is pulled up with a 2K7 resistor (TTL levels) is wired to Pin_A4 digital input

 

     When Input Signal is greater than Trigger Level, high level will be present in PIN_A4. This is usefull to starting a frame conversion at same time in diferents sections of input signal sending the same porch of signal:

     As you can see Trigger Level is hand controlled, so if Input Signal don't reach trigger level, you'll see nothing and you must vary the potenciometer to start conversion. When this system runs ok, the green led is flasing on Windows program. The trigger level is showed as a small red line on the left side of the output screen.

 

     Horizontal section says the elapsed time between samples. And can have this values:

H selector

 seconds per sample

Niquist frecuency

0

 10 us (1)

 50 KHz

1

 20 us (2)

 25 KHz

2

 50 us

 10 KHz

3

 100 us

 5 KHz

4

 200 us

 2.5 KHz

5

 500 us

 1 KHz

6

 1 ms

 500 Hz

(1) 3 passes at 30us/s

(2) 3 passes at 60us/s

 

     If you are asking how can be done a 10us/s or 20us/s with a 16F877 here's an explanation. In fact minimun conversion time is only 30 us/s, but I scan the same porch of input signal 3 times with a small delay between them at starting trigger. This shows you a input signal scanned 3 times faster.

 

     Vertical section is not implemented yet, but I'm planning to set this values:

V selector

 0xFF value in volts

0

 0.5 V

1

 5 V

2

 10 V

3

 20 V

  

   You can see here some screenshoots of sines , triangles , and sines near niquist frecuency.

 

   The communication beetween PIC and the computer is done via serial at 19200 baud. Commands and data flows are looped in this order:

 Idle state

 "I"

 PIC -> PC
 Send Trigger Level

1 byte data

 PIC -> PC
 Get Vertical

1 byte data

 PC -> PIC
 Get Horizontal

1 byte data

 PC -> PIC
 Triggering

 "T"

 PIC -> PC
 Running

 "R"

 PIC -> PC
 Screen data

 240 bytes data

 PIC -> PC
 Finish state

 "F"

 PIC -> PC

   Both source codes are included, so you can add or modify:

-> A serial DAC to make a digital trigger level or even a "autotrigger" mode.

-> A good vertical section with some operationals.

-> A precise horizontal with a 20.48 MHz xtal.

-> ...

 

     Next avi video shows you a 1250 Hz square signal (PWM signal DC 50%) generated by the PIC on Pin_C2. Voltage input 0..5V. This PWM signal is in current JAL code.

 Video of the project

 Zipped AVI File (~260KB)


EOT -- Javier Martínez 2002-06-03