Oscilloscope based around the STM32F401 Black Pill and a color LCD screen
Oscilloscope based around the STM32F401 Black Pill and a color LCD screen, meant to be used as an educational tool
The goal of this project was to create a simple and easy to build but still very usable oscillsocope. I wanted to learn the basics of how a digital storage oscilloscope functions, while also ending up with something which can be used as an educational tool in the lab. A short description of how oscillscopes (and this one in particular) work can be found here.
The LCD screen is connected to SPI1 (PB3-SCK, PB5-MOSI, PB12-CS, PB13-RST, PB14-DC). The buttons are connected as follows:
The output of the analog frontend is connected to ADC1_IN0, which corresponds to PA0.
The schematic of the frontend can be found in the frontend.pdf file.
The Select button cycles through the different parameters, which can be adjusted using the Up and Down buttons.
Pressing Up and Down at the same time triggers the auto-calibration function. The tip and ground clip of the probed should be coupled together while calibrating.
The frontend of the instrument makes use of a virtual ground point which is 1.65V above the real ground. Because of this, the oscilloscope and the device under test must not be sharing the same ground reference. If you need to send data to the computer while measuring a device which shares ground with the scope, you should connect the computer via an opto-isolated adapter, while powering the oscilloscope from an external source.
The captured waveforms can be sent to a computer over UART.
Sending s
(lowercase s) to the UART tells the instrument to output the captured waveform in CSV format, which is compatible with the Tektronix TekScope app.
Sending S
(capital S) tells the scope to output raw data, which can be read by a companion app. This app automatically streams the captured data to TekScope, which allows almost real-time waveform analysis on the computer.
The code can be compiled with make
. The actual oscilloscope code of this project is located in Core\Src
, the scope.c, ui.c and wave.c files. Feel free to take a look, as they're commented for ease of understanding.