Introduction: Oscilloscope Booster-Pack for the TI C2000 Piccolo LaunchPad
This Instructable presents a "Minimum-Build" USB Oscilloscope targeted for students and hobbyists.
The TMS320F28027 microcontroller in the Texas C2000 Piccolo LaunchPad has one of the fastest on-chip Analog-to-Digital converters providing simultaneous sampling of 2-channels at 2 MSPS. Adding only two PGA-113 chips to this implements the 1 Meg Ohm input impedance and programmable gain requirements of a typical oscilloscope.
Details of the the add-on "Booster-Pack", specifications, schematics, hardware, embedded and GUI software are provided in the next steps.
This approach aimed at minimizing the build effort to achieve low cost oscilloscope is based on my previous DIY projects:
We need the: LAUNCHXL-F28027 C2000 Piccolo MCU F28027 LaunchPad™ development kit
and the components in the BOM
I have some spare PCB's for anybody who is interested.
Step 1: Specifications
This USB connected unit implements a microcontroller based 2-Channel Oscilloscope providing continuous sampling rates up to 2.0 Msps. Common DSO features such as XY-mode, spectrum analysis, waveform capture and data saving are provided. The input range is ± 10.0V with additional gain settings of X2 and X5. Trigger and sweep options are also provided.
Step 2: Block Schematic and Function Description
The Booster Pack built around two Texas Programmable-Gain-Amplifiers and associated circuitry is connected to the C2000 Launch pad using the extension pins provided. The unit is powered and controlled from the USB port of a PC.
The configuration is optimized so that only two additional integrated circuits on the Booster Pack powered by the +5V and +3.3V supply from the C2000 are required to provide the full functionality of this Digital Storage Oscilloscope.
The Booster Pack and C2000 exercise all the functionalities provided by the TMSF28027 microcontroller:
- Analog inputs are connected to the two PGA’s
- The PGA gains are set using the SPI interface
- Analog outputs from the PGA’s are fed to the ADC inputs ADCINA1 and ADCINB1 which are simultaneously converted
- Analog outputs from the PGA’s are also fed to the two comparators COMP1A and COMP2A whose outputs are looped back as interrupts to the processor
- PWM1A and PWM2A outputs are averaged to provide the DC offsets for CH1and CH2.
- Data is transferred using the serial interface to the FT2232H USB to serial converter
- The internal clock is used with temperature compensation
The TMSF28027 microcontroller implements the main Oscilloscope Functions.
- Analog to Digital conversion of the CH1 and CH2 signal conditioned inputs at the required sampling rates
- Trigger interrupt handling
- Responding to serial commands from PC and sending back the acquired data.
The TMSF28027 microcontroller is ideally suited to this task as it permits simultaneous 2-channel A/D conversion at rates up to 2MSPS, has internal comparators which can handle the trigger functionality using interrupts, provide PWM outputs which are used to set the input offset voltages and a SPI interface for controlling the PGA’s.
Step 3: Graphical User Interface
Microsoft Windows based GUI software has been developed to interface with the Aj_Scope4 via the USB port of a PC.
A Visual Basic .Net 2.0 based GUI program is used to control the functions of the Aj_Scope2. An Aj_Scope.exe along with associated ZedGraph.dll and the XDS100v2 FTDI USB driver files has been tested for compatibility with Windows XP and Windows 7, 8 and 10 with .Net 2.0.
The XDS100v2 FDTI VCP drivers are provided by Texas Instruments
The GUI based Windows software on the Host PC permits checking for available COM ports and connecting to the port on which the hardware is connected. Once connected the hardware unit responds with a ready signal.
Display and trigger modes, sampling rate, channel gains, channel offset trigger offset and number of samples can be set using the simple controls.
The RUN button initiates the signal capture single, repetitive or over-plotted.
Initially signals can be acquired in auto / single mode after with suitable changes can be made in the gain and offsets and a trigger level set. Repeat mode can now be used for continuous display of the signals. Display of Ch1/Ch2 is possible with trigger by either Ch1 or Ch2.
Finally an EXIT button is provided to close the program and exit.
Step 4: Functional Description
The circuit of the Aj_Scope4 has been optimized for the minimum components meeting the overall system requirements. The details of each circuit are as follows:
An input potential divider with a ratio 5:1 and an input impedance of 1 Meg Ohm is formed by resistors (R1+R2) /(R3+R4+R5+R6) 835k:/168k. Capacitors C1 and C2 are added so as to compensate for any input capacitance of the PGA-113.
PWM2A a PWM output of the micro-controller is filtered in two stages by R6/C4 and R5/C3 and produces a DC offset voltage at the junction of R4/R5 based on the duty cycle of the PWM. This offset voltage is initialized to produce a fixed VDD/2 voltage at the output of the PGA-113 which is then changed by the Ch1 offset voltage slider around this value. The PWM duty-cycle is suitably adjusted for different gain settings.
The PGA-113 is connected to the micro-controller through an SPI interface in order to setup the gain values 1/2/5. VOUT at Pin 1 of the PGA-113 is fed as an analog input to the microcontroller within a working range 0-VDD. This output is fed through a 180 ohm resistor R13 as an input to the internal comparator CMP2A of the microcontroller. This voltage is used for the trigger function.
The TMSF28027 processor on the C2000 is powered from the USB bus. A reset switch is provided at the MCLR pin. The processor is programmed to operate at 50MHz using the internal OSC1. This internal clock is used with temperature compensation.
The PGA gains are set using the SPI interface Analog outputs from the PGA’s are fed to the ADC inputs ADCINA1 and ADCINB1 which are simultaneously converted Analog outputs from the PGA’s are also fed to the two comparators COMP1A and COMP2A whose outputs are looped back as interrupts to the processor.
PWM1A and PWM2A outputs are averaged to provide the DC offsets for CH1 and CH2.
Data is transferred using the serial interface to the FT2232H USB to serial converter
The inputs are sampled based on the sampling-rate set and data stored in two internal arrays corresponding to CH1/CH2. Sampling can be asynchronous or based on interrupts which are generated by the comparators whose reference is set to the desired value based on commands.
Step 5: Printed Circuit Board
The circuit schematic and PCB are designed in Autodesk Eagle
Step 6: Software and Design Files
Connect the C2000 LaunchPad and install the driver files from XDS100 Drivers v1.0
The TMS320F28027 is programmed through the USB interface using the free programmer from Coadskin using the Aj_Scope4.Hex
For programming set SW1 ON , SW2 OFF, SW3 OFF
Executing the GUI program:
For executing the code set SW1 ON , SW2 ON, SW3 OFF
Place the Aj_Scope.exe and Zedgraph.dll in a common folder and execute the Aj_Scope.exe file
Eagle and Gerber files are included in the archive