janb
09-13-2007, 10:34 AM
Hi,
I was really fascinated by this 20 MHz digital scope project and a bit· disappointed it can't be made to work on a USB-serial plug. I wanted to debug my problems with serial port at 9600 baud so decided to build· an analog trace scope. As you see on photos it works!
It uses serial 12bit-ADC (MAX144) which can be readout at 83 kHz using one cog under ASM. The version· I got· to work features· a circular buffer· w/ 220 bins.· User can set:
- sampling period:· any up to 83kHz
- trigger threshold in ADC units
- select to trigger on leading or trailing edge of the signal
- pick # of pre-trigger bins to be·preserved (in expense of 220 bins total available)
- reset of a·HUB variable from the main program causes other cog running ASM code to activate trigger and take another set of 220 data points
The graphic part is very primitive, no user interface, one needs to hardcod # of X,Y pixels, # of divisions and set conversion between world coordinates and· screen pixels.
I have attached the main SPIN code for illustration how simple· is the interface.
Attached photos show 60 Hz AC voltage· passed through a diode and clamped w/ small capacitor. The maxY on the display is set to 2000 ADC,· maxX=220 pixels.
Figs 1 & 2 were taken·w/ sampling rate of 8 kHz.
Fig 1 uses· trigger threshold of 100ADC·on positive edge (marked as short horizontal bar)
Fig 2 uses threshold of 1000 ADC·on negative edge.
Fig 3 is as fig 2 except I used maximal possible sampling rate of 83 kHz.
It was a lot of fun working on this using Propeller cogs (after I was advised to not use local variables in assembler code - thanks deSilva !)
I'll be happy to share the code if anyone wants it. It is moderately commented.
Jan
---------------------
September 15, 207 - full code is attached
Post Edited (janb) : 9/15/2007 5:43:19 PM GMT
I was really fascinated by this 20 MHz digital scope project and a bit· disappointed it can't be made to work on a USB-serial plug. I wanted to debug my problems with serial port at 9600 baud so decided to build· an analog trace scope. As you see on photos it works!
It uses serial 12bit-ADC (MAX144) which can be readout at 83 kHz using one cog under ASM. The version· I got· to work features· a circular buffer· w/ 220 bins.· User can set:
- sampling period:· any up to 83kHz
- trigger threshold in ADC units
- select to trigger on leading or trailing edge of the signal
- pick # of pre-trigger bins to be·preserved (in expense of 220 bins total available)
- reset of a·HUB variable from the main program causes other cog running ASM code to activate trigger and take another set of 220 data points
The graphic part is very primitive, no user interface, one needs to hardcod # of X,Y pixels, # of divisions and set conversion between world coordinates and· screen pixels.
I have attached the main SPIN code for illustration how simple· is the interface.
Attached photos show 60 Hz AC voltage· passed through a diode and clamped w/ small capacitor. The maxY on the display is set to 2000 ADC,· maxX=220 pixels.
Figs 1 & 2 were taken·w/ sampling rate of 8 kHz.
Fig 1 uses· trigger threshold of 100ADC·on positive edge (marked as short horizontal bar)
Fig 2 uses threshold of 1000 ADC·on negative edge.
Fig 3 is as fig 2 except I used maximal possible sampling rate of 83 kHz.
It was a lot of fun working on this using Propeller cogs (after I was advised to not use local variables in assembler code - thanks deSilva !)
I'll be happy to share the code if anyone wants it. It is moderately commented.
Jan
---------------------
September 15, 207 - full code is attached
Post Edited (janb) : 9/15/2007 5:43:19 PM GMT