From: Jan Panteltje on
Update
A cheap (< 10 $) very accurate LC meter with RS232 interface.
http://panteltje.com/panteltje/pic/lc_pic/

As suggested by others.. a bigger range would be nice.
I rewrote some of the asm to actually report the 3 frequencies as
well as the C and L value calculated.
That asm file is available here, it is just an initial test.
It was actually very easy to add this output:
ftp://panteltje.com/pub/lc_rs232_frequency_report.asm

The idea is to parse the RS232 output on the PC (or on a Palm or other device if you must).
and do the math there,.
Tests show you can have very large inductors (and likely also capacitors),
and the oscillator will keep working.
It looks like the 'out of range ' boundaries are artificially added in the original asm source
to prevent overflows in the 24 bit Microchip floating point lib, not because of hardware limitations.
The new output format looks like this:
Calibrating
F1=00060396

F2=00038430

C:F3=00060328
C = 1.4 pF
C:F3=00060325
C = 1.6 pF
C:F3=00060325
etc, one every 100 mS or so

Or, if in inductor mode:
L:F3=00000001
Over Range
L:F3=00000897
Over Range
L:F3=00000897
Over Range
L:F3=00000897
etc...

Here you see the oscillator is running still, but the PIC FP math fails.
I think the count should be multiplied by 10 (100 mS gate time), so 8970 Hz, with what I suspect is 100 mH connected in this test.
600kHz is the free running frequency.
This oscillator seems to be able to run extremely slow, maybe 1H is doable?

Anyways, you can parse this output with scanf() or something.
F1 is the free running frequency.
F2 with the 1 nF 1% calibration cap in circuit.
F3 with the object under test connected.

The software detects the L or C selector switch position, and precedes the line with 'C:' or 'L:'.

So parsing could be something like this:
double in, F3;
; read a line
; if first char is a 'C'
a = sscanf(C:F3%f", &in);
if (a == 1) F3 = in;
do math for C
etc etc

I intent to write a Linux GUI program based on the xforms library and will release this as open source under GPL license,
because it links to a lot of GPL stuff.
MS windows, and other OS users will have to write their own PC side software, I burned my xp disk, that gives me the time to do this :-)

The idea is to use the RS232 RTS line to activate the calibration mode (basically a PIC reset), that saves a switch.
Could not find a fitting switch in the junk box so that is good.
Back to watching starwars special edition and light swords.



From: Jan Panteltje on
On a sunny day (Fri, 13 Aug 2010 16:35:31 +1000) it happened Grant
<omg(a)grrr.id.au> wrote in <c9l966taved8llru3d4vr6queo0dt6hnvh(a)4ax.com>:

>Hmm, why is it 'they' didn't write packed BCD float point with
>arbitrary precision? Or doesn't the PIC have a half-carry for
>packed BCD? I saw the bit about keeping the value inside 16bit.

I dunno, on Mr Rice's site there is mention of a 32 bit version by somebody.
I have used the 32 bit integer routines in scope_pic to calculate the FFT sums.

>Maybe Rice would have tried harder if he didn't have a relay handy?

I did send him an email to thank him for his software, and about the new version, so far no reply.

I think with doing the math on the PC end the range can be bigger and accuracy should not suffer very much.
See my posting on this subject called 'Update'.
Working on it.
 | 
Pages: 1
Prev: Data Reduction... Further Questions
Next: Archie