Embedded Signal
Processing
Project 6: Digital Capacitor
Overview
- ============================
WARNING !! ====================================
- **** WARNING **** YOU MUST USE
THE SPECIAL 3-PAGE REPORT TEMPLATE BELOW!
- Because of special reporting requirement, 3-page length, and
extensive theory, this project is more heavily weighted
- This project is a prelude to
what is expected in final projects and final reports
- A well-written report/paper is EXPECTED
- STRONGLY RECOMMEND that you read IEEE
authorship series: How to Write for Technical Periodicals
& Conferences
- ==============================================================================
M.S. students randomized
groups of two each week, never working with same student, unless
otherwise directed by instructor.
Ph.D. students have option to choose their groups (all Ph.D. or
mix), with or without randomization.
The objective of this project is to become familiar with:
- Programming a Digital Capacitor using
the 16-bit ADC and 12-bit DAC on the FRDMK64F using mbed.org online IDE
- Using the Ticker.h mbed library
to create interrupt-driven
timing
NOTE: Use the Project Report Template and see below
for minimum required data content
your reports and demos.
IN NO CASE may code or files or data or pictures be exchanged
between student groups, there is to be NO COPYING of group
reports!
Also, each student must be able to independently
answer any questions themselves during demos.
All students are expected to learn all aspects of every project.
Nevertheless, students are encouraged to collaborate (not copy)
during the lab sessions.
- Some technical notes:
- The FRDMK64F board uses the 100-pin MK64FN1M0VLL12
MCU, with
- maximum operation frequency of 120 MHz, 1 MB of flash, 256
KB RAM,
- full-speed USB controller, Ethernet controller
- 12-bit DAC (see pin DAC0_out on the Arduino header)
- 16-bit ADC (see pins A0 to A5 on the Arduino header)
- 68 GPIO (see pins AD0 to AD15 on the Arduino header)
- The 100-pin package on the FRDMK64F has one DAC module, the 121-pin and
144-pin packages have two DAC modules.
- For more ADC information, see:
- Theory on digital
capacitors and digital inductors
- Theory on stability
of digital capacitors and digital inductors
Part 1, Digital Capacitors
- See below for minimum required data
content for your reports and your demos
- In this part, the 16-bit ADC and 12-Bit DAC are used to
implement a digital capacitor on the FRDMK64F using mbed
IDE
- ADC and filter timing is set using the mbed Ticker.h library
- Create the digital capacitor and follow the instructions as
follows
- NOTE: some slower boards might
not work properly at 80 KHz
- see instructor if you think
you need to adjust timer for 50 KHz
- if you do adjust, you must
also make changes (as needed) in the theory
- Download the instructions for the digital capacitor
experiment (see instructor for password)
- You may use (after fixing the errors in this file) the excel
template p06templateFreqPlot.xlsx
You must fix the data and theory
in this template file
- Follow the instructions, and add results to your report as
indicated below
- Notes on measurement of impedance as a function of frequency
- Do not underestimate the time required to measure the
frequency domain response of impedance,
- … and do not underestimate the need for each group to
review methods for measuring impedance using an oscilloscope
at frequencies between 1 KHz and the Nyquist limit (half
sample rate). NOTE: network analyzers cannot
measure your circuits, since these instruments do not
measure below 30 KHz.
- Your plots should have at least 20 points showing real and
imaginary parts of Z(s), for example from 1 KHz to 40 KHz.
- It would be best for one member in each group to
begin measurements of a simple known circuit such as 200
ohms in series with 10 nF in the lab, … so you are prepared
to measure your embedded project later. Measurement of
this known circuit will ensure confidence in you chosen
measurement technique (do not skip this).
- Some example measurement methods:
Report Data
- ============================
WARNING !! ====================================
- **** WARNING **** YOU MUST USE
THE SPECIAL 3-PAGE REPORT TEMPLATE Here:
- Special 3-page report
template ( embDspMidtermProjTemplateSec.docx ) for
this project (see instructor for password)
- You MUST make full use of all 3 pages, empty space will be
severely frowned upon
- A well-written report/paper is
EXPECTED
- STRONGLY RECOMMEND that you read IEEE
authorship series: How to Write for Technical Periodicals
& Conferences
- Clearly describe everything, including:
- varibles in block diagrams
- variables in formulas
- units of variables KHz, pF, nH, m, s,
- all traces on oscilloscope plots
- all curves on plots
- all results in any tables
- Minimum required data content for
your report and demos
- Required theory content:
- For a negative capacitor, , T=12.5 μs, Rs = 50 Ω, and
C=-40 nF and 80,000 samples/s, provide:
- the difference equation for Vadc[n] in terms of vin[n]
and vin[n-1]
- All other equations as required in the template
- Required software code excerpt content:
- The single most important line
of code in main.cpp to do the positive cpacitor
difference equation
- Something similar to "y=0.2f*x+0.8f*xold;"
- The single most important line
of code in main.cpp to do the negative cpacitor
difference equation
- Something similar to "y=0.2f*x+0.8f*xold;"
- Required tabular data content:
- The values for:
- Measured peak current I1
in mA
- Measured dv/dt
in V/s
- Measured peak current I2
in mA
- Theoretical parasitic resistance
Rneg (it may be negative) of the -40 nF
capacitor?
- Theoretical stability factor
T/(Rs C) (it may be negative) of the -40
nF capacitor?
- Measured value of negative
capacitance Cneg in nF as computed from square
wave and i=Cdv/dt
- Required pictures/photos content:
- Figure numbering "Axx" below refer to the lab writeup
figure numbers, not the special 3-page report-template
numbering
- Block diagram
- Legible picture (if pdf of your report is
"zoomed/magnified") oscilloscope photo showing 2 KHz
sinewave ADC input, DAC output voltages, and current
for " Sine wave 40 nF digital capacitor"
similar to Fig. A6
- Legible picture (if pdf of your report is
"zoomed/magnified") showing "|Zin| frequency response of positive 40 nF
digital capacitor" similar to Fig. A7
- Legible picture (if pdf of your report is
"zoomed/magnified") showing "Real and
imaginary parts of Zin frequency response of positive 40 nF
digital capacitor" similar to Fig. A7
- Legible picture (if pdf of your report is
"zoomed/magnified") oscilloscope photo showing 40 nF
digital capacitor 2 KHz triangle wave ADC input, DAC output
voltages, and current for "Triangle wave
40 nF digital capacitor"
similar to Fig. A9
- Legible picture (if pdf of your report is
"zoomed/magnified") oscilloscope photo showing -40 nF
negative digital capacitor 2
KHz triangle wave ADC input, DAC output voltages, and
current for "Triangle wave
-40 nF negative digital capacitor"
similar to Fig. A9
- Project Demos
- Be prepared to demonstrate and discuss items such as:
- Demonstrate sine wave response 40 nF as Fig. A6
- Demonstrate triangle wave response 40 nF as Fig. A9
- Demonstrate triangle wave response for -40 nF as Fig. A9
- Change the sampling period and sampling rate
- Change C for a digital capacitor
- Set breakpoints
- Start and stop the debugger
- Demonstrate a full clean/build
- Be prepared to answer questions such as:
- What is frequency response of the capacitors?
- What is z-transform of the difference equations?
- What port number is ADC (PT???)
- What port number is DAC(PT???)
- How can the value of the digital capacitor be changed?
- What happens if the sample rate changes for the capacitor
code?
- Which line of code sets up the interrupt/timer?
- How does myDsp() subroutine code get executed, if it is
not called inside of main{}?
- What is an interrupt?
- Explain stability criteria.
- Where are stable poles in the z-plane?
- What is the starred transform?
Report:
- See above project description for required
report data content.
- NOTE Report Template Use the
special 3-page template given above
- One pdf-format must be emailed to the instructor at the
beginning of the class meeting of the demo.
- One hardcopy per student, plus
one extra hardcopy for the instructor, should be brought to
class for the demo.
- Do not add extraneous pages or put explanations on separate
pages unless specifically directed to do so. The instructor will
not read extraneous pages!
- YOU MUST ADD CAPTIONS AND FIGURE NUMBERS TO ALL FIGURES!!
Copyright 2015 T. Weldon
Freescale, Kinetis are registered trademarks of Freescale
Semiconductor, Inc. Texas Instruments, TI, C2000, and
Code Composer Studio are a registered trademarks of Texas
Instruments Incorporated. Adafruit is a registered
TradeMark of Limor Fried. ARM, Cortex and Keil are
registered trademarks of ARM Limited (or its subsidiaries).
Apple, Yosemite, Mac OS, iPhone, iPad, MacBook, Mac, iTunes, and
Xcode are trademarks of Apple inc. All other product or service
names are the property of their respective owners. Arduino
is a registered trademark of Arduino.