CURRENT ISSUE
Contests
Feature Article
|
|
Issue #205 August
2007
Handheld Multifunction Scope
by Jingxi Zhang & Yang Zhang
Start | Circuit Description | Software Developmentt | Improvements | Sources & PDF
SOFTWARE DEVELOPMENT
The software was developed using the Keil RealView microcontroller development kit. The Keil RealView is free for up to 16 KB of code. Unfortunately, the footprint of our project is about 18 KB, slightly larger than the free version’s limit.
The program is written in C and does not use any RTOS. It is an interrupt-driven system. A state machine is implemented in the main loop. The slide switch, push button, and thumbwheel rotary encoder as well as the on-chip peripheral interrupts, are triggered by the corresponding events. The ISR sets and resets the states of the state machine and the main loop executes consequent commands. Luminary Micro provided the Stellaris peripheral driver library, which is an abstract interface and hides the details of on-chip peripheral register manipulation. With the driver library, register file setting becomes easier and the source code is cleaner. Luminary Micro also includes the source code to the driver library. This enables you to look at the implementation or modify it if necessary.
In order to capture fast ADC samples, the system runs at its maximum rate of 50 MHz. The serial port data rate is set to 115.2 kbps. When the USB cable is connected to a host PC, the captured oscilloscope waveform can be sent to a PC through the USB serial connection emulation. A window display program written in C# on the .NET platform accepts and displays the waveform and the measurement data in other function modes on the PC display (see Photo 3).
![]() |
| Photo 3—A screenshot of the oscilloscope trace is shown in the PC window. The data is delivered through the USB serial emulation port. All the parameters and settings, along with the oscilloscope on the PC screen, are updated automatically when the handheld multifunction device’s mode changes. |
|
