PIC Based Oscilloscope at 1MSPS. Sends data to PC at 57000 baud hosting a C# GUI program that shows the analog waveform
Please follow the complete guide here: http://mcuhq.com/33/diy-oscilloscope-using-a-dspic
This repo contains an MPLABX project using the free version of the XC16 compiler. The associated C# program graphs the data sent up from the MCU via a TTL-to-USB converter. Both the PC and embedded firmware can be built from source using free tools.
Here is a youtube video that shows the generated oscilloscope plotting the data in real-time: https://www.youtube.com/watch?v=lfed25rVaQg
These are the parts I used, however please note that digikey stock fluctuates over the years and so the exact model shown does not need to be used.
Part | Digkey | Description | Purpose |
---|---|---|---|
dsPIC33 | MA330020-ND | MODULE PLUG-IN DSPIC33F 44-QFN | Embedded Target |
8MHz Crystal | XC1922-ND | CRYSTAL 8.0000MHZ 20PF T/H | Accurate clock for ADC |
Crystal Capacitors | 399-8916-ND | CAP CER 20PF 50V NP0 RADIAL | Crystal Stabalization |
Decoupling HF Capacitors | BC2659CT-ND | CAP CER 1000PF 50V X7R RADIAL | Decoupling HF |
Decoupling LF Capacitors | 493-10470-1-ND | CAP ALUM 4.7UF 20% 16V RADIAL | Decoupling LF |
USB to TTL converter | 768-1015-ND | CABLE USB EMBD UART 3.3V .1"HDR | PC to MCU Communication |
Also needed is the PICKit 3 programmer.
A function generator would also be useful to test your scope for accuracy.
The compiler and IDE are freely available on Microchip's website. The tools work on linux, mac, and windows.
There are more than 15 connections that must be made between the plug-in-module (PIM) and Power/GND as well as the USB to serial adapter. I simply connected wires into the PIM. It would be better to design a circuit board or buy the explorer kit that would make it much easier.
- Make the needed connections between the PIM, USB converter, and PWR/GND. Your computer's GND will be shared between the circuit and the host.
- Clone the project from github
- Download MPLABx and the XC16 compiler and flash the PIM
- Run the C# computer program and select the COM port to listen to data from the PIC
Please submit all issues to the github tracker. Pull requests are also encouraged. General comments can be left at mcuhq.com