CURRENT ISSUE
Contests
FEATURE ARTICLE
|
|
Issue #214 May 2008
Where Analog And Digital Collide
An Easy-To-Use LCR Meter
Third Place Microchip 2007 Design Contest
by Miguel Rusch
Start | LCR Meter | Back to Basics | The Big Picture | Creating a Wave | Analog Stages | Signal Conditioning | User Interface | Firmware | Take a Measurement | System Performance | Further Development | What's Next? | Sources & PDF
TAKE A MEASUREMENT
Figure 6 illustrates a simplified program flow for the function call that performs each test. The first tasks involve setting the ADC module, setting the DDS chip for the desired frequency, and setting the gain for both channels to a minimum value. The function of the initial acquisition loop is to auto-range the gain for each channel. Following offset correction and band-pass filtering, the dataset is scanned for the maximum value. If it’s below a preset threshold, the gain is increased (doubled) and the acquisition starts again. This process is continued until either a suitable gain is found or the maximum gain is reached.
![]() |
| Figure 6 — Two main loops make up the program structure that performs tests. The initial loop auto-ranges the analog stage gain before the second loop makes a complete measurement. |
The second loop within the test function acquires data in a similar way to the previous loop, correcting the offset and filtering the resulting array. The main difference is that additional code is executed to calculate the crossing point and from this the impedance and phase angle. The number of times the loop executes is dependent on the argument passed to the function.
Calculations of the parameters other than impedance and phase angle are made within RUN_TEST(). This calculation is dependent on the circuit model under consideration. Auto mode attempts to first check if the Parallel mode is suitable (small capacitance); otherwise, the series model is used. The resulting parameter values are recorded to a global structure. A call to functions within the graphics module displays the values within this structure. It also displays the circuit elements graphically.
Previous | Next *| Subscription Deals |*
|
