|
(continued page)
Firmware for basic analog data acquisition
Currently, a firmware is available which allows synchronous reading
of analog values while generating a programmable ramp voltage (by
PWM-modulation). This is a quite unique feature not found on many USB
based analog acquisition modules available on the market. Also 4
digital outputs can be set statically.
These features allow the realization of a variety of analog
measurements. Among these are (DC-)transfer characteristics of
circuits or components. The digital outputs enable multiplexer
switching etc.
The communication protocol with the host PC is very simple. Since all
the handshaking and error checking is done by the USB-hardware, no
software overhead is needed for these functions. The functions are:
Set Timebase, Set Digital Output Bits, Set Ramp Startpoint &
Endpoint and finally Start Capturing 400 samples. The sources are
downloadable from the bottom section of this page. The compiler is
from IAR-systems. More information goes with the download file.
PC-application
software
The PC application which accompanies the MSP430 firmware is written
in a script language which contains a GUI-Toolkit. One could compare
it with Visual Basic, but Tcl/Tk is more flexible, platform
independent, free of charge and stable.
Applications can be written 100% text-editor based. A big advantage
of a scripting language is its capability to change program code on
the fly, because it is an interpreter language. Tcl/Tk is a real
Rapid Application Development Tool (RAD).
More info on Tcl/Tk: www.tcl.tk.
Further information and a short introduction to scripting languages
is available via the download section of this page, together with the
sources. The program can be operated for demo purposes without target.
Click on the images to obtain a full size impression. The
source code of the whole application sums up to a size of only
26 KByte. The image above right shows an oscillogram in a slow
rate with sample averaging. The blue
channel records the battery voltage (here USB-supply: divided by 2).
The red channel records the ramp
voltage while the green channel
shows a sinewave from a function generator. The plot runs a 10
seconds range here. An interesting feature is the capability to store
recorded traces with the "persistance" control. Old traces
will turn automatically into grey.
The
left image shows operation at a sample rate of 40 kHz. 9 of 12 bits
are visible. The sine wave (red) has a frequency of approx.
500 Hz. After firmware optimization, 80 kHz @ 2 channels is possible.
This image shows also a console window. This is handy while debugging
the program. Portions of the code can be reloaded during program
execution (example: "source oscill.tcl". Variables can be
set and inspected here, in this case the variable for the number of
channels, which had not been implemented as parameter yet).
Further, an anchored pop-up dialog is shown here, where the
com port is specified. It defaults to 3, normally the virtual com
port for the USB channel, which is explained in the next section. For
demo purposes, "1" must be entered here (right click first
on the F10 button). Here it can be noted that window locations are
saved together with a few parameters in an .ini-file for convenient
program restart.
The program is designed to have an excellent operability without mouse.
I hope this will set new standards. Each window can be focused from
any program state with one of the function keys or buttons in the
main window, which is typically located at the bottom line of the
monitor. Within each window, numeric keys allow direct access to
controls. When a window has no focus, the controls are grey shaded in
order to remind key inaccessibility (see the second image). When the
mouse moves in a nonfocus window, the controls become active
immediately. The space bar serves as the oscilloscope run/stop
control and is accessible regardless focus window. When the timebase
control has focus, the timebase can be modified during run by means
of the cursor keys. Hitting the space bar does not defocus the
timebase control. On slow sample rates, a timebase modification is
effective immediately, due to the design of the PC-MSP430 interface.
The sliders in the ramp generator window can also be operated with
cursor keys. Key focus on sliders is clearly visible by a surrounding
green rectangle. Ramp generator slider actions also work during
oscilloscope run.
Finally, custom windows can be designed to accomodate special
requirements. A sample is given with the download package. A custom
window can fully utilize the current three general purpose resources.
It can automatically open other windows, define other axes and even
can define own equations to express the relationship between
ADC-value and vertical display position (example: reciprocation).
This is possible thanks to the expression evaluator in Tcl.
FTDI software resources
As stated above, a virtual com port represents the USB channel. FTDIchips
delivers .dll-based drivers as well as virtual com port drivers.
Despite the capability of Tcl to load DLLs and call the functions in
the DLL, the usage of the virtual com port is the most simple
approach. This is true, since Tcl fully supports serial communication
via com ports. Moreover, the inclusion of DLLs means platform
dependency, while the serial approach also works with Linux and UNIX,
provided USB-resources appear as a serial stream to the application.
More information: www.ftdichip.com
(soon individual information will be provided) |